diff -Nru icedtea-web-1.3.2/aclocal.m4 icedtea-web-1.4/aclocal.m4 --- icedtea-web-1.3.2/aclocal.m4 2013-04-11 16:15:36.002212779 +0000 +++ icedtea-web-1.4/aclocal.m4 2013-05-03 19:23:54.428827387 +0000 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.12.2 -*- Autoconf -*- - -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,11 +13,11 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66],, +[m4_warning([this file was generated for autoconf 2.66. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) +To do so, use the procedure documented by the package, typically `autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) @@ -47,8 +47,7 @@ # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) @@ -94,8 +93,7 @@ pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried @@ -143,9 +141,9 @@ AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD @@ -158,7 +156,7 @@ Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -_PKG_TEXT])[]dnl +_PKG_TEXT]) ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) @@ -169,7 +167,7 @@ _PKG_TEXT -To get pkg-config, see .])[]dnl +To get pkg-config, see .]) ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS @@ -179,64 +177,22 @@ fi[]dnl ])# PKG_CHECK_MODULES - -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR - - -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR - -# Copyright (C) 2002-2012 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.12' +[am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.12.2], [], +m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -252,24 +208,22 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.12.2])dnl +[AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -288,7 +242,7 @@ # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you +# harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -314,21 +268,22 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -347,15 +302,16 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 17 +# serial 10 -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -365,7 +321,7 @@ # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -378,13 +334,12 @@ AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -392,9 +347,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -433,16 +387,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with '-c' and '-o' for the sake of the "dashmstdout" + # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -451,16 +405,16 @@ test "$am__universal" = false || continue ;; nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -508,7 +462,7 @@ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -518,34 +472,28 @@ # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' - am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 +#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ @@ -564,7 +512,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but + # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -576,19 +524,21 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. + # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -606,7 +556,7 @@ # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will +# is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -616,13 +566,14 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 19 +# serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -668,41 +619,31 @@ # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[AC_DIAGNOSE([obsolete], -[$0: two- and three-arguments forms are deprecated. For more info, see: -http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -713,35 +654,28 @@ [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -dnl Support for Objective C++ was only introduced in Autoconf 2.65, -dnl but we still cater to Autoconf 2.62. -m4_ifdef([AC_PROG_OBJCXX], -[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], @@ -769,14 +703,12 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -790,9 +722,9 @@ install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST([install_sh])]) +AC_SUBST(install_sh)]) -# Copyright (C) 2003-2012 Free Software Foundation, Inc. +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -815,13 +747,13 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 4 # AM_MAKE_INCLUDE() # ----------------- @@ -840,7 +772,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. +# Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -867,13 +799,14 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 7 +# serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -903,19 +836,45 @@ am_missing_run="$MISSING --run " else am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) + AC_MSG_WARN([`missing' script is too old or missing]) fi ]) +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -923,13 +882,13 @@ [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# -------------------- +# ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ------------------------ +# ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -940,14 +899,12 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. @@ -961,18 +918,22 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 +# serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -983,40 +944,32 @@ esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac -# Do 'set' in a subshell so we don't clobber the current shell's +# Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + test "$[2]" = conftest.file ) then @@ -1026,61 +979,43 @@ AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) +AC_MSG_RESULT(yes)]) -# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor 'install' (even GNU) is that you can't +# One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize +# always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2012 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -1089,24 +1024,24 @@ AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- +# --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2012 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -1117,11 +1052,10 @@ # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) @@ -1129,7 +1063,7 @@ _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of '-'. +# Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in diff -Nru icedtea-web-1.3.2/AUTHORS icedtea-web-1.4/AUTHORS --- icedtea-web-1.3.2/AUTHORS 2013-04-10 11:40:23.821668000 +0000 +++ icedtea-web-1.4/AUTHORS 2013-05-03 19:08:24.106521932 +0000 @@ -11,7 +11,9 @@ Peter Hatina Andrew John Hughes Matthias Klose +Alexandr Kolouch Michał Górny < mgorny@gentoo.org > +Jan Kmetko Francis Kung Denis Lila DJ Lucas @@ -24,6 +26,7 @@ Joshua Sumali Jiri Vanek Mark Wielaard +Jacob Wisor Man Lung Wong This project also includes code from the following projects: diff -Nru icedtea-web-1.3.2/ChangeLog icedtea-web-1.4/ChangeLog --- icedtea-web-1.3.2/ChangeLog 2013-04-11 15:48:53.818188000 +0000 +++ icedtea-web-1.4/ChangeLog 2013-05-03 19:16:30.463408219 +0000 @@ -1,4 +1,484 @@ -2013-04-11 Jiri Vanek +2013-05-03 Jiri Vanek + + Reverted "Remove only occurence of LEGACY_XULRUNNERAPI" patch + * plugin/icedteanp/IcedTeaNPPlugin.cc: (NP_GetMIMEDescription) + return type set-up by dependency on defined LEGACY_XULRUNNERAPI. + This one is set by IT_CHECK_XULRUNNER_API_VERSION during configure. + if defined, then old char* is used. New const char* is used otherwise. + +2013-05-02 Jana Fabrikova + + * tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSample.html: + new resource, html page for displaying the applet in browser + * tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSampleTest.java: + new testcase with 6 browser tests + +2013-05-02 Jana Fabrikova + + * Makefile.am: + Change in processing the goal + (stamps/compile-reproducers-testcases.stamp) + All .java files from reproducers testcases directory are + compiled, all non-java files are copied into the + TEST_EXTENSIONS_TESTS_DIR, i.e. + tests.build/test-extensions-tests directory + * tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp: + jnlp file for displaying the applet + * tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.java: + the applet used in the reproducer + * tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java: + adding 2 tests: that an icon is loaded, and that the button is + identified from the given icon and clicked by awt robot + * tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/buttonA.png: + the icon of the wanted button + +2013-04-26 Jiri Vanek + Jacob Wisor + + Added default, DE and PL localization's tweeks + * /netx/net/sourceforge/jnlp/resources/Messages.properties: + * netx/net/sourceforge/jnlp/resources/Messages_de.properties: + * netx/net/sourceforge/jnlp/resources/Messages_pl.properties + +2013-05-02 Adam Domurad + + Ensure that PluginAppletviewer is resized in case of error. + This fixes most of the cases of the error splash screen + not appearing. + * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java + (createPanel): Resize earlier, before erroring out. + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java + (PluginAppletViewer): Set size, remove fixme. + +2013-05-02 Adam Domurad + + * plugin/icedteanp/IcedTeaNPPlugin.cc: + Remove only occurence of LEGACY_XULRUNNERAPI + +2013-05-02 Adam Domurad + + Introduce PluginPipeMock utility methods. + * tests/test-extensions/sun/applet/PluginPipeMockUtil.java: New, + enapsulates PluginPipeMock initialization, cleanup. As well, contains + utility methods. + * tests/netx/unit/sun/applet/PluginAppletViewerTest.java: Use + newly introduced utility methods. + +2013-05-02 Adam Domurad + + * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java + (getBestOverloadMatch): Return null if a valid method was not found. + * tests/netx/unit/sun/applet/MethodOverloadResolverTest.java + (getResolvedMethod): New, gets ResolvedMethod from array of bundled class, + string, and parameters + (assertExpectedOverload): New variant that tests exact received values + (testArrayToStringResolve): Tests array conversion to String + (testArrayToArrayResolve): Tests array conversion to other arrays + +2013-05-02 Adam Domurad + + * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java + (getCostAndCastedObject): Remove code that had no effect before refactoring. + (getBestOverloadMatch): Move debug-only code to debug if-block. + +2013-05-02 Jiri Vanek + + Added various tests related to portalbank.no fixes + * netx/net/sourceforge/jnlp/cache/Resource.java: added fixme to warn + before wrong url comparator + * netx/net/sourceforge/jnlp/Version.java: removed useless main. Its + purpose moved to new + * tests/netx/unit/net/sourceforge/jnlp/VersionTest: some small tests to + version class + * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: + added tests to (getUrlResponseCode) and (findBestUrl) + * tests/netx/unit/net/sourceforge/jnlp/util/HttpUtilsTest.java: added tests for + (consumeAndCloseConnectionSilently) and (consumeAndCloseConnection) + * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest: added license header + * tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java: and + * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: added + support for simulation of not working HEAD request. + +2013-05-02 Jiri Vanek + + Fix for portalbank.no (trying get after failed head requests) + * net/sourceforge/jnlp/cache/ResourceTracker : (findBestUrl) + now trying GET after each error request of HEAD type. Changed and + added debug messages. (getUrlResponseCode) closing of stream + moved to separate method HttpUtils.consumeAndCloseConnectionSilently + * net/sourceforge/jnlp/util/HttpUtils.java: new file designed for + http utils. Now contains (consumeAndCloseConnection) and + (consumeAndCloseConnectionSilently) which calls consumeAndCloseConnection + but do not rethrow exception + * netx/net/sourceforge/jnlp/util/StreamUtils.java: removed + (consumeAndCloseInputStream) now improved and moved to HttpUtils + +2013-05-02 Jana Fabrikova + + * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: + refactoring - removing initStrGiven variable - now it only + matters if the initStr is null or not. Modifying the following + two methods: (charReaded) - if initStr is null the run method + can not be started from charReaded and the presence of initStr + is not checked in stdout. Method (getInitStrAsRule) returns rule + that is always true if initStr is null. + +2013-05-02 Jiri Vanek + + Renamed cz locales to be more general + * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: renamed to + * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: new file + * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java: + * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java + Adapted to new cz locales filename. + +2013-05-02 Jana Fabrikova + + * Makefile.am: + the directory $(TEST_EXTENSIONS_SRCDIR) (i.e. test/test-extensions) + added on classpath for running reproducers, unit tests, and test code + coverage for reproducers and unittests using emma and jacoco, that is + for the following 6 targets: + (stamps/run-netx-dist-tests.stamp) + (stamps/run-netx-unit-tests.stamp) + (stamps/run-unit-test-code-coverage.stamp) with EMMA + (stamps/run-unit-test-code-coverage-jacoco.stamp) + (stamps/run-reproducers-test-code-coverage.stamp) with EMMA + (stamps/run-reproducers-test-code-coverage-jacoco.stamp) + * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: + modifying the constructor, the default icon is taken from + ComponentFinder instead of loading from file + * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java: + added a block of initialization code - the default icon + * tests/netx/unit/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java: + unit test for the initialization code in ComponentFinder + * tests/reproducers/simple/AWTCommonResourcesOnly/resources/marker.png: + second copy of the default icon in a reproducer with resources only + * tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp: + jnlp file for displaying the applet + * tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.java: + the applet + * tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSampleTest.java: + adding 6 testcases testing clicking with different mouse + buttons on the applet + * tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java: + unit test for the initialization code in ComponentFinder + * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/marker.png: + first copy of the default icon, will be on classpath + +2013-04-30 Adam Domurad + + * tests/netx/unit/sun/applet/MethodOverloadResolverTest.java: Add missing + copyright header. + * tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java: Same. + * tests/netx/unit/sun/applet/PluginParameterParserTest.java: Same. + +2013-04-29 Jiri Vanek + + More granular initialization of AwtHelper + * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: added + (executeBrowser) which can work upon fully constructed url + * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: + (captureScreenAndFindAppletByIconTryKTimes) split to three: + (captureScreenAndFindAppletByIconTryKTimes) - unchanged, now using following + (initialiseOnScreenshot) initialize from given buffered image, creating area + (initialiseOnScreenshotAndArea) initialize from two given buffered images + +2013-04-29 Jiri Vanek + + Improved performance of scanning images, added masking of images + * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java: + (findExactImage) now using masks and is iterating over rows + (getMaskImage) new method to visualize mask + (getMask) new method to create mask + (getPixels) method to extract pixels from image to int array + +2013-04-29 Jana Fabrikova + + * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: + refactoring Point instead of Rectangle as icon position as + markerPosition + * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java: + refactoring Point instead of Rectangle as icon position in several + search methods + +2013-04-29 Jana Fabrikova + + * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: + fixing method (captureScreenAndFindAppletByIconTryKTimes), + which should not throw AWTFrameworkException + * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java: + fixing the return values of several search methods + * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java: + fixing the return values of several search methods + +2013-04-26 Jana Fabrikova + + * /tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java: + added a getter method getRules + * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: + the most important class of AWTFramework, combines closing listener and + possibility to use mouse and keyboard for input to tests + * tests/test-extensions/net/sourceforge/jnlp/awt/AWTFrameworkException.java: + exception that is raised in the framework whenever programmer did not + provide enough information + * tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java: + class with utility keyboard methods + * tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/MouseActions.java: + class with utility mouse methods + * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java: + class for finding components in a screenshot + * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundException.java: + exception that can be raised if an important component could not be found + * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java: + class for general image searching + * tests/reproducers/simple/AWTCommonResourcesOnly/resources/marker.png: + reproducer with resources only, contains the default icon marking + applets + +2013-04-26 Adam Domurad + + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java + (getCacheFile): Use decodeUrlAsFile instead of toURI().getPath(). + * netx/net/sourceforge/jnlp/util/UrlUtils.java + (decodeUrlAsFile): New, tolerates ill-formed URLs. + * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: + (testDecodeUrlAsFile): Test for (decodeUrlAsFile) + +2013-04-26 Jiri Vanek + Jacob Wisor + + Added polish localisation + * netx/net/sourceforge/jnlp/resources/Messages_de.properties + * netx/net/sourceforge/jnlp/resources/Messages.properties: minor fixes + * /netx/net/sourceforge/jnlp/resources/Messages_pl.properties: new localization + nearly complete list of PL values + * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java + Added PL as known translation + * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java: + Added tests to PL integration + +2013-04-26 Jiri Vanek + Alexandr Kolouch + + Improved and completed CZ localisation + * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: + Added missing items, some fixes + +2013-04-26 Jiri Vanek + Alexandr Kolouch + + Added CZ localization of itw-settings Xdesktop configuration file + * itweb-settings.desktop.in: added Name[cs] and Name[cs] keys with values. + +2013-04-26 Jiri Vanek + Jacob Wisor + + Added DE and PL localization of itw-settings Xdesktop configuration file + * itweb-settings.desktop.in: added Name[de], Name[pl], Comment[de], Comment[pl] + keys with values. Added Keywords key with values. + +2013-04-26 Jiri Vanek + + Silenced unittests + * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: and + * tests/netx/unit/sun/applet/PluginAppletViewerTest.java: + System.out.println replaced by ServerAccess.logOutputReprint + +2013-04-26 Jiri Vanek + + Fixed compilation under jdk6 + * netx/net/sourceforge/jnlp/util/JarFile.java: + is now implementing Closeable + +2013-04-26 Jiri Vanek + + Fixed regressed unittest and "cause" + * /netx/net/sourceforge/jnlp/NullJnlpFileException.java: + fixed header + * netx/net/sourceforge/jnlp/SecurityDesc.java: (SecurityDesc) is now + throwing NullJnlpFileException in case of null jnlp file. + * tests/netx/unit/net/sourceforge/jnlp/ParserBasic.java: is now using + correct DummyJnlpFile + * tests/netx/unit/net/sourceforge/jnlp/SecurityDescTest.java: new testfile. + (testNotNullJnlpFile) (testNullJnlpFile) testing the behavior for null + jnlp file and for existing jnlpfile. + * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: + (DummyJnlpFile) extracted to test-extensions and have removed incorrect have security + (testNullFileSecurityDescApplet) and (testNullFileSecurityDesc) is now expecting + NullJnlpFileException instead of results + * tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFile.java: new + reusable dummy jnlp file + +2013-04-25 Adam Domurad + + Add accidentally not included files from "Tests & test extensions for + mocking the plugin input & output pipes." + +2013-04-25 Adam Domurad + + Fix a dead-lock that can cause (namely) Firefox to hang. + * netx/net/sourceforge/jnlp/NetxPanel.java + (appletAlive): Remove flag. + (isAlive): Remove getter. + (initialized): New, explicit initialization flag. + (isInitialized): New, getter. + (runLoader): Set initialization flag when done (whether errored or not). + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java + (waitForAppletInit): Wait on initialization flag from NetxPanel. + (handleMessage): Remove redundant waiting for init. Respond properly to + GetJavaObject in case of error/time-out. + +2013-04-25 Adam Domurad + + * tests/netx/unit/net/sourceforge/jnlp/AsyncCallTest.java: Unit tests for + AsyncCall test extension. + +2013-04-25 Adam Domurad + + Tests & test extensions for mocking the plugin input & output pipes. + * Makefile.am + (stamps/test-extensions-compile.stamp): Make plugin classes available + to test extensions + * tests/test-extensions/net/sourceforge/jnlp/AsyncCall.java: New, helper + for doing asynchronous calls with an optional timeout. + * tests/netx/unit/sun/applet/PluginAppletViewerTest.java: New, uses + PluginPipeMock to test the javascript requests to the plugin. + * tests/test-extensions/sun/applet/mock/PluginPipeMock.java: New, helper + for getting the plugin requests and mocking the replies. + +2013-04-25 Jiri Vanek + + Locking disabled on windows machines + * netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java: + (lock) and (unlock) are no-op on windows. + +2013-04-25 Jiri Vanek + + Splashscreen now strip commit id from released versions + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java: + (stripCommitFromVersion) new method responsible for cutting + (drawBase) now using stripCommitFromVersion before printing drawing version + to splashscreen + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java: + (stripCommitFromVersion) new test for + +2013-04-24 Adam Domurad + + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: + Remove unnecessary line that can result in NPE + +2013-04-23 Adam Domurad + + * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: + Added tests for decodeUrlQuietly, normalizeUrl, normalizeUrlQuietly. + +2013-04-23 Adam Domurad + + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: Remove no + longer used constants. Remove (normalizeUrl). Update calls. + * netx/net/sourceforge/jnlp/cache/CacheUtil.java: Expand imports. + Update calls. + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: + Ensure file://-protocol URLs are encoded. + * netx/net/sourceforge/jnlp/util/UrlUtils.java: Add (normalizeUrl), + and related utility methods. Allow for optionally encoding file:// + URLs. + +2013-04-23 Adam Domurad + + Ensure document-base is properly encoded. + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java + (getCacheFile): Use URL#toUri().getPath() instead of URL#getFile(). + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java + (handleInitializationMessage): Don't decode document-base. + +2013-04-23 Adam Domurad + + Reproducer for URL parameters (eg ?a=b) in document-base. + * tests/reproducers/simple/URLParametersInDocumentBase/resources/URLParametersInDocumentBase.html: + Page that loads applet. + * tests/reproducers/simple/URLParametersInDocumentBase/srcs/URLParametersInDocumentBase.java: + Applet that prints code-base & document-base. + * tests/reproducers/simple/URLParametersInDocumentBase/testcases/URLParametersInDocumentBaseTests.java: + Test-driver. + +2013-04-23 Adam Domurad + + * netx/net/sourceforge/jnlp/NetxPanel.java + (exitOnFailure): Remove always-false field. + (NetxPanel): Remove overloaded constructor + (runLoader): Do not swallow LaunchException's. Remove dead + exitOnFailure code-path. Set applet status to APPLET_ERROR on + exception. + * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java + (createPanel): Update call to NetxPanel constructor. + +2013-04-23 Adam Domurad + + * tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.html: + Test AppContext context classloader from HTML applet + * tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.jnlp: + Test AppContext context classloader from JNLP application + * tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp: + Test AppContext context classloader from JNLP applet + * tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassLoader.java: + Print out context classloader for thread & AppContext, for + current thread & Swing thread. + * tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPClassLoaderTest.java: + Test runner for AppContextHasJNLPClassLoader + +2013-04-23 Adam Domurad + + Ensure JarFile handles do not leak. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: + Ensure close is called for each JarFile. + +2013-04-23 Adam Domurad + + * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java: + New, JNLPClassLoader unit tests for (checkForMain), (getMainClassName), + (activateNativeJar), and (isInvalidJar). Checks for file descriptor + leaks. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (isInvalidJar): Change to default visibility for testing purposes. + (checkForMain): Same. + (getMainClassName): Same. + +2013-04-23 Adam Domurad + + Rewrite of MethodOverloadResolver with detailed unittests. + * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java: + Rewritten to reduce duplicated code, fix very subtle bugs in + never-tested codepaths, obey spec properly. Introduced new helper types + where Object[] arrays with special-meaning positions were passed + around. + * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: + Updated to work with newly introduced types / refactored overload + resolver. + * tests/netx/unit/sun/applet/MethodOverloadResolverTest.java: In-depth + unit tests of hairy details of method overloading in JS<->Java. + +2013-04-23 Omair Majid + + PR1299 + * NEWS: Update with fix + * netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java + (initFromBrowserConfig): Fix typo in socks proxy setting key. + +2013-04-19 Jiri Vanek + + testing server allowed from makefile + * Makefile.am: + (stamps/netx-dist-tests-prepare-reproducers.stamp) added stamps/netx-dist.stamp stamps/plugin.stamp dependence + (stamps/test-extensions-compile.stamp) added stamps/netx-dist.stamp stamps/plugin.stamp dependence + (stamps/compile-reproducers-testcases.stamp) added stamps/plugin.stamp dependence + (run-test-server-on-44321) new target, starts server in deploy dir, on port 44321 + (run-test-server-on-random-port) new target, starts server in deploy dir, on random port + * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: (main) + added better access to random port + +2013-04-17 Jiri Vanek Added various self-describing tests for codebase * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1-writer1.html @@ -18,31 +498,21 @@ * tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedSecret.java * tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.java * tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenPartialStubCodeBaseTest.java - * tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_dotCodeBaseTest.jav - - -2013-04-11 Adam Domurad - - Fix PR580: http://www.horaoficial.cl/ loads improperly. Applets that - must share a class-loader now load sequentially. - * NEWS: - Mention the fix. - * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java - (getUniqueKeyLock): New, atomically grabs or creates a lock for the - unique key. - (getInstance): Ensure classloader initialization is locked by unique - key. - (decrementLoaderUseCount): Ensure classloader deinitialization is - locked by unique key, get rid of no-longer used locks. + * tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_dotCodeBaseTest.java -2013-04-11 Adam Domurad +2013-04-17 Adam Domurad + Jiri Vanek CVE-2013-1926, RH916774: Class-loader incorrectly shared for applets with same relative-path. - * netx/net/sourceforge/jnlp/NetxPanel.java: (NetxPanel) Construct - unique-key with absolute path + * netx/net/sourceforge/jnlp/PluginParameters.java + (getCodeBase): Removed + (getUniqueKey): Now takes absolute codebase + * netx/net/sourceforge/jnlp/NetxPanel.java: Pass absolute codebase in + getUniqueKey calls. + * netx/net/sourceforge/jnlp/PluginBridge.java: Same. -2013-04-10 Jiri Vanek +2013-04-17 Jiri Vanek Fixed gifar vulnereability with automated testcase * netx/net/sourceforge/jnlp/util/JarFile.java: IcedTea-Web replacement for @@ -80,46 +550,596 @@ * tests/reproducers/signed/GifarBase/resources/happyNonAnimated.gif: binary file, image, gif, used to create hacked gifars -2013-04-10 Jiri Vanek +2013-04-17 Jiri Vanek - Fixed news - * NEWS: stuff from 1.3.3 (2012-XX-XX), namely line PR1157: Applets can - hang browser after fatal exception moved under "New in release 1.3.2 (2012-XX-XX)" - As 1.3.2 was never released. Mentioned previous backport. - Added 1.3.2 release date. + removed java call to obtain jvm args for plugin + * /plugin/icedteanp/IcedTeaNPPlugin.cc: (get_jvm_args) + Java call replaced by call to recently added read_deploy_property_value + function. + +2013-04-12 Adam Domurad + + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java: + Clean-up generated code. + +2013-04-12 Adam Domurad + + Present more information in unsigned applet confirmation. + * netx/net/sourceforge/jnlp/resources/Messages.properties + (SRememberCodebase): Add codebase parameter. + (SUnsignedDetail): Change layout, add documentbase parameter. + * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java + (setupInfoPanel): Pass documentbase to SUnsignedDetail. + (createCheckBoxPanel): Ensure left-alignment. + (createButtonPanel): Less spacing above button. + +2013-04-12 Jiri Vanek + + Added help for extended applets security and settings + * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel: + (helpButtonActionPerformed) added code to open dialogue with help + * netx/net/sourceforge/jnlp/resources/Messages.propertie: + Included html help message + * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java: + added help button and logic to open help dialogue + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java: + Simple dialogue with JEditorPane with html help from properties and few + navigation buttons + * NEWS: mentioned extended appelts security + +2013-04-12 Jiri Vanek + + Added dialogue to allow setting of custom JRE + * launcher/itweb-settings.in: and + * launcher/javaws.in: check for custom jre less strict + * netx/net/sourceforge/jnlp/config/Defaults.java:made aware of + deployment.jre.dir constant + * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: added\ + KEY_JRE_DIR= "deployment.jre.dir" constant, user file occurrences extracted + to USER_DEPLOYMENT_PROPERTIES_FILE. + * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: used validation + of jdk when saving properties + * netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java: added text-field + to set JVM directory, friendly with logic and validation. + * netx/net/sourceforge/jnlp/resources/Messages.properties: added messages + to JVM selection and validation. + * netx/net/sourceforge/jnlp/util/StreamUtils.java: (readStreamAsString) + new utility method. + * NEWS: mentioned select-able JVM -2013-04-04 Saad Mohammad +2013-04-11 Adam Domurad - Added new option in itw-settings which allows users to set JVM - arguments when plugin is initialized. - * netx/net/sourceforge/jnlp/config/Defaults.java (getDefaults): - Added defaults for DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS. - * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: - Added new property (KEY_PLUGIN_JVM_ARGUMENTS) which stores the value of - JVM plugin arguments. + Remove legacy support for the old version of NPAPI. + * plugin/icedteanp/IcedTeaNPPlugin.cc: Remove if directives for old + version of NPAPI. + * plugin/icedteanp/IcedTeaNPPlugin.h: Same + * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same + * plugin/icedteanp/IcedTeaPluginRequestProcessor.h: Same + * plugin/icedteanp/IcedTeaPluginUtils.cc: Same + * plugin/icedteanp/IcedTeaPluginUtils.h: Same + * plugin/icedteanp/IcedTeaRunnable.h: Same + * plugin/icedteanp/IcedTeaScriptablePluginObject.h: Same + +2013-04-11 Adam Domurad + + Allow remembering applet confirmation for whole codebase. + * netx/net/sourceforge/jnlp/resources/Messages.properties: + Added SRememberAppletOnly, SRememberCodebase messages + * netx/net/sourceforge/jnlp/security/SecurityDialogs.java + (showUnsignedWarningDialog): Use UnsignedWarningAction + * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java + (UnsignedAppletTrustWarningDialog): Use UnsignedWarningAction + * net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java: + Introduce UnsignedWarningAction, add additional confirmation choices + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: + Support remembering action for entire codebase. + +2013-04-10 Jana Fabrikova + + * /tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java: + adding 11 testcases based on the interactive Liveconnect JS->Java + overloaded function resolution tests, tests with JSObject were already + included + * /tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java: + the applet whose methods are invoked from JS during the tests + * /tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js: + the JavaScript code for calling the applet methods from JS + * /tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp: + java network launch protocol file for displaying applet in the html + page + * /tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html: + the html page with java applet embedded, displayed in browser during + the tests + +2013-04-10 Jana Fabrikova + + * /tests/reproducers/simple/JToJSFuncReturn/testcases/JToJSFuncReturnTest.java: + adding 5 testcases based on the interactive Liveconnect JS->Java + function return type tests + * /tests/reproducers/simple/JToJSFuncReturn/srcs/JToJSFuncReturn.java: + the applet that calls JS functions + * tests/reproducers/simple/JToJSFuncReturn/resources/JToJS_FuncReturn.js: + auxiliary JavaScript code + * /tests/reproducers/simple/JToJSFuncReturn/resources/jtojs-funcreturn.jnlp: + jnlp file for displaying applet in the html page + * /tests/reproducers/simple/JToJSFuncReturn/resources/JToJSFuncReturn.html: + the html page where the applet calling JS functions is embedded + +2013-04-08 Jiri Vanek + + * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java: + Removed good --sm-client-disable switch. No longer supported by epiphany + +2013-04-04 Jiri Vanek + + Plugin is now honoring the custom jre + * launcher/itweb-settings.in : + * launcher/javaws.in: + In case that custom jre do not exists, complains, and use default rather + * plugin/icedteanp/IcedTeaNPPlugin.cc: (get_plugin_executable) and + (get_plugin_rt_jar) now tries to return custom values before returning the + default one. + +2013-04-03 Jana Fabrikova + + * /test/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java: + added annotation KnownToFail in googleChrome and chromiumBrowser to + the method (AppletJToJSFuncParam_JSObject_Test) + * /test/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java: + added annotation KnownToFail in midori, epiphany, googleChrome + and chromiumBrowser to the methods (AppletJToJSGet_1DArray_Test) + and (AppletJToJSGet_2DArray_Test) + +2013-04-03 Jana Fabrikova + + * /tests/test-extensions/net/sourceforge/jnlp/annotations/KnownToFailInBrowsers.java: + the implementation of new annotation, which has an array of + browsers of type Browsers[] named failsIn + * /tests/junit-runner/JunitLikeXmlOutputListener.java: + in method (testDone) the testcases that are known to fail in + current browser are detected in addition to the tests that are + k2f in all browsers + * /tests/junit-runner/LessVerboseTextListener.java: + added method (getK2FinB) reading the annotation, + in method (printK2F) the testcases that are known to fail in + current browser are detected in addition to the tests that are + k2f in all browsers + +2013-03-28 Adam Domurad + + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java + (normalizeUrlAndStripParams): Moved. + * netx/net/sourceforge/jnlp/util/UrlUtils.java + (normalizeUrlAndStripParams): New, moved from + UnsignedAppletTrustConfirmation. + * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java + (testNormalizeUrlAndStripParams): Moved. + * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: + New, has (testNormalizeUrlAndStripParams) from + UnsignedAppletTrustConfirmationTest. + +2013-03-22 Jiri Vanek + + Added code to parse properties and to find correct configuration files + from c++ part of plugin + * Makefile.am: IcedTeaParseProperties.cc added to be compiled with rest + of plugin + * plugin/icedteanp/IcedTeaParseProperties.cc: new file, contains implementation + for searching for config files and to read value from them + * plugin/icedteanp/IcedTeaParseProperties.h: public api for "library" + * plugin/icedteanp/IcedTeaPluginUtils.cc: + * plugin/icedteanp/IcedTeaPluginUtils.h: added new methods (trim) and + (file_exists) + * tests/cpp-unit-tests/IcedTeaParsePropertiesTest.cc: tests for library methods + * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: added tests for new methods + +2013-03-28 Adam Domurad + + Don't interrupt worker/consumer threads (can prevent shutdown code from + executing); instead use Object wait/notify methods. + * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java + (notifyHasWork): Replacement for thread interruption + (waitForWork): Replacement for thread sleeping + (run): Use waitForWork instead of Thread.sleep + (notifyWorkerIsFree): Removed -- misleading method. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (message): Make volatile, as it should have always been. + (notifyHasWork): Replacement for thread interruption + (waitForWork): Replacement for thread sleeping + (run): Use waitForWork instead of Thread.sleep + (getPermissions): avoid potential NPE if code source location is + missing + (free): Remove reference to notifyWorkerIsFree. + +2013-03-26 Adam Domurad + + Integration of unsigned applet confirmation dialogue. + * netx/net/sourceforge/jnlp/PluginBridge.java + (getArchiveJars): New, returns archive jars as list + * netx/net/sourceforge/jnlp/resources/Messages.properties: + Confirmation messages added to properties file + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (getInstance): Initialization refactored into createInstance + (createInstance): New, checks if unsigned applet is allowed, + initializes classloader. + (initializeResources): Don't consider no-jar applets signed. + * netx/net/sourceforge/jnlp/security/SecurityDialogs.java + (showUnsignedWarningDialog): Creates message with + DialogType.UNSIGNED_WARNING + * netx/net/sourceforge/jnlp/security/SecurityDialog.java + (installPanel): Add case for DialogType.UNSIGNED_WARNING + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java: + Expose locking members from interface + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java + (handleInitializationMessage): Do nothing if applets have been + disabled. + * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java: + New, security dialog that asks for unsigned applet confirmation. + * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java: + Implements the dialog contents for unsigned applet confirmation. + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: + Updates and checks applet confirmation storage, creates warning dialog + if required. + * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java: + New, tests relative & normalized path creation helpers. + +2013-03-26 Jiri Vanek + + Path validator fixed to be correctly multiplatform + * netx/net/sourceforge/jnlp/config/BasicValueValidators.java : + (FilePathValidator) now check absolute file by File.isAbsolute() instead + of by plain "/". + * tests/netx/unit/net/sourceforge/jnlp/config/BasicValueValidatorsTests.java : + New file to test new functionality. + +2013-03-25 Jana Fabrikova + + * tests/reproducers/simple/JavascriptFuncReturn/testcases/JavascriptFuncReturnTest.java + adding 5 testcases for testing calling javascript functions with + various return types from java + * tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.html + the html page for displaying browser tests + * tests/reproducers/simple/JavascriptFuncReturn/resources/Javascript_FuncReturn.js + auxiliary javascript functions + * tests/reproducers/simple/JavascriptFuncReturn/resources/javascript-funcreturn.jnlp + jnlp file for embedding applet in the html page + * tests/reproducers/simple/JavascriptFuncReturn/srcs/JavascriptFuncReturn.java + the applet that calls javascript functions + +2013-03-25 Jana Fabrikova + + * tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java + adding 21 testcases for testing setting javascript variables from java + * tests/reproducers/simple/JavascriptSet/resources/JavascriptSet.html + the html page for displaying browser tests + * tests/reproducers/simple/JavascriptSet/resources/Javascript_Set.js + auxiliary javascript functions + * tests/reproducers/simple/JavascriptSet/resources/javascript-set.jnlp + jnlp file for embedding applet in the html page + * tests/reproducers/simple/JavascriptSet/srcs/JavascriptSet.java + the applet that sets javascript variables + +2013-03-25 Jana Fabrikova + + * tests/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java + adding 7 new testcases for reading JS values from Java + * tests/reproducers/simple/JavascriptGet/resources/JavascriptGet.html + the html page for displaying browser tests + * tests/reproducers/simple/JavascriptGet/resources/Javascript_Get.js + auxiliary javascript functions + * tests/reproducers/simple/JavascriptGet/resources/javascript-get.jnlp + jnlp file for embedding the applet in the html page + * tests/reproducers/simple/JavascriptGet/srcs/JavascriptGet.java + the applet that reads values from javascript + +2013-03-25 Jana Fabrikova + + * tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java + adding 19 testcases for calling javascript functions from java with + parameters of various types + * tests/reproducers/simple/JavascriptFuncParam/resources/JavascriptFuncParam.html + the html page for displaying browser tests + * tests/reproducers/simple/JavascriptFuncParam/resources/javascript-funcparam.jnlp + jnlp file for embedding the applet in html page + * tests/reproducers/simple/JavascriptFuncParam/srcs/JavascriptFuncParam.java + the applet that calls functions from javascript + +2013-03-22 Adam Domurad + + * plugin/icedteanp/java/sun/applet/PluginParameterParser.java + (isInt): Revert behaviour to catching NumberFormatException + +2013-03-22 Adam Domurad + + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (findClass): Print stacktrace for ClassFormatError + +2013-03-22 Jiri Vanek + + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: + (isMatching) is now ignring archives if empty. + * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: + tests adapted and enriched for new archives processing. + +2013-03-21 Jiri Vanek + + Launchers made aware of custom set JRE + * launcher/itweb-settings.in: + * launcher/javaws.in: + are now scanning ~/.icedtea/deployment.properties and + /etc/.java/.deploy/deployment.properties for deployment.jre.dir property. + If found, then its java and rt.jar are used to launch applications. + +2013-03-20 Jana Fabrikova + + * tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: + adding few lines for not running test in Opera + * tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: + adding few lines for not running test in Opera + * tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java: + adding few lines for not running test in Opera + * tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java: + adding few lines for not running test in Opera + +2013-03-20 Jiri Vanek + + All occurences of hardcoded paths to java repalced by call of functions + * plugin/icedteanp/IcedTeaNPPlugin.cc: (appletviewer_executable) renamed + to (appletviewer_default_executable). (appletviewer_default_rtjar) new + variable to keep default rt.jar path. + (get_plugin_executable) and (string get_plugin_rt_jar) new functions, + returniong the default variables for now. + +2013-03-19 Adam Domurad + + * Makefile.am + (CPP_UNITTEST_EXECUTABLE): Add -lrt & -lpthread flags, which do not + seem to be brought in on all systems. + +2013-03-13 Jiri Vanek + + * NEWS: mentioned de translation + * AUTHORS: added Jacob Wisor + +2013-03-13 Jiri Vanek + Jacob Wisor + + Fixed strange sentences in default locales bundle. + * netx/net/sourceforge/jnlp/resources/Messages.properties: + +2013-03-13 Jiri Vanek + + Added tests for German i18n + * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java: + Enhanced to test also German localization . + * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java: + Enhanced to handle de messages and be prepared for locales with one language + but different nations. + +2013-03-13 Jiri Vanek + Jacob Wisor + + Added initial German localization + * netx/net/sourceforge/jnlp/resources/Messages_de.properties: + New file with German properties + +2013-03-05 Adam Domurad + + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (closeStream): Remove. + (verifySignedJNLP): Make use of StreamUtils instead. + * netx/net/sourceforge/jnlp/utils/StreamUtils.java + (closeSilently): New method. + +2013-02-28 Jiri Vanek + + * netx/net/sourceforge/jnlp/config/SecurityValueValidator.java: modifed + null check - no considered as correct value as being valid value in runtime. + +2013-02-27 Jiri Vanek + + Added backend and settings for extended applet security + * netx/net/sourceforge/jnlp/config/Defaults.java: deployment.security.level + added to defaults with its validator + * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: Added + deployment.security.level (KEY_SECURITY_LEVEL)key and + .appletTrustSettings (APPLET_TRUST_SETTINGS)filename with getters + * netx/net/sourceforge/jnlp/config/SecurityValueValidator.java: + Simple validator for value of deployment.security.level based on parsing + in AppletSecurityLevel.fromString * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: - (createMainSettingsPanel): Added JVM settings to the list of tabs. - (createJVMSettingsPanel): Returns a new JVMPanel object. - * netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java: - JVM settings panel. + Incorporated UnsignedAppletsTrustingListPanel panel + * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java: + Backend for main tables in UnsignedAppletsTrustingListPanel + * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java: + GUI for manipulate the deployment.security.level values and content of + .appletTrustSettings files * netx/net/sourceforge/jnlp/resources/Messages.properties: - Added a new items (CPJVMPluginArguments, CPHeadJVMSettings, - CPTabJVMSettings). - * plugin/icedteanp/IcedTeaNPPlugin.cc: - (plugin_start_appletviewer): Adds JVM arguments to the commands line list. - (get_jvm_args): Returns JVM arguments set in itw-settings. - * plugin/icedteanp/IcedTeaPluginUtils.cc: - (IcedTeaPluginUtilities::vectorStringToVectorGchar): New helper method - which returns a vector of gchar* from the vector of strings passed. - * plugin/icedteanp/IcedTeaPluginUtils.h: - Declaration of IcedTeaPluginUtilities::vectorStringToVectorGchar. + Added keys and values for new; user visible, strings + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityLevel.java: + Object representation of deployment.security.level value + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySettings.java: + Entrance singleton for current deployment.security.level policy and records. + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteUnsignedApplet.java: + Object representation of action upon record in .appletTrustSettings + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java: + Object representation of one item in .appletTrustSettings + .appletTrustSettings by itw (except settings part) + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java + Minimal set of functionality requested for accessing the + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegEx.java + Simple class which should help to distinguish between plain String + and String keeping UrlRegex + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java: + Extended implementation of UnsignedAppletActionStorageImpl which have + additional "for settings" functionality + * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: + Object representation of.appletTrustSettings file. It Should be multi-thread/app safe and + should be always actual. Based on LockingReaderWriter. + * netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java: + Utility class with functionality to lock file in muti-app/thread environment + * netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java: + Utility class with functionality to lock file during reading/writing + in muti-app/thread environment + * netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java: + Wrapper for common, but rare IOException extending RuntimeExceptionaround + for LockingReaderWriter to avoid numerous declarations. + * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: + Tests of main methods in UnsignedAppletActionStorageImplTest focused on matching + * tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriterTest.java: + Tests of multithread read/write to LockingReaderWriter + +2013-02-25 Adam Domurad + + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: + (createInstance): Extract initialization logic from 'getInstance' into + new 'createInstace' method. + (getInstance): Call newly introduced createInstance method. + +2013-02-25 Jiri Vanek + + Removed unused legacy-launcher sources + * launcher/java.c: + * launcher/java.h: + * launcher/java_md.c: + * launcher/java_md.h: + * launcher/jli_util.c: + * launcher/jli_util.h: + * launcher/jni.h: + * launcher/jni_md.h: + * launcher/jvm.h: + * launcher/jvm_md.h: + * launcher/manifest_info.h: + * launcher/parse_manifest.c: + * launcher/splashscreen.h: + * launcher/splashscreen_stubs.c: + * launcher/version_comp.c: + * launcher/version_comp.h: + * launcher/wildcard.c: + * launcher/wildcard.h: + Happily removed -2013-03-01 Adam Domurad +2013-02-21 Adam Domurad - Fix PR1157: Applets can hang browser after fatal exception - * NEWS: Add entry for PR1157 + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (getPermissions): avoid potential NPE if code source location is + missing + +2013-02-14 Adam Domurad + + PR835: javaws leaks connections + Uses HEAD requests if possible for testing URLs. Adds name to download + threads. + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: + (startThread): Add name to download thread + (getResourceUrlResponseCode): Get or fake an HTTP response code. + (findBestUrl): Use getResourceUrlResponseCode to first try a HEAD + request. Fall-back to GET rquest. + * netx/net/sourceforge/jnlp/utils/StreamUtils.java: + New file, contains utility for consuming input stream. + +2013-02-14 Adam Domurad + + * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: + Support HEAD requests. + +2013-02-13 Adam Domurad + + Fix PR580: http://www.horaoficial.cl/ loads improperly. Applets that + must share a class-loader now load sequentially. + * NEWS: + Mention the fix. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (getUniqueKeyLock): New, atomically grabs or creates a lock for the + unique key. + (getInstance): Ensure classloader initialization is locked by unique + key. + (decrementLoaderUseCount): Ensure classloader deinitialization is + locked by unique key, get rid of no-longer used locks. + +2013-02-13 Jiri Vanek + + Added test for hanging firefox by LaunchException and Improved AddShutdownHookTest + * tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html: + new file to launch applet with RuntimeException as result. + * tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html: + new file to launch applet with LaunchException as result. + * tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java: is + now also applet. + * tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java: + Added test (AddShutdownHookApplet)for applet, removed duplicate code by rules. + * tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java: + New test set which is launching exception throwing applet, and after exception + is thrown then it tries jsut stdou-ing applet. Second applet have to be + launched. + +2013-02-12 Jana Fabrikova + + * /tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java: + adding 19 testcases - 18 based on the interactive Liveconnect JS->Java + function parameter tests, 1 additional testcase for passing parameters + of type JSObject (from JS to Java) + * /tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java: + the applet whose methods are invoked from JS during the tests + * /tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js: + the JavaScript code for calling the applet methods from JS + * /tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp: + JNLP file for displaying applet in the HTML page + * /tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html: + the html page with java applet embedded, displayed in browser during + the tests + +2013-02-12 Jana Fabrikova + + * /tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java: + adding 50 testcases based on the interactive Liveconnect + JS->Java type conversion tests and 4 testcases for setting + java boolean and Boolean variables to nonempty strings + * /tests/reproducers/simple/JSToJTypeConv/srcs/JSToJTypeConv.java: + the applet whose variables are set from JS during the tests + * /tests/reproducers/simple/JSToJTypeConv/resources/JSToJava_TypeConv.js: + the JavaScript code for setting the applet variables from JS + * /tests/reproducers/simple/JSToJTypeConv/resources/jstoj-typeconv.jnlp: + JNLP file for displaying applet in the html page + * /tests/reproducers/simple/JSToJTypeConv/resources/JSToJTypeConv.html: + the html page with java applet embedded, displayed in browser + during the tests + +2013-02-07 Adam Domurad + + Ensure applet destruction cannot in the middle of initialization. * netx/net/sourceforge/jnlp/NetxPanel.java - (runLoader): Move dispatchAppletEvent into a 'finally' block. + (destroyApplet): wait for applet initialization + missing + +2013-02-06 Jana Fabrikova + + * /tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: + adding 1 testcase setting applets variable of type JSObject from JS, + adding KnownToFail anotation and @Bug annotation with id=PR1298 to + (AppletJSToJSet_intArrayElement_Test) and + (AppletJSToJSet_DoubleArrayElement_Test) methods + * /tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js: + adding the JSObject case to (doSetTests) function + * /tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java: + adding the JSObject variable to the applet and modifying + (printNewValueAndFinish) method in order to output new values + of JSObject variable + +2013-02-06 Jana Fabrikova + + * /tests/reproducers/simple/JSToJGet/resources/JSToJGet.html: + adding 1 testcase reading applets variable of type JSObject from JS + * /tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: + adding 1 testcase reading applets variable of type JSObject from JS, + small changes to evaluation of the applet's stdout methods, removing + KnownToFail anotation from (AppletJSToJGet_DoubleFullArray_Test) method + * /tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js: + removing parts of comment that are no longer true + * /tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js: + adding (test_get_JSObject) function also to the JS part of test + * /tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java: + adding the JSObject variable to the applet 2013-02-06 Adam Domurad @@ -138,6 +1158,82 @@ Remove erroneous VoidPluginCallRequest comment. Provide name for stream listener thread. +2013-02-03 Jiri Vanek + + Another renamed conflict file for case insensitive systems + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html + Renamed to ParallelAppletsTest_1_x_2EE.html + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html + new file. + * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: + (testParallelAppletsTest1Ex2s) adapted to renaming + +2013-01-31 Jiri Vanek + + Renamed conflict file for case insensitive systems + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html: + Renamed to ParallelAppletsTest_1_x_2EE.html + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html: + new file. + * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: + (testParallelAppletsTest1x2E) adapted to renaming + +2013-01-30 Jiri Vanek + + Add unit tests for locales and locales fixed + * netx/net/sourceforge/jnlp/resources/Messages.properties: + * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: + Added missing, filled empty and removed dangling items + * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java: + New unittest for missing, empty, duplicate or dangling locales. + +2013-01-30 Adam Domurad + + Fix for PR1292: Javaws does not resolve versioned jar names with + periods correctly + * netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java + (getUrl): Fix versioning of jar names that have periods, eg + 'foo.bar.jar'. Make method static for testing. + * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceUrlCreatorTest.java: + New, test version & pack URL encoding. + * tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarDisabled.jnlp: + New, tries to use versioned jar with versioning not turned on. + * tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarEnabled.jnlp: + New, tries to use versioned jar with versioning turned on. + * tests/reproducers/simple/VersionedJar__V1/srcs/VersionedJar.java: + New, prints simple message. + * tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java: + New, tests if VersionedJar has ran only with versioning turned on. + +2013-01-30 Jiri Vanek + + * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: + Iteration over launchExceptionChain done by pointer/get instead by iterator + to prevent ConcurrentModificationException. + +2013-01-30 Jiri Vanek + + Splashscreen error report made more detailed by stored LaunchErrors + * netx/net/sourceforge/jnlp/LaunchException.java: (LaunchExceptionWithStamp) + new inner class for storing timestamp togetehr with error. + (launchExceptionChain) new static list to capture LaunchErrors during + runtime. + * /netx/net/sourceforge/jnlp/resources/Messages.properties: + * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: + Added explanation string + * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: + Is now displaying launchExceptionChain in its error report and is copying + it to clipboard. + * tests/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialogTest.java: + (getTextTest) adapted calls of getText for new Date. + +2013-01-28 Adam Domurad + + Fix PR1157: Applets can hang browser after fatal exception + * NEWS: Add entry for PR1157 + * netx/net/sourceforge/jnlp/NetxPanel.java + (runLoader): Move dispatchAppletEvent into a 'finally' block. + 2013-01-16 Deepak Bhole PR1260: IcedTea-Web should not rely on GTK @@ -149,13 +1245,823 @@ is not found * plugin/icedteanp/IcedTeaNPPlugin.h: Removed gtk.h include +2013-01-16 Jiri Vanek + + Fixed set of paths to asm + * configure.ac: (IT_FIND_OPTIONAL_JAR([asm], ASM,) path enhanced by + objectweb-asm4/asm-all.jar. + +2013-01-15 Adam Domurad + + Unit test for PluginAppletSecurityContext#toObjectIDString. Make + PluginAppletSecurityContext more unit-testable. + * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: + Don't initialize security manager in constructor. Fix a few Java->JS + corner cases. + * plugin/icedteanp/java/sun/applet/PluginMain.java: Create testing-only + constructor for bypassing initialization of SecurityManager. + * tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java: + Unit test for all the corner cases of converting a Java object to a + string that can be precisely identified. + +2013-01-15 Adam Domurad + + Fix PR1198: JSObject passed incorrectly to Javascript + * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Pass extra data for + 'jsobject' object result messages. + * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same. + * plugin/icedteanp/IcedTeaPluginUtils.cc: Add special casing of + javascript references passed from java. + * plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java: + New permission for unboxing a JSObject's internal reference. + * plugin/icedteanp/java/netscape/javascript/JSObject.java + (getInternalReference): New, package-private, retrieves internal + reference (Must have proper permission). + * plugin/icedteanp/java/netscape/javascript/JSUtil.java + (getJSObjectInternalReference) New, utility for accessing + JSObject#getInternalReference from outside the package. + * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: + (toObjectIDString): New, creates a string that precisely identifies a + Java object. + (handleMessage): Replace a lot of duplicated functionality with + 'toObjectIDString'. + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Replace + duplicated functionality with 'toObjectIDString'. + * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java: + Don't print out type passed (differs from browser to browser). + * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java: + Don't check type passed (differs from browser to browser). Remove + known-to-fail. Reformat. + +2013-01-10 Jiri Vanek + + Download indicator made compact for more then one jar + * NEWS: mentioned this feature + * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: + (DownloadPanel) inner class were rewritten to support collapsed/detailed + for more then one jar in queue. + (frame) window is recreated each time state is changed (preventing errors + on some X configurations) and is positioned to lower left corner of + active screen. + * netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png + * adding netx/net/sourceforge/jnlp/resources/showDownloadDetails.pn h + Icons for "to collapsed state" and "to detailed state" + +2013-01-10 Jiri Vanek + + All IcedTea-Web dialogues are centered to middle of active screen + * NEWS: mentioned this feature + * netx/net/sourceforge/jnlp/JNLPSplashScreen.java: + * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java: + * netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java: + * netx/net/sourceforge/jnlp/security/SecurityDialog.java: + * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java: + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java: + Dialogues in above classes made centering to active screen + * netx/net/sourceforge/jnlp/util/ScreenFinder.java: New file, utility + class which can find active monitor and center dialogue into it. + +2013-01-09 Jiri Vanek + + First part of fix of recreating desktop icon + * NEWS: mentioned PR725 + * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: + (addMenuAndDesktopEntries)added check for already existing icon + * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: Added methods for + digging the already existing icon from system + (getShortcutTmpFile) tmpfile fo generating the desktop icon + (getDesktopIconName) for getting filename from application title + (findFreedesktopOrgDesktopPathCatch) public method to find final desktop file + (findFreedesktopOrgDesktopPath) to get into ~/.config/user-dirs.dirs + (getFreedesktopOrgDesktopPathFrom) to find XDG_DESKTOP_DIR value + (filterQuotes) to handle simple quotations + (evaluateLinuxVariables) to handle possible variables in XDG_DESKTOP_DIR + value + * tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java: + New tests focused on parsing of desktop location from stream (variables + and quotations) + +2013-01-09 Jiri Vanek + + Logging methods made synchronized + * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java: + (processLogs) (getDefaultLoggingBottleneck) (writeXmlLog) (addToXmlLog) + (modifyMethodWithForBrowser) (setLoggedBrowser) (logIntoPlaintextLog) + made synchronised + 2013-01-07 Deepak Bhole * netx/net/sourceforge/jnlp/resources/Messages.properties: Converted to Unix format. +2013-01-04 Adam Domurad + + * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: + Code-formatting fixes and cosmetic changes. + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: + Same. + * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java: + Same. + * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java: + Same. + +2013-01-03 Adam Domurad + + Fix breakage in unit test CodeBaseClassLoaderTest.testParentClassLoaderIsAskedForClassesApplication + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (CodeBaseClassLoader#findClassNonRecursive): New, call into + URLClassLoader#findClass + (CodeBaseClassLoader#findClass): Delegate JNLPClassLoader#findClass + (JNLPClassLoader#findClass): Call CodeBaseClassLoader#findClassNonRecursive + * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java + (init): Add applet finish message. + * tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java + (testClassInAppletFolder): Close quickly on applet finish message. + +2013-01-02 Jiri Vanek + + Fixed unittest for InformationElement. + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java: + (createFromJNLP) now asserts NotNull instead of IsNull as result of + "Minor fix for possible NPE (non fatal) during splashscreen creation" + +2012-12-21 Adam Domurad + + * plugin/icedteanp/IcedTeaNPPlugin.cc: Remove need for 'goto' in + (NP_Initialize). Check TMPDIR environment variable for possible data + directory. Expose some previously static variables/functions for unit + testing purposes. Reduce need for explicit allocations for strings + 'data_directory' and 'appletviewer_executable'. + * tests/cpp-unit-tests/IcedTeaNPPluginTest.cc: + Add some basic tests for functions in IcedTeaNPPlugin.cc. + +2012-12-21 Jiri Vanek + + * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java + (shouldCreateShortcut) added handling of xtrustall during asking for + desktop icon creation + +2012-12-21 Jiri Vanek + + Minor fix for possible NPE (non fatal) during splashscreen creation + * netx/net/sourceforge/jnlp/resources/Messages.properties: + * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: + Added messages for user (SPLASHdefaultHomepage) + (SPLASHerrorInInformation)(SPLASHmissingInformation). + * netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java + (createFromJNLP) catch of NPE replaced by conditions with proper messages. + +2012-12-21 Jiri Vanek + + Forgotten condition for AviationWeather first run: + * tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java: + (AviationWeather) added condition for first run when creation of + FileManager is written to stderr. + +2012-12-20 Saad Mohammad + + * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: + Added test and changes to work better with PR909 fix. + +2012-12-20 Saad Mohammad + + Fix PR909 - URL is invalid after normalization. + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (normalizeUrl): + Converts the URL to an URI object which handles all percent encodings. + +2012-12-20 Adam Domurad + + * plugin/icedteanp/IcedTeaScriptablePluginObject.cc + (IcedTeaScriptableJavaObject::deAllocate): Fix memory leak + (IcedTeaScriptableJavaPackageObject::deAllocate): Fix memory leak + +2012-12-20 Adam Domurad + + * tests/cpp-unit-tests/browser_mock.cc + (mock_retainobject): New, mocks behaviour of NPAPI retainobject + (mock_releaseobject): New, mocks behaviour of NPAPI releaseobject + * tests/cpp-unit-tests/main.cc: Add warning of memory leak based on + operator-new. + * tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc: New, tests + for memory leak in (IcedTeaScriptableJavaObject::deAllocate) and + (IcedTeaScriptableJavaPackageObject::deAllocate) + * tests/cpp-unit-tests/checked_allocations.h: Defines set that does not + use operator-new, to prevent recursion in overloaded operator-new + * tests/cpp-unit-tests/checked_allocations.cc: Operator new overload + that has allocation-set for querying live allocations. + +2012-12-20 Jiri Vanek + + Added and applied Remote annotation, added Remote tests: + * tests/report-styles/jreport.xsl: and + * tests/junit-runner/JunitLikeXmlOutputListener: and + * tests/junit-runner/LessVerboseTextListener.java: added handling of + Remote annotation + * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: + Tests downloading from classpath.org marked. + * tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java: + new file, handling url and evaluations of remote reproducers + * tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java: + launcher for remote tests. + * tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java: + Implementation of Remote annotation + +2012-12-18 Jiri Vanek + + Cleaned unit-tests: + * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: + (DummyJNLPFile) class extracted from its anonymous members to private + named member. Get rid of repeated methods (testResourceLoad*Caching) and + replace it by (testResourceCaching) with parameter of full name and boolean + keeping its expected existence and branching null assert on it. Added tests + (testClassResourceLoadSuccessCachingApplication) and + (testClassResourceLoadSuccessCachingApplet). (testResourceCaching) made + less vulnerable by found classes and more precise. All resources paths + fixed and clarified (to be found or not) + +2012-12-18 Jana Fabrikova + + * /tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: + Added several new versions of method (executeBrowser) with lists + of ContentReaderListeners as arguments. + * /tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java: + Added new versions of the (constructor of ProcessWrapper) and methods + (addStdOutListeners) and (addStdErrListeners) for adding + ContentReaderListeners using List + instead of one ContentReaderListener as argument. + Added a new version of (constructor of ProcessWrapper) with + less arguments that is used instead of calling the constructor + with several arguments passed as null, thus causing ambiguity. + * /tests/reproducers/simple/SingeInstanceServiceTest/testcases/SingleInstanceTest.java: + Modified the call of (executeBrowser) method with null arguments + into a call of new method without the null arguments + -getting rid of an ambiguous call. + +2012-12-11 Jiri Vanek + + Added jacoco code coverage support + * Makefile.am: (JACOCO_*) bunch of new variables encapsulating jacoco + files. (PLUGIN_COVERAGE_BOOTCLASSPATH) classpath to be used in plugin + instead of normal one in coverage mode. (COVERABLE_PLUGIN_DIR) for + compiling plugin with agent on. (jacoco-operator-source-files.txt) for + storing files of reporting tool. All XSLTPROC command were done as non-fatal + (stamps/compile-jacoco-operator.stamp) for compiling report operator. + (stamps/run-unit-test-code-coverage-jacoco.stam) for cover unittests + Set of (COVERABLE_PLUGIN_*) targets to compile plugin with agent on. + (stamps/build-fake-plugin.stamp) top level target for fake plugin. + (stamps/run-reproducers-test-code-coverage-jacoco.stamp) target for + cover reproducers. (run-test-code-coverage-jacoco) for merged coverage + (clean-unit-test-code-coverage-jacoco) and + (clean-reproducers-test-code-coverage-jacoco) and + (clean-test-code-coverage-jacoco) and + (clean-test-code-coverage-tools-jacoco) cleaning targets. + (run-reproducers-test-code-coverage-jacoco) and + (run-unit-test-code-coverage-jacoco) as top level aliases. + * configure.ac: added check for jacoco library and asm library + * plugin/icedteanp/IcedTeaNPPlugin.cc removed duplicate code + (plugin_start_appletviewe) removed duplicated code and added handling of + java agent if defined. + * tests/jacoco-operator/org/jacoco/operator/Main.java : New class, + comamndline tool for merging results and for generating reports. + * tests/jacoco-operator/org/jacoco/operator/MergeTask.java: New class. + Utility class responsible for merging exec results to one exec file. + * tests/jacoco-operator/org/jacoco/operator/ReportGenerator: New class. + Utility method for gathering sources and builds and outputing xml and + html reports. + +2012-12-11 Adam Domurad + + * plugin/icedteanp/java/sun/applet/PluginParameterParser.java: + Remove left-in System.out + +2012-12-10 Saad Mohammad + + Add unit tests for PR1189. + * tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java: + (testConstructorWithNoCodeAndObjectParam): Initialize PluginParameters + without code/object parameters. + (testConstructorWithOnlyJnlpHrefParam): Initialize PluginParameters with + jnlp_href but no code/object parameters. + +2012-12-10 Saad Mohammad + + Add reproducer for PR1189. + * tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html: + Simple webpage which contains an applet tag with no code attribute. + * tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.jnlp: + Jnlp file that is used by the webpages using jnlp_href. + * tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java: + Testcase that tests applets without code attribute in html pages. + * tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java: + Simple applet class that outputs a string. + +2012-12-10 Saad Mohammad + + Fix PR1189: Icedtea-plugin requires code attribute when using jnlp_href. + * netx/net/sourceforge/jnlp/PluginParameters.java (PluginParameters): + Updated if condition to prevent PluginParameterException from being thrown + if applet tag contains jnlp_href but is missing code/object parameters. + +2012-12-06 Adam Domurad + + * Makefile.am: Fix targets stamps/netx-unit-tests-compile.stamp and + stamps/run-netx-unit-tests.stamp to not rely on installed directory. + +2012-12-05 Saad Mohammad + + Added new option in itw-settings which allows users to set JVM + arguments when plugin is initialized. + * netx/net/sourceforge/jnlp/config/Defaults.java (getDefaults): + Added defaults for DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS. + * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: + Added new property (KEY_PLUGIN_JVM_ARGUMENTS) which stores the value of + JVM plugin arguments. + * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: + (createMainSettingsPanel): Added JVM settings to the list of tabs. + (createJVMSettingsPanel): Returns a new JVMPanel object. + * netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java: + JVM settings panel. + * netx/net/sourceforge/jnlp/resources/Messages.properties: + Added a new items (CPJVMPluginArguments, CPHeadJVMSettings, + CPTabJVMSettings). + * plugin/icedteanp/IcedTeaNPPlugin.cc: + (plugin_start_appletviewer): Adds JVM arguments to the commands line list. + (get_jvm_args): Returns JVM arguments set in itw-settings. + * plugin/icedteanp/IcedTeaPluginUtils.cc: + (IcedTeaPluginUtilities::vectorStringToVectorGchar): New helper method + which returns a vector of gchar* from the vector of strings passed. + * plugin/icedteanp/IcedTeaPluginUtils.h: + Declaration of IcedTeaPluginUtilities::vectorStringToVectorGchar. + +2012-12-05 Pavel Tisnovsky + + * Makefile.am: Avoid warning message printed in clean target if + softkiller is not compiled. + +2012-12-04 Adam Domurad + + * netx/net/sourceforge/jnlp/resources/Messages.properties: + "An serious exception have occured" -> "A serious exception occurred" + +2012-12-04 Adam Domurad + + PluginAppletViewer refactoring. + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java + (handleInitializationMessage): New, extracts initialization logic + from PluginAppletViewer.handleMessage. + * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java: Moved + into own file. + +2012-12-04 Adam Domurad + + Remove the applet/embed/object tag parser from ITW. Send the applet + parameters directly from the C++. + * Makefile.am: Allow unit-testing for classes in plugin.jar. + * netx/net/sourceforge/jnlp/NetxPanel.java: Use PluginParameters for + attribute lookup + * netx/net/sourceforge/jnlp/PluginBridge.java: Use PluginParameters + for attribute lookup + * netx/net/sourceforge/jnlp/resources/Messages.properties: Add message + for missing code/object attributes. + * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: Same. + * plugin/icedteanp/IcedTeaNPPlugin.cc: Send escaped parameter + name/values instead of applet tag. Remove some dead code. + * plugin/icedteanp/IcedTeaNPPlugin.h: Rename applet_tag -> + parameters_string. + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Extract + parsing code into its own class. + * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: Use CHECK_EQUALS + instead of CHECK. + * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: Update + unit tests due to constructor changes. + * netx/net/sourceforge/jnlp/PluginParameterException.java: New, thrown + when code/object attributes are missing. + * netx/net/sourceforge/jnlp/PluginParameters.java: New, Hashtable + wrapper that handles plugin attribute/parameter lookups. + * plugin/icedteanp/java/sun/applet/PluginParameterParser.java: New, + creates PluginParameters from escaped name/values. + * tests/cpp-unit-tests/PluginParametersTest.cc: New, C++ Unit tests for + plugin parameter related functions + * tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java: New, + unit tests for PluginParameters class. + * tests/netx/unit/sun/applet/PluginParameterParserTest.java: New, unit + tests for PluginParameterParser class. + +2012-11-03 Jiri Vanek + + Fixed logging bottleneck + * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java: + added and used function (clearChars) which filter characters going to xml + from invalid ones. + * tests/test-extensions/net/sourceforge/jnlp/ServerAccess: getting test + method id by (getTestMethod) now relay on physical way to the class as + the only real thing differing test class and framework class. + +2012-12-03 Pavel Tisnovsky + + * Makefile.am: Added new target for compiling softkiller. + * tests/softkiller/softkiller.c: + Added browser softkiller. + * tests/softkiller/Makefile: + Added makefile used to build and clean browser softkiller. + * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java: + Uncommented code used to close windows. + +2012-11-30 Adam Domurad + + Breaks up IcedTeaPluginUtilities::javaResultToNPVariant into multiple, + more manageable parts. + * plugin/icedteanp/IcedTeaPluginUtils.cc: Make three helper functions + for the different cases. Two new helper functions for converting from + std::string to NPString and NPVariant. + * plugin/icedteanp/IcedTeaPluginUtils.h: Two new helper functions. + * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: Tests for the new + NPString and NPVariant from std::string functions. + +2012-11-30 Adam Domurad + + Added a simple mechanism for mocking functions in the browser function + table. Can be expanded as needed. + * tests/cpp-unit-tests/main.cc: Call setup function, warn on browser + function based memory leak. + * tests/cpp-unit-tests/browser_mock.cc: New, implements simple + error-checking mocks of browser callbacks. + * tests/cpp-unit-tests/browser_mock.h: New, interface to mocking + functions. + +2012-11-27 Jiri Vanek + + Better error reporting from applets + * netx/net/sourceforge/jnlp/NetxPanel.java: (init) ErrorSplash is shown + if fatal exception is cough + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (replaceSpalsh) + is rather removing all then just its previous version + * tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java: + * tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html + Testcase for manual testing of various exceptions from applet + +2012-11-27 Jiri Vanek + + * AUTHORS: added Jan Kmetko as current SplashScreen artwork author + +2012-11-27 Jiri Vanek + + Fixed epiphany switch + * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java: + -new-tab fixed to --new-tab + +2012-11-23 Jiri Vanek + + Firefox session-backup and stubs for softkiller, multiple listeners, + processes handling moved to separate class. + * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: + Removed unwanted assert on termination + * tests/test-extensions/net/sourceforge/jnlp/ContentReader.java: + Added support for multiple listeners. + * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java: + (destroyProcess()), non static wrapper around former (destroyProcess + (process)), introducing marks that process is being killed, added setter + for reactigProcess. + * tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java: + Wrapper around former ServerAccess.executeProcess set of methods. + * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: all + executeProcess/Javaws/Browser are now just api compatibility methods + around ProcessWrapper. + (executeProcess) main method moved to ProcessWrapper.execute. + * tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java: + made public and synchronized with ProcessAssasin's (destroyProcess) + * tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browser.java + is now implementing ReactingProcess + * tests/test-extensions/net/sourceforge/jnlp/browsertesting/ReactingProcess.java: + new interface for communication with main events of ThreadedProcess lifecycle. + * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java: + is containing singleton of FirefoxProfilesOperator (FPO) and is responding to + (beforeProcess) by FPO's (backupingProfiles), to (beforeKill) by calling + ProcessAssasin's (closeWindows), and to (afterKill) by FPO's (restoreProfiles) + * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/FirefoxProfilesOperator.java: + New class to backup and restore firefox profiles. + +2012-11-21 Adam Domurad + + * Makefile.am: Fix new clean targets not cleaning properly + +2012-11-21 Adam Domurad + + Support for C++ unit testing with UnitTest++ for IcedTeaWeb. + * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: New, contains tests + for utility functions. + * tests/cpp-unit-tests/main.cc: New, contains unit test runner. + * plugin/icedteanp/IcedTeaPluginUtils.h: Remove incorrect circular + include dependency + * plugin/icedteanp/IcedTeaRunnable.h: Add includes necessary for + self-sustaining header. + * Makefile.am: Add targets for unit test compilation and running, + eg 'make run-cpp-unit-tests'. + +2012-11-21 Adam Domurad + + Add the source code to UnitTest++ into the project. + * tests/UnitTest++/COPYING: Part of UnitTest++ + * tests/UnitTest++/Makefile: Part of UnitTest++ + * tests/UnitTest++/README: Part of UnitTest++ + * tests/UnitTest++/src/AssertException.cpp: Part of UnitTest++ + * tests/UnitTest++/src/AssertException.h: Part of UnitTest++ + * tests/UnitTest++/src/CheckMacros.h: Part of UnitTest++ + * tests/UnitTest++/src/Checks.cpp: Part of UnitTest++ + * tests/UnitTest++/src/Checks.h: Part of UnitTest++ + * tests/UnitTest++/src/Config.h: Part of UnitTest++ + * tests/UnitTest++/src/CurrentTest.cpp: Part of UnitTest++ + * tests/UnitTest++/src/CurrentTest.h: Part of UnitTest++ + * tests/UnitTest++/src/DeferredTestReporter.cpp: Part of UnitTest++ + * tests/UnitTest++/src/DeferredTestReporter.h: Part of UnitTest++ + * tests/UnitTest++/src/DeferredTestResult.cpp: Part of UnitTest++ + * tests/UnitTest++/src/DeferredTestResult.h: Part of UnitTest++ + * tests/UnitTest++/src/ExecuteTest.h: Part of UnitTest++ + * tests/UnitTest++/src/MemoryOutStream.cpp: Part of UnitTest++ + * tests/UnitTest++/src/MemoryOutStream.h: Part of UnitTest++ + * tests/UnitTest++/src/Posix/SignalTranslator.cpp: Part of UnitTest++ + * tests/UnitTest++/src/Posix/SignalTranslator.h: Part of UnitTest++ + * tests/UnitTest++/src/Posix/TimeHelpers.cpp: Part of UnitTest++ + * tests/UnitTest++/src/Posix/TimeHelpers.h: Part of UnitTest++ + * tests/UnitTest++/src/ReportAssert.cpp: Part of UnitTest++ + * tests/UnitTest++/src/ReportAssert.h: Part of UnitTest++ + * tests/UnitTest++/src/Test.cpp: Part of UnitTest++ + * tests/UnitTest++/src/Test.h: Part of UnitTest++ + * tests/UnitTest++/src/TestDetails.cpp: Part of UnitTest++ + * tests/UnitTest++/src/TestDetails.h: Part of UnitTest++ + * tests/UnitTest++/src/TestList.cpp: Part of UnitTest++ + * tests/UnitTest++/src/TestList.h: Part of UnitTest++ + * tests/UnitTest++/src/TestMacros.h: Part of UnitTest++ + * tests/UnitTest++/src/TestReporter.cpp: Part of UnitTest++ + * tests/UnitTest++/src/TestReporter.h: Part of UnitTest++ + * tests/UnitTest++/src/TestReporterStdout.cpp: Part of UnitTest++ + * tests/UnitTest++/src/TestReporterStdout.h: Part of UnitTest++ + * tests/UnitTest++/src/TestResults.cpp: Part of UnitTest++ + * tests/UnitTest++/src/TestResults.h: Part of UnitTest++ + * tests/UnitTest++/src/TestRunner.cpp: Part of UnitTest++ + * tests/UnitTest++/src/TestRunner.h: Part of UnitTest++ + * tests/UnitTest++/src/TestSuite.h: Part of UnitTest++ + * tests/UnitTest++/src/TimeConstraint.cpp: Part of UnitTest++ + * tests/UnitTest++/src/TimeConstraint.h: Part of UnitTest++ + * tests/UnitTest++/src/TimeHelpers.h: Part of UnitTest++ + * tests/UnitTest++/src/UnitTest++.h: Part of UnitTest++ + * tests/UnitTest++/src/XmlTestReporter.cpp: Part of UnitTest++ + * tests/UnitTest++/src/XmlTestReporter.h: Part of UnitTest++ + +2012-11-21 Adam Domurad + + * plugin/icedteanp/IcedTeaNPPlugin.cc + (consume_plugin_message): Free two buffers returned from NPN_GetValueForURL function. + +2012-11-20 Jiri Vanek + + * Makefile.am: (stamps/run-netx-dist-tests.stamp) and + (stamps/run-netx-unit-tests.stamp) Swapped logs and report xslt operations + +2012-11-20 Jana Fabrikova + + * tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: + added @KnownToFail annotations to the tests, which are showing + unimplemented/broken features of js-plugin communication. + +2012-11-13 Adam Domurad + + Reproducer for PR1198, JSObject#eval creates invalid JS object. + * tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.html: + Loads applet + JS for test + * tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.js: + Calls java code to test JSObject#eval + * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java: + Provides java<->JS wrappers for JSObject methods + * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java: + Tests if JSObject#eval creates valid JSObject. + +2012-11-13 Saad Mohammad + + Fix PR1166: Embedded JNLP File is not supported in applet tag. + * configure.ac: Checks for sun.misc.BASE64Decoder. + * NEWS: Added entry for PR1166. + * netx/net/sourceforge/jnlp/JNLPFile.java (JNLPFile): + New constructor which accepts inputstream of jnlp file and a + specified codebase. + * netx/net/sourceforge/jnlp/Parser.java (Parser): If parsing of + codebase fails, it will overwrite the codebase with the one passed + in through parameters. + * netx/net/sourceforge/jnlp/PluginBridge.java: + (PluginBridge) Supports embedded jnlp file. + (decodeBase64String) Decodes Base64 strings to byte array. + +2012-11-13 Saad Mohammad + + Added unit tests for PR1166. + * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java: + Tests the JNLPFile constructor that accepts an InputStream and an alternative codebase. + * tests/netx/unit/net/sourceforge/jnlp/ParserTest.java: + Tests if the constructor handles the alternative codebase parameter correctly. + * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: + Tests if BASE64 strings are decoded correctly and if PluginBridge is constructed with an + embedded jnlp. + +2012-11-13 Saad Mohammad + + Added reproducer for PR1166. + * tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlp.jnlp: + Launching jnlp file that is used by jnlp_href in applet tag + * tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCodebase.html: + Applet with an embedded jnlp file with no codebase specified + * tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDotCodebase.html: + Applet with an embedded jnlp file with codebase set as a 'dot' + * tests/reproducers/simple/EmbeddedJnlpInApplet/resources/JnlpInApplet.html: + Applet with jnlp_href file. + * tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/EmbeddedJnlp.java: + Simple class that outputs strings. + * tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java: + Testcase that tests embedded jnlps in html pages. + +2012-11-08 Saad Mohammad + + * NEWS: Added entry for PR1027 - DownloadService is not supported by + IcedTea-Web. + +2012-11-08 Saad Mohammad + + Added reproducer for DownloadService. + * tests/reproducers/signed/DownloadService/resources/DownloadService.jnlp: + Launching jnlp file that contains extension jnlp and jars marked with part names. + * tests/reproducers/signed/DownloadService/resources/DownloadServiceExtension.jnlp: + DownloadService extension jnlp file with jars marked with part names. + * tests/reproducers/signed/DownloadService/srcs/DownloadServiceRunner.java: + A simple class that uses DownloadService to complete tasks and outputs the results. + * tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java: + Testcase for DownloadService. + +2012-11-08 Saad Mohammad + + Core implementation of DownloadService. + * netx/net/sourceforge/jnlp/cache/CacheUtil.java (getCacheParentDirectory): + Returns the parent directory of the cached resource. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: + (getLoaders): Returns all loaders that this loader uses, including + itself + (addNewJar): Adds a new jar to the classloader with specified + UpdatePolicy. + (removeJars): Remove jars from the filesystem. + (initializeNewJarDownload): Downloads and initializes jars into the + current loader. + (manageExternalJars): Manages jars which are not mentioned in the + JNLP file. + * netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java: + (getLoaderByJnlpFile): Returns the classloader of the jnlp file + specified. + (getLoaderByResourceUrl): Returns the classloader that contains the + specified jar. + * netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java: + (findJars): Returns jars from the JNLP file with the specified + partname. + (removeCachedJars): Removes jar from cache. + (downloadJars): Downloads jars identified by part name. + (loadExternalResouceToCache): Download and initalize resources which + are not mentioned in the jnlp file. + (removeExternalCachedResource): Removes resources from cache which + are not mentioned in the jnlp file. + (isExternalResourceCached): Determines if the resource that is not + mentioned in the jnlp file is cached and returns a boolean with the + result. + * netx/net/sourceforge/jnlp/services/XDownloadService.java: + Core implementation of DownloadService. + +2012-11-02 Jiri Vanek + Alexandr Kolouch + + Added cz_CS locales with test + * AUTHORS: added translator, mr. Kolouch + * NEWS: mentioned localization + * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: file + itself with translation + * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java: + Test which is testing whether and how locales are applied. + 2012-11-02 Jiri Vanek + Splashscreen integrated to javaws and plugin + * Makefile.am: (edit_launcher_script) added JAVAWS_SPLASH_LOCATION + substitution for installed javaws_splash.png. + (install-exec-loca) added installation of javaws_splash.png. + * NEWS: mentioned splashscreen + * launcher/javaws.in: added SPLASH_LOCATION, as path to image with "java" + splash which s then shown until internal vector one appear. + * netx/net/sourceforge/jnlp/GuiLaunchHandler.java: splashScreen made volatile, + (launchInitialized) splashscreen is created and shown + * netx/net/sourceforge/jnlp/JNLPSplashScreen.java: (setSplashImageURL) + splash bg image is loaded from given url or default is used if not found + or not specified by jnlp/applet. (correctSize) width is calculated from + bg image or default is used when no image set. Splash is centered to + primary monitor. + * netx/net/sourceforge/jnlp/Launcher.java: (launchApplet) and + (launchApplication) enriched by handling of splashs. + (launchError) overloaded and is now handling forwarding of errors to + splash. All relevant calls of launchError enriched by appletInstance. + * netx/net/sourceforge/jnlp/NetxPanel.java: is now implementing + SplashController.This is done by setting and wrapping of splashController + variable. + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: is now handling + splashscreen for applets in browsers. + (framePanel) is now providing panel to be processed (PluginAppletViewer) + is now invoking SplashCreator. (replaceSplash) new method which replace + splashscreen with error splashscreen. (removeSplash) new method to remove + splash when loading is done. (update) is added to call paint directly + (SplashCreator) new internal runnable to create splash + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html: + second jar made XslowX to track two FIXME introduced in this patch - + Launcher's createApplet and PluginAppletViewer's framePanel. + * netx/javaws_splash.png: Binary image to be shown before java is launched + * tests/reproducers/simple/simpletest1/resources/netxPlugin.png: Binary image + to ne used for testing custom splashscreens + +2012-10-31 Jana Fabrikova + + *tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: + Modifying the testcase output to a simpler text. + *tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: + Modifying the testcase output to a simpler text. + +2012-10-29 Omair Majid + + * tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp, + * tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/Test.java, + * tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentPropertiesAreExposedTest.java: + New files. + +2012-10-29 Omair Majid + + PR1186 + * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: + (load(boolean)): Delegate to load(File,File,boolean). + (load(File,File,boolean)): New method. + (copyTo): New method. + * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: + (initialize): Copy configuration to system properties. + * tests/netx/unit/net/sourceforge/jnlp/config/DeploymentConfigurationTest.java: + New File. + +2012-10-29 Jana Fabrikova + + * tests/reproducers/simple/JSToJSet + Added reproducer for testing LiveConnect - setting Java members from JavaScript side + +2012-10-26 Jiri Vanek + + Added clipboard reproducers (PR708) + * tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy1.jnlp: + Jnlp to invoke manual copying to clipboard on signed app, please note + the delayed death of application + * tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy2.jnlp: + Jnlp to invoke jtextfield like copying signed app, please note the + delayed death of application + * tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste1.jnlp: + Jnlp to invoke manual pasting on signed application + * tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste2.jnlp: + Jnlp to invoke jtextfield like pasting on signed application + * tests/reproducers/signed/ClipboardContentSigned/srcs/ClipboardContentSigned.java: + Application which is trying to access clipboard by various ways. + * tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTests.java: + Automated tests for four above jnlps. + * tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy1.jnlp: + Jnlp to invoke manual copying to clipboard on unsigned app, please note + the delayed death of application + * tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy2.jnlp: + Jnlp to invoke jtextfield like copying unsigned app, please note the + delayed death of application + * tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste1.jnlp: + Jnlp to invoke manual pasting on unsigned application + * tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste2.jnlp: + Jnlp to invoke jtextfield like pasting on unsigned application + * tests/reproducers/simple/ClipboardContent/srcs/ClipboardContent.java: + Application which is trying to access clipboard by various ways. + * tests/reproducers/simple/ClipboardContent/testcases/ClipboardContentTests.java: + Automated tests for first and third of above four jnlps. The tests of + second and fourth is disabled due to necessary manual interaction + * tests/test-extensions/net/sourceforge/jnlp/tools/WaitingForStringProcess.java: + Utility class for process waiting for some string for another string + * tests/test-extensions/net/sourceforge/jnlp/tools/ClipboardHelpers.java + Utility class for copying/pasting text to/from clipboard + * tests/test-extensions/net/sourceforge/jnlp/tools/AsyncJavaws.java + Utility class for launching javaws in separate thread. + + +2012-10-23 Jiri Vanek + + KnownToFail texts are now bold in html report + * tests/report-styles/jreport.xsl: all text outputs of + test="@known-to-fail=true" conditions are marked with . + +2012-10-19 Adam Domurad + + * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java + (SignedMetaInfIndexListTest): Add @KnownToFail annotation + +2012-10-19 Jiri Vanek + Renamed reproducers-related variables and targets * Makefile.am: NETX_TEST_DIR - new parent directory variable for tests @@ -174,25 +2080,249 @@ stamps/netx-dist-tests-tests-compile.stamp -> stamps/test-extensions-tests-compile.stamp stamps/netx-dist-tests-compile-testcases.stamp -> stamps/compile-reproducers-testcases.stamp stamps/netx-dist-tests-copy-resources.stamp -> stamps/copy-reproducers-resources.stamp + * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile: and + * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile: and * tests/reproducers/custom/AppletFolderInArchiveTag/srcs/Makefile: and * tests/reproducers/custom/UnsignedContentInMETAINF/srcs/Makefile: following above renaming -2012-11-01 Deepak Bhole +2012-10-19 Adam Domurad + + Revised multiple signatures test to check for new message. Added more + accurate reproducer for PR822. + * tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java: + Made class take a classname parameter so different out-of-package + classes could be executed. + * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html: + Added main-class parameter. + * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp: + Same. + * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp: + Same. + * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp: + Same. + * tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java + (multipleSignaturesTestHtmlAppletUsesPermissions): New, tests if fully + signed HTML applets with varied signers can (as they should) execute + with full permissions. Reproduces PR822. + (multipleSignaturesTestJnlpApplicationRequesting): Check for + mismatching signers JNLP failure message. Remove known-to-fail & + inaccurate bug annotation. + * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java + (multipleSignaturesTestSamePackageJnlpApplicationRequesting): Check for + mismatching signers JNLP failure message. Remove known-to-fail & + inaccurate bug annotation. + +2012-10-19 Adam Domurad + + Reproduces PR822: Applets fail to load if jars have different signers. + Tests for applets & JNLPs with multiple signers per jar. + * tests/reproducers/signed/ReadPropertiesSigned/srcs/ReadPropertiesSigned.java: + Modified to end with standard applet finish message. + * tests/reproducers/simple/ReadProperties/srcs/ReadProperties.java: + * tests/reproducers/custom/MultipleSignaturesPerJar/README: Explains + dependence on ReadPropertiesSigned. + * tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.html: + HTML applet test with a common signer. + * tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.jnlp: + JNLP test with a common signer. + * tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.html: + HTML applet test without a common signer. + * tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.jnlp: + JNLP test without a common signer. + * tests/reproducers/custom/MultipleSignaturesPerJar/srcs/Makefile: + Custom makefile used to sign a jar with multiple signers. + * tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/MultipleSignaturesPerJarMain.java: + Accesses ReadPropertiesSigned from another package with different + signers. + * tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJarTests.java: + Test driver. + +2012-10-19 Adam Domurad + + New message for signer mismatch in JNLP applications. + * netx/net/sourceforge/jnlp/resources/Messages.properties: Added + message 'The JNLP application is not fully signed by a single cert.' + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Message + thrown when JNLP's jcv.allJarsSigned() is true but not + jcv.isFullySigned(); + +2012-10-19 Adam Domurad + + Fixes JCV#isTriviallySigned(). Reproducer 'EmptySignedJar' passes + again. + * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Remove + problematic 'triviallySigned' variable and instead determine + whether triviallySigned on the fly. Consider jars with 0 signable + entries as SIGNED_OK. + * tests/netx/unit/net/sourceforge/jnlp/tools/JarCertVerifierTest.java: + Update no-signers unit test. - * configure.ac: Prepare for 1.3.2 - * NEWS: Same +2012-10-19 Adam Domurad -2012-11-01 Deepak Bhole + * netx/net/sourceforge/jnlp/security/AppVerifier.java: Use interface + types for declared types where applicable. + * netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: Same. + * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Same. - * configure.ac: Prepare for 1.3.1 - * NEWS: Same +2012-10-19 Adam Domurad -2012-11-01 Deepak Bhole + * netx/net/sourceforge/jnlp/security/AppVerifier.java: Use interface + types for declared types where applicable. + * netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: Same. + * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Same. + +2012-10-19 Danesh Dadachanji + + Rework JarCertVerifier certificate management to handle multiple + certificates and use different algorithms to verify JNLPs and Applets. + * netx/net/sourceforge/jnlp/resources/Messages.properties: + Removed SHasUnsignedEntry. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: + Set JCV instance to final but uninitialized. + (JNLPClassLoader): Initialized JCV with runtime dependent verifier. + (addNewJar), (initializeResources), (verifySignedJNLP): + Replaced use of local JarCertVerifier variable with the instance variable. + Added calls to isFullySigned wherever signer verification is done. + (activateJars): No longer verifies nested jars. These receive the same + security permissions as their parent jar, regardless of the nested + jar's signing. + (checkTrustWithUser): Removed JCV param, reimplemented to wrap around + JCV's checkTrustWithUser method. + (verifyJars): Removed. + * netx/net/sourceforge/jnlp/security/AppVerifier.java: + New strategy pattern interface that specifies verification methods + required regardless of the runtime. + * netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java: + * netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: + New strategy pattern classes used to determine which algorithms to use + depending on the runtime. + * netx/net/sourceforge/jnlp/security/CertVerifier.java: + Added CertPath param to all the methods. + (noSigningIssues): Removed. + * netx/net/sourceforge/jnlp/security/CertWarningPane.java: + * netx/net/sourceforge/jnlp/security/CertsInfoPane.java: + * netx/net/sourceforge/jnlp/security/MoreInfoPane.java: + Updated calls to the verifier's methods with the new CertPath param. All + are set to null so far. + * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java: + Added CertPath param to all the methods. It's mostly ignored though. + * netx/net/sourceforge/jnlp/tools/CertInformation.java: + New class to represent all the information about a signer with + with respect to all of the entries it has signed for the app. + * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: + Completely reworked to use CertInformation and AppVerifier functionality. + (getCertPath), (getCertInformation), (checkTrustWithUser), + (getJarSignableEntries), (getTotalJarEntries): New method. + (noSigningIssues), (anyJarsSigned): Removed. + (verifyResult): Renamed enum to VerifyResult + (JarCertVerifier): New constructor used to set AppVerifier instance. + (getAlreadyTrustPublisher), (getRootInCacerts): Now uses strategy pattern. + (hasSigningIssues), (getDetails), (checkTrustedCerts), (checkCertUsage): + Now uses cert info class. + (getCerts): Renamed to getCertsList. + (isFullySignedByASingleCert): renamed to isFullySigned and to use + the strategy pattern. + (add): New public method that resets some instance vars and + calls verifyJars. + (verifyJars): Modifier changed to private, above method should be used. + Also skips jars that have been verified before. + (verifyJar): Removed actual verification code, only reads jars into the JVM. + (verifyJarEntryCerts): New method. Does actual verification of jars. + (getPublisher), (getRoot): Use hacky currentlyUsed variable as the signer. + * tests/netx/unit/net/sourceforge/jnlp/tools/JarCertVerifierTest.java: + Unit test JCV's verifyJarEntryCerts method. + * tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java: + Unit test helper that creates CodeSigner instances. + +2012-10-16 Adam Domurad + + * tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java: + Add 'standard' applet closing message. + * tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java: + Clean-up code and add automatic applet closing on finish. + +2012-10-15 Jana Fabrikova + + * tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: + Modified the testcases - more readable method calls. + +2012-10-05 Omair Majid + + PR1145 + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (getAccessControlContextForClassLoading): Do not catch + ClassCircularityError. + (findLoadedClassAll): Call findLoadedClass without any special + permissions. + +2012-10-03 Jana Fabrikova + + * tests/reproducers/simple/JSToJGet: + Added a new reproducer for the first LiveConnect + test - getting members from Java side. + +2012-10-02 Martin Olsson + + * plugin/icedteanp/IcedTeaNPPlugin.cc: Typo fix. + * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Typo fix. - CVE-2012-4540, RH869040: Heap-based buffer overflow after triggering event - attached to applet - * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: Removed unnecessary - heap allocations. +2012-09-26 Jana Fabrikova + + * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java: + Added forgotten package name. + +2012-09-25 Jiri Vanek + + Added rules listeners + * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListener.java: + Base class for closing listeners which is containing complete output in + each time. + * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/Rule.java: + Class with rule definition for RulesFolowingClosingListener + * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java: + ClosingListener consisted from rules which all have to match for close action + * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringRule.java: + Implementation of rule based on string + * tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java: + * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: + Refactored to use Above iisteners. + + +2012-09-24 Jiri Vanek + + Added basic closing listener implementation + * tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html: + removed unnecessary XslowX + * tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html: + added missing XslowX + * tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java: + added standard closing sentence + * tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java: + used auto*closing listeners + * tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java: + interface for identifying closing listeners + * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java: + added possibility to set timeout n the fly + * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: + (executeBrowser) added shortcut for autoclosing listeners, + (setUpClosingListener) method for setting properties of ClosingListener + (executeBrowser) add logic to handle ClosingListeners + * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java: + listener closing on "APPLET FINISHED" string + * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java: + listener closing on "xception" match + * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java: + listener closing on both xception and finished string. + * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java: + Base forefather for Auto*ClosingListener + +2012-09-24 Jiri Vanek + Jana Fabrikova + + Reproducers are now correctly compiled against liveconect(plugin.jar) + * Makefile.am: (stamps/netx-dist-tests-prepare-reproducers.stamp) + added one more dependency: stamps/liveconnect-dist.stamp + added one more directory on cp: $(abs_top_builddir)/liveconnect 2012-09-17 Deepak Bhole @@ -224,10 +2354,72 @@ * netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK7.java: New class -- X509TrustManager for JDK7. +2012-09-07 Saad Mohammad + + Added signed jnlp tests for applications with multiple jar resources. + * tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.jnlp: + Launching jnlp file that's main jar does not have a signed jnlp file, but + other jar resources do. + * tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/SimpleApplication.java: + A class that uses reflection to access resources from different jars. + * tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatchingSignedJnlpApplication.jnlp: + Launching jnlp file that's main jar matches the signed jnlp application + file. + * tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmatchingSignedJnlpApplication.jnlp: + Launching jnlp file that's main jar does not match the signed jnlp + application file. + * tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp: + Signed JNLP application file for MultiJar-SignedJnlpApplication. + * tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication.java: + A class that uses reflection to access resources from different jars. + * tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJnlpTest.java: + Testcase that tests the launch and validation of signed jnlp files for + application that have multiple jar resources. + * tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatchingSignedJnlpTemplate.jnlp: + Launching jnlp file that's main jar matches the signed jnlp application + template file. + * tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchingSignedJnlpTemplate.jnlp: + Launching jnlp file that's main jar does not match the signed jnlp + application template file. + * tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp: + Signed JNLP application template file for MultiJar-SignedJnlpTemplate.jar + * tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/SignedJnlpTemplate.java: + A class that uses reflection to access resources from different jars. + +2012-09-07 Jiri Vanek + + Added strict test + * tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java: + Removed deprecated ServerAccess.ProcessResult + (testSimpletest1lunchOk) extracted asserting code + (checkLaunched) family of methods to evaluate output of application + (createStrictFile) method to prepare file which will pass strict checking + (testSimpletest1lunchOkStrictJnlp) new test, ensuring that even strict + file can be read without strict option + (testSimpletest1lunchNotOkJnlpStrict) new test ensuring that strictly + read no-strict file will fail + (testSimpletest1lunchOkStrictJnlpStrict) new test ensuring that strictly + read strict file will pass + +2012-09-06 Jiri Vanek + + Fixing several typos from previous push + * tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java: + (getUrlUponThisInstance) Javadoc, replaced Ctreate with Create. + * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: (run) + Fixed indentation. + * tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java: + Refactored createCodeBAse to createCodeBase. + 2012-09-05 Jiri Vanek Fixing several errors which were causing incorrect behaviour causing correct reproduction of PR905 + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.htm + Using different jar for reproducing + * tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java + Added tests for hardcoded codebase (same and different) + enhanced original PR905 reproducers * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java: added flush for logs * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: cleaned @@ -237,6 +2429,34 @@ * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: fixed processing of question mark. +2012-09-05 Jiri Vanek + + * tests/reproducers/signed/CountingAppletSigned/srcs/CountingAppletSigned.java: + Signed applet painting to canvas and periodically printing out counted messages + * tests/reproducers/signed2/AppletTestSigned2/srcs/AppletTestSigned2: + Second simple signed applet for testing two different simple ones parallel + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_1.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2e.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1k_x_2.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.html: + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.html: + Various combinations of plain, signed, crashing, exception throwing and + exiting applets on single web-page + * tests/reproducers/simple/CountingApplet1/srcs/CountingApplet1.java: + Simple applet painting to canvas and periodically printing out counted messages + * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: + testcases launching above html files. + * tests/reproducers/simple/CountingApplet2/srcs/CountingApplet2.java: + Second simple applet painting to canvas and periodically printing out counted messages + * tests/reproducers/simple/simpletest2/srcs/SimpleTest2.java: Enhanced + exception throwing reproducer. + 2012-09-04 Jiri Vanek Danesh Dadachanji @@ -257,17 +2477,64 @@ * tests/reproducers/simple/SingleInstanceServiceTest/srcs/SingleInstanceChecker.java SingleInstance implementing applet/application * tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java - Testfile for launching for above jnlps/htmls as testcases. + Testfile for launching for above jnlps/htmls as testcases. -2012-08-27 Deepak Bhole +2012-08-27 Adam Domurad - * configure.ac: Prepare for 1.3.1 - * NEWS: Same - -2012-08-27 Deepak Bhole - - * configure.ac: Prepare for 1.3 - * NEWS: Same + Fixes PR920, duplicate loading of classes in certain cases + * NEWS: Added entry: Fixes PR920 + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Remove + recursive/non-recursive distinction. Add parent JNLPClassLoader to + parent chain. + +2012-08-27 Adam Domurad + + Reproduces problem behind PR920, class is in a jar is loaded twice when + used by both a class within the jar, and also used by a class outside + the jar extending that class. + * tests/reproducers/custom/AppletExtendsFromOutsideJar/README: + Describes test + * tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOutsideJar.html: + Runs applet with main class outside jar + * A tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar.java: + References class Referenced inside same jar + * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java: + References class Referenced outside the jar + * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile: + Packages Reference, AppletReferenceInSameJar into a jar, + AppletReferenceOutOfJar outside it + * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Referenced.java: + Class that is referenced twice, loaded twice in failing behaviour + * tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java: + Drives AppletExtendsFromOutsideJar.html + +2012-08-27 Adam Domurad + + Tests whether a main class can be found in a jar specified in + META-INF/INDEX.LIST. This test is done with both signed and unsigned + jars. The failure with signed jars encapsulates PR1112. + * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListSigned.jnlp: + * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListUnsigned.jnlp: + JNLP files for the signed and unsigned varions of the test + * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfIndexList.java: + Main class that is within a jar loaded via + * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile: + Prepares a jar with INDEX.LIST pointing to another jar that has the + main-class. Copies of these jars and made and signed. + * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java: + Test driver, tests if main-class has run. + +2012-08-27 Adam Domurad + + Tests custom policy definition in such a way that has been known to + cause ClassCircularityError's. Reproducer for PR1145. + * tests/reproducers/signed/CustomPolicy/resources/CustomPolicy.jnlp: + * tests/reproducers/signed/CustomPolicy/srcs/CustomPolicy.java: + Sets custom policy and performs a privileged operation with no given + privileges. + * tests/reproducers/signed/CustomPolicy/testcases/CustomPolicyTests.java: + Tests that an access control exception was caught, and that the program + exits correctly. 2012-08-27 Deepak Bhole @@ -275,67 +2542,70 @@ (getAccessControlContextForClassLoading): Catch ClassCircularityErrors and ignore them (thus denying permission to caller). -2012-08-13 Jiri Vanek - - * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: - (executeProcessUponURL)Fixed wrong call in previous commit which was - causing null process name. - * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: - Removed unused import. - -2012-08-13 Jiri Vanek +2012-08-27 Jiri Vanek - Reproducers of PR955 - * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement1.jnlp: - * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement2.jnlp: - * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement3.jnlp: - * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement4.jnlp: - Test jnlp files with various combinations of locales, reproducers of PR955. - * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement_noLoc.jnlp - Jnlp file with which is not affected by PR955 and is helping to catch error in LOCALE changing hack - * tests/reproducers/simple/LocalisedInformationElement/srcs/LocalisedInformationElement.java: - Reproducer main class, after loading prints out default locale. - * tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java: - Testcases launching above jnlps under various locales. - * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: - Added set of methods allowing passing of custom variables to ThreadedProcess. - * tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java: - Added processing of custom variables. - -2012-08-22 Danesh Dadachanji - - Fix PR955: regression: SweetHome3D fails to run - * NEWS: Added entry for PR955 - * netx/net/sourceforge/jnlp/JNLPFile.java: New enum Match that represents - the level of precision to use when matching locales. - (localMatches): Renamed to localeMatches, added matchLevel paramater - and updated conditionals to handle the level of precision specified by it. - (getVendor): New method that returns an information's vendor text. - (getInformation): Added override methods for getTitle and getVendor - that are used by the anonymous class to filter by locale. All three - methods now go through all levels of precision to search for the best - fitted locale. - (getResources), (getResourcesDescs): Updated to check if any level of - precision matches when searching for locales. - (parse): Added call to checkForTitleVendor. - * netx/net/sourceforge/jnlp/Parser.java - (checkForTitleVendor): New method to check for availability of localized - title and vendor from the information tags. Throws ParseException. - (getInfo): Replace loop with foreach loop. - (getInformationDesc): Remove check for present title and vendor. - (getLocale): Variant returned can now use everything after the eigth - element of the locale's string. - * netx/net/sourceforge/jnlp/resources/Messages.properties: - Update missing title and vendor messages to mention localization. - * tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java: - Update output string as per new changes to Messages internationalizations. - * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java: - New unit test that checks the localesMatches method in JNLPFile. - * tests/netx/unit/net/sourceforge/jnlp/MockJNLPFile.java: - New class used to create a mock JNLPFile object. - * tests/netx/unit/net/sourceforge/jnlp/ParserTest.java: - New unit test that checks that the return of getTitle and getVendor - have localized information. + Added tests for PR822 - multiple signatures on classpath + * Makefile.am: listed signed2 directory + * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html: + * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp: + * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp: + * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp: + * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp: + * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp: + * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp: + * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html: + various variations of multiple signtarues jnlp/html, in/out package, same/different/ signature + * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java: + simple class just with call to second jar + * tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java: + simple class just with call to second jar, but in package + * tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java: + * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java + various testcases tro above resources + * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: "-verbose " fixed to "-verbose" + +2012-08-27 Jiri Vanek + + Fixed long term failing unit-test, fixed NPE from ClassLoader + * netx/net/sourceforge/jnlp/NullJnlpFileException.java: new class to + distinguish plain NPE from null jnlp file. + * netx/net/sourceforge/jnlp/SecurityDesc.java: (getSandBoxPermissions) + added throw of NullJnlpFileException in case of null jnlp file. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (findClass) + added Override annotation, add catch of NullJnlpFileException and + re-throw of CNF exception. + * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: + (testResourceLoadSuccessCaching) (testResourceLoadFailureCaching) + (testParentClassLoaderIsAskedForClasses) - internal JNLPFile's + (getSecurity) null in SecurityDesc constructorrepalced by this. + (testNullFileSecurityDesc) new test to ensure NPE in null JNLPFile case. + +2012-08-22 Jiri Vanek + + Added tests for PR905 - parameters in jnlp/html application/applet resources + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl.html: + html file to launch applet, requested archive jar have parameter + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl1.jnlp: + jnlp file to launch application, requested archive jar have parameter + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl2.jnlp: + jnlp file to launch application, requested jnlp have parameter + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.html: + html file to launch signed applet, requested archive jar have parameter + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jnlp: + jnlp file to launch signed application, requested archive jar have parameter + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jnlp: + jnlp file to launch signed application, requested jnlp have parameter + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jnlp + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnlp + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned2.jnlp + * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned.jnlp + variations launching applets from jnlp + * tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java: + testaceses of above ParametrizedJarUrl/jnlps+htmls namely - (parametrizedAppletTestSignedTest) + , (testParametrizedJarUrl2), (testParametrizedJarUrlSigned2): passing + calls /partially/ with parameter. Those test are passing. + (parametrizedAppletTestSignedFirefoxTest) call with parameter upon signed + applet in browser, failing and so is representing PR905 2012-08-21 Jiri Vanek @@ -349,6 +2619,36 @@ * launcher/javaws.in: java is now launched by exec +2012-08-19 Thomas Meyer + + * netx/net/sourceforge/jnlp/JNLPFile.java: + * netx/net/sourceforge/jnlp/LaunchHandler.java: + * netx/net/sourceforge/jnlp/PluginBridge.java: + * netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java: + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: + * netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java: + Fix javadoc warnings. + * plugin/icedteanp/java/sun/applet/PluginObjectStore.java (contains): + Fix a small bug that prevents the only user of this method + (PluginAppletSecurity line 1064) to work correctly. + +2012-08-18 Jiri Vanek + + added encodings reproducer (PR1108) + * tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ: new + reproducer + * tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/srcs/encodingTest.java: + main class/main applet class and method of new encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ.jar + * tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/testcases/encodingTestTest.java: + testcases for jnlps of this reproducers + * tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources: + four utf-8 and four iso-8859-2 jnlp files and one utf-8 and one + iso-8859-2 html files + * tests/reproducers/simple/simpletest1/srcs/simpletest1.java: now prints + its args out + * tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java: + correctly swaped error and output listener in its test + 2012-08-17 Adam Domurad Fixes PR588, cookies set in the java cookie jar are now stored properly @@ -364,14 +2664,6 @@ 2012-08-17 Adam Domurad - * plugin/icedteanp/IcedTeaNPPlugin.cc - (consume_plugin_message): New, called by consume_message, handles - cookie and proxy info retrieval, and setting cookie info - (consume_message): Call consume_plugin_message for "plugin ..." - messages - -2012-08-17 Adam Domurad - Reproducers for PR588, sets persistent and session cookies in the cookie jar and tries to read them with various means. * tests/reproducers/signed/SavingCookies/resources/CheckCookie.html: @@ -415,13 +2707,6 @@ 2012-08-14 Danesh Dadachanji - Small addition to NEWS entry and bug annotation indicating the PR975 fix. - * NEWS: Add entry for PR975 - * tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java: - Add bug annotation for PR975. - -2012-08-14 Danesh Dadachanji - Classpaths in jars' manifests are only considered when the applet is run without using jnlp_href and a JNLP file. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (activateJars): @@ -463,6 +2748,181 @@ * tests/netx/unit/net/sourceforge/jnlp/tools/JarCertVerifierTest.java: New, tests isMetaInfFile +2012-08-06 Jiri Vanek + + Added splashscreen implementation + * netx/net/sourceforge/jnlp/GuiLaunchHandler.java: calling JNLPSplashScreen + constructor with file ratehr then null. + * netx/net/sourceforge/jnlp/InformationDesc.java: ONE_LINE changed from + "oneline" to "one-line", added citation why. (getDescriptionStrict) new + method returning exact value or null without fall-back. + * netx/net/sourceforge/jnlp/JNLPSplashScreen.java: Added header, default + values and useless string replaced by JnlpFile. + * netx/net/sourceforge/jnlp/resources/Messages.properties: Added SPLASH + family of keys. + * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: (getSplashControler) + new method returning its SplashControler. + * netx/net/sourceforge/jnlp/runtime/Boot.java: Constants (name) and + (version) made public. + * netx/net/sourceforge/jnlp/splashscreen/SplashController.java: New interface + for each class which wants its splasshcreen controlled by SplashUtils. + * netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java: New interface + for each class which wants to serve as error-showing splashscreen. + * netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java: New interface + for each class which wants to serve as splashscreen. + * netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java: Factory methods + for simplified splashscreens creation. + * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java: + Full implementation of SplashErrorPanel to be used as default error + splashscreen. + * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java: + Full implementation of SplashPanel to be used as default splashscreen. + * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java: + Class for gathering same logic in DefaultErrorSplashScreen2012 and + DefaultSplashScreen2012. + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java: + Class responsible for paint main graphic in DefaultSplashScreen2012. + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java: + Painting forefather for primitives drawing curves. + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java: + Class with cubic calculation. + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java: + Class responsible for paint main graphic in DefaultErrorSplashScreen2012. + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java: + Class responsible for metal-shining web label. + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java: + Painting primitive for drawing cubic-splines. + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java: + Painting primitive for drawing self-closed cubic-splines. + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java: + Class for rendering text from given texture, + * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java: + Class for rendering Iced label slowly filled with watter + * netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java: + Common forefather for all error splashscreens which would like to be an + component too. + * netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java: + Common forefather for all splashscreens which would like to be an component too. + * netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java: + Description item of InformationElement + * netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java: + Individual items in InformationElement + * netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java: + Wrapper around jnlp's information element. + * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: + Custom error dialogue with direct access to exception and icedtea-web page + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashScreenTest.java: + Test for final composition of ErrorSplashScreen2012, including main method + for manual testing + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashScreenTest.java: + Test for final composition of SplashScreen2012, including main method + for manual testing + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurveTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/CubicTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainterTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingTextTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosedTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefsTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRendererTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevelTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreenTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreenTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InfoItemTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java: + * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialogTest.java: + Unit-test classes always testing the class with corresponding name + +2012-08-13 Jiri Vanek + + * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: + (executeProcessUponURL)Fixed wrong call in previous commit which was + causing null process name. + * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: + Removed unused import. + +2012-08-13 Jiri Vanek + + Reproducers of PR955 + * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement1.jnlp: + * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement2.jnlp: + * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement3.jnlp: + * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement4.jnlp: + Test jnlp files with various combinations of locales, reproducers of PR955. + * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement_noLoc.jnlp + Jnlp file with which is not affected by PR955 and is helping to catch error in LOCALE changing hack + * tests/reproducers/simple/LocalisedInformationElement/srcs/LocalisedInformationElement.java: + Reproducer main class, after loading prints out default locale. + * tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java: + Testcases launching above jnlps under various locales. + * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: + Added set of methods allowing passing of custom variables to ThreadedProcess. + * tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java: + Added processing of custom variables. + +2012-08-10 Adam Domurad + + * plugin/icedteanp/IcedTeaNPPlugin.cc + (consume_plugin_message): New, called by consume_message, handles + cookie and proxy info retrieval, and setting cookie info + (consume_message): Call consume_plugin_message for "plugin ..." + messages + +2012-08-08 Danesh Dadachanji + + Fix PR955: regression: SweetHome3D fails to run + * NEWS: Added entry for PR955 + * netx/net/sourceforge/jnlp/JNLPFile.java: New enum Match that represents + the level of precision to use when matching locales. + (localMatches): Renamed to localeMatches, added matchLevel paramater + and updated conditionals to handle the level of precision specified by it. + (getVendor): New method that returns an information's vendor text. + (getInformation): Added override methods for getTitle and getVendor + that are used by the anonymous class to filter by locale. All three + methods now go through all levels of precision to search for the best + fitted locale. + (getResources), (getResourcesDescs): Updated to check if any level of + precision matches when searching for locales. + (parse): Added call to checkForTitleVendor. + * netx/net/sourceforge/jnlp/Parser.java + (checkForTitleVendor): New method to check for availability of localized + title and vendor from the information tags. Throws ParseException. + (getInfo): Replace loop with foreach loop. + (getInformationDesc): Remove check for present title and vendor. + (getLocale): Variant returned can now use everything after the eigth + element of the locale's string. + * netx/net/sourceforge/jnlp/resources/Messages.properties: + Update missing title and vendor messages to mention localization. + * tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java: + Update output string as per new changes to Messages internationalizations. + * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java: + New unit test that checks the localesMatches method in JNLPFile. + * tests/netx/unit/net/sourceforge/jnlp/MockJNLPFile.java: + New class used to create a mock JNLPFile object. + * tests/netx/unit/net/sourceforge/jnlp/ParserTest.java: + New unit test that checks that the return of getTitle and getVendor + have localized information. + +2012-08-07 Thomas Meyer + + * plugin/icedteanp/IcedTeaNPPlugin.cc: only export NP_GetMIMEDescription, + NP_GetValue, NP_Initialize and NP_Shutdown. This should fix PR472. + +2012-08-07 Saad Mohammad + + Added license header to files without one. + * netx/net/sourceforge/jnlp/AppletLog.java: + * netx/net/sourceforge/jnlp/JNLPMatcherException.java: + * netx/net/sourceforge/jnlp/Log.java: + * netx/net/sourceforge/jnlp/Node.java: + * netx/net/sourceforge/jnlp/UpdateDesc.java: + * netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java: + * netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java: Added + license header. + 2012-08-07 Adam Domurad Fixes PR1106, plugin crashing with firefox + archlinux/gentoo @@ -470,14 +2930,40 @@ (initialize_browser_functions): Account for the fact that browserTable->size can be larger than sizeof(NPNetscapeFuncs) -2012-07-31 Jiri Vanek - Peter Hatina +2012-08-01 Saad Mohammad - Introduced configure option --with-gtk=2|3|default to be able - to compile against different version of GTK+ (2.x or 3.x). - * NEWS: mentioned bug fix - * acinclude.m4: (ITW_GTK_CHECK_VERSION) macro for getting GTK+ version - (ITW_GTK_CHECK) macro for checking GTK+ version + Fix PR1049: Extension jnlp's signed jar with the content of only META-INF/* + is considered unsigned. + * NEWS: Added entry for PR1049. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): + Removes the display of the security dialog for loaders with only empty jars. + * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: + (JarCertVerifier): Tracks whether all jars verified are empty jars. + (hasAllEmptyJars): Returns true if all jars verified are empty jars. + (verifyJars): Checks whether signable entries and certificates are found and + decides if all jars are empty jars. + (isFullySignedByASingleCert): If all jars are emptyJars, returns true. + * tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jnlp: + Launching jnlp with the resource of an empty jar and an extension jnlp + containing the main jar. + * tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jnlp: + Launching jnlp with the resource of the main jar and an extension jnlp + containing the empty jar. + * tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarExtension.jnlp: + Extension jnlp containing only an empty jar. + * tests/reproducers/signed/EmptySignedJar/srcs/META-INF/empty_file: + Empty file within META-INF; required to create EmptySignedJar.jar + by the test engine. + * tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java: + Testcase that tests jnlp files with empty jars. + * tests/reproducers/signed/SignedJarResource/resources/SignedJarResource.jnlp: + Launches SignedJarResource class directly. + +2012-07-31 Danesh Dadachanji + + Minor fix to overly restrictive unit test. + * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java + (testIsMatchDoesNotHangOnLargeData): Increase timeout to 5 seconds. 2012-07-24 Adam Domurad @@ -489,28 +2975,25 @@ (get_proxy_info): Only attempt to perform this operation if there is a valid plugin instance +2012-07-31 Danesh Dadachanji + + * Makefile.am: Fix call to keytool that is missing its absolute path. + +2012-07-31 Jiri Vanek + Peter Hatina + + Introduced configure option --with-gtk=2|3|default to be able + to compile against different version of GTK+ (2.x or 3.x). + * NEWS: mentioned bug fix + * acinclude.m4: (ITW_GTK_CHECK_VERSION) macro for getting GTK+ version + (ITW_GTK_CHECK) macro for checking GTK+ version + 2012-07-24 Adam Domurad * plugin/icedteanp/IcedTeaPluginUtils.cc (IcedTeaPluginUtilities::strSplit): Replace usage of " " with proper delimiter -2012-07-24 Adam Domurad - - Refactor JNLPFile#launchType into its own interface type (as opposed to - Object), LaunchDesc. - * netx/net/sourceforge/jnlp/AppletDesc.java: Add override annotation to - getMainClass(). - * netx/net/sourceforge/jnlp/ApplicationDesc.java: Same as above - * netx/net/sourceforge/jnlp/InstallerDesc.java: Same as above - * netx/net/sourceforge/jnlp/JNLPFile.java: Make launchType a - LaunchDesc object. Update getLaunchInfo() accordingly. - * netx/net/sourceforge/jnlp/LaunchDesc.java: New launch description. - * netx/net/sourceforge/jnlp/Parser.java - (getLauncher): Return type changed to LaunchDesc - * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Replace - occurences of instanceof with respect to launchType. - 2012-07-18 Danesh Dadachanji Fix RH838417, Fix RH838559: Disambiguate signed applet security prompt @@ -522,6 +3005,12 @@ SWarnFullPermissionsIgnorePolicy if the cert is from a jar and is either unverified or has a signing error. Also added warning.png to HTTPS dialogs. +2012-07-18 Thomas Meyer + + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (handleMessage): + Fix possible endless loop while waiting for the applet object instance to + get created. + 2012-07-11 Jiri Vanek try to close browser before kill it @@ -537,6 +3026,26 @@ * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: removed Set terminated, should be removed long ago +2012-07-10 Adam Domurad + + Refactor JNLPFile#launchType into its own interface type (as opposed to + Object), LaunchDesc. + * netx/net/sourceforge/jnlp/AppletDesc.java: Add override annotation to + getMainClass(). + * netx/net/sourceforge/jnlp/ApplicationDesc.java: Same as above + * netx/net/sourceforge/jnlp/InstallerDesc.java: Same as above + * netx/net/sourceforge/jnlp/JNLPFile.java: Make launchType a + LaunchDesc object. Update getLaunchInfo() accordingly. + * netx/net/sourceforge/jnlp/LaunchDesc.java: New launch description. + * netx/net/sourceforge/jnlp/Parser.java + (getLauncher): Return type changed to LaunchDesc + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Replace + occurences of instanceof with respect to launchType. + +2012-07-09 Deepak Bhole + + * configure.ac: Bumped release number to 1.4pre + 2012-07-09 Saad Mohammad * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeExtensions): diff -Nru icedtea-web-1.3.2/config.guess icedtea-web-1.4/config.guess --- icedtea-web-1.3.2/config.guess 2013-04-11 16:15:37.720212805 +0000 +++ icedtea-web-1.4/config.guess 2013-05-03 19:23:56.177805398 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. -timestamp='2012-06-10' +timestamp='2009-11-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,7 +17,9 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -54,9 +56,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -143,7 +144,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -179,7 +180,7 @@ fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -222,7 +223,7 @@ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -268,10 +269,7 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; + exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -297,7 +295,7 @@ echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -396,23 +394,23 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -482,8 +480,8 @@ echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -496,7 +494,7 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -553,7 +551,7 @@ echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[4567]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -596,52 +594,52 @@ 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include + sed 's/^ //' << EOF >$dummy.c - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -732,22 +730,22 @@ exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -771,14 +769,14 @@ exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -790,12 +788,13 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -804,18 +803,15 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -861,13 +857,6 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -877,7 +866,7 @@ EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -889,29 +878,20 @@ then echo ${UNAME_MACHINE}-unknown-linux-gnu else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf - fi + echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -953,7 +933,7 @@ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -979,7 +959,7 @@ echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -987,17 +967,14 @@ sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1006,11 +983,11 @@ echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1042,7 +1019,7 @@ fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1070,13 +1047,13 @@ exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1111,8 +1088,8 @@ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1155,10 +1132,10 @@ echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1184,11 +1161,11 @@ exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1253,10 +1230,7 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) + NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1301,13 +1275,13 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1325,9 +1299,6 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1350,11 +1321,11 @@ #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff -Nru icedtea-web-1.3.2/config.sub icedtea-web-1.4/config.sub --- icedtea-web-1.3.2/config.sub 2013-04-11 16:15:37.725212805 +0000 +++ icedtea-web-1.4/config.sub 2013-05-03 19:23:56.180805363 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. -timestamp='2012-04-18' +timestamp='2009-11-20' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,7 +21,9 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -73,9 +75,8 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -122,18 +123,13 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -160,8 +156,8 @@ os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -177,10 +173,10 @@ os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -225,12 +221,6 @@ -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; -lynx*) os=-lynxos ;; @@ -255,22 +245,17 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ - | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -296,39 +281,29 @@ | moxie \ | mt \ | msp430 \ - | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ - | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | rl78 | rx \ + | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | v850 | v850e \ | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; @@ -338,21 +313,6 @@ basic_machine=mt-unknown ;; - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -367,25 +327,21 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ - | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ - | be32-* | be64-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -411,29 +367,25 @@ | mmix-* \ | mt-* \ | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ + | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ + | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -458,7 +410,7 @@ basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -528,20 +480,11 @@ basic_machine=powerpc-ibm os=-cnk ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -573,7 +516,7 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16 | cr16-*) + cr16) basic_machine=cr16-unknown os=-elf ;; @@ -731,6 +674,7 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -788,7 +732,7 @@ basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -827,18 +771,10 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; - msys) - basic_machine=i386-pc - os=-msys - ;; mvs) basic_machine=i370-ibm os=-mvs ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -903,12 +839,6 @@ np1) basic_machine=np1-gould ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -991,10 +921,9 @@ ;; power) basic_machine=power-ibm ;; - ppc | ppcbe) basic_machine=powerpc-unknown + ppc) basic_machine=powerpc-unknown ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1088,9 +1017,6 @@ basic_machine=i860-stratus os=-sysv4 ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; sun2) basic_machine=m68000-sun ;; @@ -1147,8 +1073,20 @@ basic_machine=t90-cray os=-unicos ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; tile*) - basic_machine=$basic_machine-unknown + basic_machine=tile-unknown os=-linux-gnu ;; tx39) @@ -1218,9 +1156,6 @@ xps | xps100) basic_machine=xps100-honeywell ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1318,11 +1253,11 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1358,9 +1293,8 @@ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1407,7 +1341,7 @@ -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1456,7 +1390,7 @@ -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1501,8 +1435,6 @@ -dicos*) os=-dicos ;; - -nacl*) - ;; -none) ;; *) @@ -1525,10 +1457,10 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1540,20 +1472,8 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1573,11 +1493,14 @@ ;; m68000-sun) os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 ;; m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1604,7 +1527,7 @@ *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff -Nru icedtea-web-1.3.2/configure icedtea-web-1.4/configure --- icedtea-web-1.3.2/configure 2013-04-11 16:15:36.949212793 +0000 +++ icedtea-web-1.4/configure 2013-05-03 19:23:55.588812806 +0000 @@ -1,11 +1,13 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for icedtea-web 1.3.2. +# Generated by GNU Autoconf 2.66 for icedtea-web 1.4. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -89,7 +91,6 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -134,31 +135,6 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -192,8 +168,7 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" +test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -237,25 +212,14 @@ if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -358,14 +322,6 @@ } # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -487,10 +443,6 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -525,16 +477,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' + as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -546,8 +498,28 @@ as_mkdir_p=false fi -as_test_x='test -x' -as_executable_p=as_fn_executable_p +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -579,8 +551,8 @@ # Identity of this package. PACKAGE_NAME='icedtea-web' PACKAGE_TARNAME='icedtea-web' -PACKAGE_VERSION='1.3.2' -PACKAGE_STRING='icedtea-web 1.3.2' +PACKAGE_VERSION='1.4' +PACKAGE_STRING='icedtea-web 1.4' PACKAGE_BUGREPORT='distro-pkg-dev@openjdk.java.net' PACKAGE_URL='http://icedtea.classpath.org/wiki/IcedTea-Web' @@ -588,6 +560,14 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +ASM_AVAILABLE +ASM_JAR +WITH_ASM_FALSE +WITH_ASM_TRUE +JACOCO_AVAILABLE +JACOCO_JAR +WITH_JACOCO_FALSE +WITH_JACOCO_TRUE EMMA_AVAILABLE EMMA_JAR WITH_EMMA_FALSE @@ -674,7 +654,6 @@ am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE -am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -787,6 +766,8 @@ with_rhino with_junit with_emma +with_jacoco +with_asm ' ac_precious_vars='build_alias host_alias @@ -872,9 +853,8 @@ fi case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -1214,7 +1194,7 @@ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac @@ -1265,6 +1245,8 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1350,7 +1332,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures icedtea-web 1.3.2 to adapt to many kinds of systems. +\`configure' configures icedtea-web 1.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1420,7 +1402,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of icedtea-web 1.3.2:";; + short | recursive ) echo "Configuration of icedtea-web 1.4:";; esac cat <<\_ACEOF @@ -1428,10 +1410,8 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors --disable-docs Disable generation of documentation --disable-plugin Disable compilation of browser plugin @@ -1469,6 +1449,8 @@ --with-rhino specify location of the rhino jar --with-junit specify location of the junit jar --with-emma specify location of the emma jar + --with-jacoco specify location of the jacoco jar + --with-asm specify location of the asm jar Some influential environment variables: CC C compiler command @@ -1565,10 +1547,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -icedtea-web configure 1.3.2 -generated by GNU Autoconf 2.69 +icedtea-web configure 1.4 +generated by GNU Autoconf 2.66 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1612,7 +1594,7 @@ ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1650,7 +1632,7 @@ ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1682,7 +1664,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - test -x conftest$ac_exeext + $as_test_x conftest$ac_exeext }; then : ac_retval=0 else @@ -1696,7 +1678,7 @@ # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1704,8 +1686,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by icedtea-web $as_me 1.3.2, which was -generated by GNU Autoconf 2.69. Invocation command line was +It was created by icedtea-web $as_me 1.4, which was +generated by GNU Autoconf 2.66. Invocation command line was $ $0 $@ @@ -2052,7 +2034,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.12' +am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2100,7 +2082,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : +if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2120,7 +2102,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2178,6 +2160,9 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2188,40 +2173,32 @@ esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac -# Do 'set' in a subshell so we don't clobber the current shell's +# Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done test "$2" = conftest.file ) then @@ -2233,16 +2210,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -2269,8 +2236,8 @@ am_missing_run="$MISSING --run " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -2282,17 +2249,17 @@ esac fi -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. +# will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -2304,7 +2271,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2332,7 +2299,7 @@ set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -2344,7 +2311,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2385,7 +2352,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : + if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2395,7 +2362,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2424,13 +2391,19 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : +if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2442,7 +2415,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2470,7 +2443,7 @@ $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2528,7 +2501,7 @@ # Define the identity of the package. PACKAGE='icedtea-web' - VERSION='1.3.2' + VERSION='1.4' cat >>confdefs.h <<_ACEOF @@ -2556,17 +2529,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5 @@ -2575,7 +2542,7 @@ _am_tools='gnutar pax cpio none' _am_tools=${am_cv_prog_tar_pax-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of '-'. +# Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in @@ -2642,7 +2609,7 @@ done rm -rf conftest.dir -if ${am_cv_prog_tar_pax+:} false; then : +if test "${am_cv_prog_tar_pax+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_pax=$_am_tool @@ -2673,7 +2640,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : +if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias @@ -2707,7 +2674,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : +if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then @@ -2748,7 +2715,7 @@ set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2760,7 +2727,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2788,7 +2755,7 @@ set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2800,7 +2767,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2841,7 +2808,7 @@ set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2853,7 +2820,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2881,7 +2848,7 @@ set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2894,7 +2861,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2940,7 +2907,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2952,7 +2919,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2984,7 +2951,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2996,7 +2963,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3267,7 +3234,7 @@ ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : +if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3318,7 +3285,7 @@ ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : +if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3355,7 +3322,7 @@ ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : +if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3433,7 +3400,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3442,7 +3409,8 @@ /* end confdefs.h. */ #include #include -struct stat; +#include +#include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3545,7 +3513,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. +# Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -3578,7 +3546,6 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' - am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3594,16 +3561,15 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -3637,16 +3603,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with '-c' and '-o' for the sake of the "dashmstdout" + # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -3655,16 +3621,16 @@ test "$am__universal" = false || continue ;; nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -3734,7 +3700,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : +if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -3746,7 +3712,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3778,7 +3744,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -3790,7 +3756,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3856,7 +3822,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3893,7 +3859,7 @@ ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : +if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -3979,16 +3945,15 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -4022,16 +3987,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with '-c' and '-o' for the sake of the "dashmstdout" + # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -4040,16 +4005,16 @@ test "$am__universal" = false || continue ;; nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -4198,7 +4163,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if cp supports --reflink" >&5 $as_echo_n "checking if cp supports --reflink... " >&6; } -if ${it_cv_reflink+:} false; then : +if test "${it_cv_reflink+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -4225,7 +4190,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can hard link rather than copy from ${abs_top_srcdir}" >&5 $as_echo_n "checking if we can hard link rather than copy from ${abs_top_srcdir}... " >&6; } -if ${it_cv_hardlink_src+:} false; then : +if test "${it_cv_hardlink_src+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -4292,7 +4257,7 @@ set dummy ${ac_tool_prefix}gcj; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GCJ+:} false; then : +if test "${ac_cv_path_GCJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GCJ in @@ -4306,7 +4271,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GCJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4335,7 +4300,7 @@ set dummy gcj; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_GCJ+:} false; then : +if test "${ac_cv_path_ac_pt_GCJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_GCJ in @@ -4349,7 +4314,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_GCJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4393,7 +4358,7 @@ set dummy ${ac_tool_prefix}zip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ZIP+:} false; then : +if test "${ac_cv_path_ZIP+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ZIP in @@ -4407,7 +4372,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4436,7 +4401,7 @@ set dummy zip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_ZIP+:} false; then : +if test "${ac_cv_path_ac_pt_ZIP+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_ZIP in @@ -4450,7 +4415,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_ZIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4554,7 +4519,7 @@ set dummy "${withval}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC+:} false; then : +if test "${ac_cv_path_JAVAC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVAC in @@ -4568,7 +4533,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4596,7 +4561,7 @@ set dummy "javac"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC+:} false; then : +if test "${ac_cv_path_JAVAC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVAC in @@ -4610,7 +4575,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4649,7 +4614,7 @@ set dummy ""; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC+:} false; then : +if test "${ac_cv_path_JAVAC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVAC in @@ -4663,7 +4628,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4691,7 +4656,7 @@ set dummy "javac"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC+:} false; then : +if test "${ac_cv_path_JAVAC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVAC in @@ -4705,7 +4670,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4747,7 +4712,7 @@ set dummy ""; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC+:} false; then : +if test "${ac_cv_path_JAVAC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVAC in @@ -4761,7 +4726,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4789,7 +4754,7 @@ set dummy "javac"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC+:} false; then : +if test "${ac_cv_path_JAVAC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVAC in @@ -4803,7 +4768,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4850,7 +4815,7 @@ set dummy "${withval}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -4864,7 +4829,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4892,7 +4857,7 @@ set dummy "ecj"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -4906,7 +4871,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4933,7 +4898,7 @@ set dummy "ecj-3.1"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -4947,7 +4912,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4975,7 +4940,7 @@ set dummy "ecj-3.2"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -4989,7 +4954,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5017,7 +4982,7 @@ set dummy "ecj-3.3"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5031,7 +4996,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5071,7 +5036,7 @@ set dummy ""; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5085,7 +5050,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5113,7 +5078,7 @@ set dummy "ecj"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5127,7 +5092,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5154,7 +5119,7 @@ set dummy "ecj-3.1"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5168,7 +5133,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5196,7 +5161,7 @@ set dummy "ecj-3.2"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5210,7 +5175,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5238,7 +5203,7 @@ set dummy "ecj-3.3"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5252,7 +5217,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5295,7 +5260,7 @@ set dummy ""; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5309,7 +5274,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5337,7 +5302,7 @@ set dummy "ecj"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5351,7 +5316,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5378,7 +5343,7 @@ set dummy "ecj-3.1"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5392,7 +5357,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5420,7 +5385,7 @@ set dummy "ecj-3.2"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5434,7 +5399,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5462,7 +5427,7 @@ set dummy "ecj-3.3"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ECJ+:} false; then : +if test "${ac_cv_path_ECJ+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ECJ in @@ -5476,7 +5441,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5513,7 +5478,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we are using ecj as javac" >&5 $as_echo_n "checking if we are using ecj as javac... " >&6; } -if ${it_cv_ecj+:} false; then : +if test "${it_cv_ecj+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -5553,7 +5518,7 @@ set dummy "${JAR}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAR+:} false; then : +if test "${ac_cv_path_JAR+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAR in @@ -5567,7 +5532,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5595,7 +5560,7 @@ set dummy "gjar"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAR+:} false; then : +if test "${ac_cv_path_JAR+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAR in @@ -5609,7 +5574,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5637,7 +5602,7 @@ set dummy "jar"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAR+:} false; then : +if test "${ac_cv_path_JAR+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAR in @@ -5651,7 +5616,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5782,7 +5747,7 @@ set dummy "${JAVADOC}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVADOC+:} false; then : +if test "${ac_cv_path_JAVADOC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVADOC in @@ -5796,7 +5761,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5824,7 +5789,7 @@ set dummy "javadoc"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVADOC+:} false; then : +if test "${ac_cv_path_JAVADOC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVADOC in @@ -5838,7 +5803,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5866,7 +5831,7 @@ set dummy "gjdoc"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVADOC+:} false; then : +if test "${ac_cv_path_JAVADOC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVADOC in @@ -5880,7 +5845,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5915,7 +5880,7 @@ cd tmp.$$ mkdir pkg cat << \EOF > $CLASS -/* [#]line 5918 "configure" */ +/* [#]line 5883 "configure" */ package pkg; public class Test @@ -5978,7 +5943,7 @@ set dummy keytool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_KEYTOOL+:} false; then : +if test "${ac_cv_path_KEYTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else case $KEYTOOL in @@ -5992,7 +5957,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_KEYTOOL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6051,7 +6016,7 @@ set dummy jarsigner; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JARSIGNER+:} false; then : +if test "${ac_cv_path_JARSIGNER+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JARSIGNER in @@ -6065,7 +6030,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JARSIGNER="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6109,7 +6074,7 @@ set dummy ${ac_tool_prefix}hg; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_HG+:} false; then : +if test "${ac_cv_path_HG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $HG in @@ -6123,7 +6088,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6152,7 +6117,7 @@ set dummy hg; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_HG+:} false; then : +if test "${ac_cv_path_ac_pt_HG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_HG in @@ -6166,7 +6131,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_HG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6288,14 +6253,13 @@ - if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in @@ -6309,7 +6273,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6338,7 +6302,7 @@ set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in @@ -6352,7 +6316,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6420,7 +6384,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6437,7 +6400,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6457,9 +6419,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0" 2>&1` + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0" 2>&1` else - GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0" 2>&1` + GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 @@ -6474,6 +6436,7 @@ Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 + elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6489,6 +6452,7 @@ To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } + else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS @@ -6514,7 +6478,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_CFLAGS=`$PKG_CONFIG --cflags "npapi-sdk" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6531,7 +6494,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_LIBS=`$PKG_CONFIG --libs "npapi-sdk" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6551,9 +6513,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - MOZILLA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "npapi-sdk" 2>&1` + MOZILLA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "npapi-sdk" 2>&1` else - MOZILLA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "npapi-sdk" 2>&1` + MOZILLA_PKG_ERRORS=`$PKG_CONFIG --print-errors "npapi-sdk" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MOZILLA_PKG_ERRORS" >&5 @@ -6574,7 +6536,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_CFLAGS=`$PKG_CONFIG --cflags "mozilla-plugin" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6591,7 +6552,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_LIBS=`$PKG_CONFIG --libs "mozilla-plugin" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6611,9 +6571,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - MOZILLA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mozilla-plugin" 2>&1` + MOZILLA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "mozilla-plugin" 2>&1` else - MOZILLA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mozilla-plugin" 2>&1` + MOZILLA_PKG_ERRORS=`$PKG_CONFIG --print-errors "mozilla-plugin" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MOZILLA_PKG_ERRORS" >&5 @@ -6628,6 +6588,7 @@ Alternatively, you may set the environment variables MOZILLA_CFLAGS and MOZILLA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 + elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6643,6 +6604,7 @@ To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } + else MOZILLA_CFLAGS=$pkg_cv_MOZILLA_CFLAGS MOZILLA_LIBS=$pkg_cv_MOZILLA_LIBS @@ -6670,7 +6632,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_CFLAGS=`$PKG_CONFIG --cflags "mozilla-plugin" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6687,7 +6648,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_LIBS=`$PKG_CONFIG --libs "mozilla-plugin" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6707,9 +6667,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - MOZILLA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mozilla-plugin" 2>&1` + MOZILLA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "mozilla-plugin" 2>&1` else - MOZILLA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mozilla-plugin" 2>&1` + MOZILLA_PKG_ERRORS=`$PKG_CONFIG --print-errors "mozilla-plugin" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MOZILLA_PKG_ERRORS" >&5 @@ -6724,6 +6684,7 @@ Alternatively, you may set the environment variables MOZILLA_CFLAGS and MOZILLA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 + elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6739,6 +6700,7 @@ To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } + else MOZILLA_CFLAGS=$pkg_cv_MOZILLA_CFLAGS MOZILLA_LIBS=$pkg_cv_MOZILLA_LIBS @@ -6755,7 +6717,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xulrunner version" >&5 $as_echo_n "checking for xulrunner version... " >&6; } -if ${xulrunner_cv_collapsed_version+:} false; then : +if test "${xulrunner_cv_collapsed_version+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -6786,7 +6748,7 @@ then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xulrunner version" >&5 $as_echo_n "checking for xulrunner version... " >&6; } -if ${xulrunner_cv_collapsed_version+:} false; then : +if test "${xulrunner_cv_collapsed_version+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -6813,7 +6775,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lz" >&5 $as_echo_n "checking for main in -lz... " >&6; } -if ${ac_cv_lib_z_main+:} false; then : +if test "${ac_cv_lib_z_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6841,7 +6803,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_main" >&5 $as_echo "$ac_cv_lib_z_main" >&6; } -if test "x$ac_cv_lib_z_main" = xyes; then : +if test "x$ac_cv_lib_z_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF @@ -6867,7 +6829,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6884,7 +6845,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -6904,9 +6864,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11" 2>&1` + X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11" 2>&1` else - X11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11" 2>&1` + X11_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$X11_PKG_ERRORS" >&5 @@ -6980,7 +6940,7 @@ set dummy "${JAVA}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVA+:} false; then : +if test "${ac_cv_path_JAVA+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVA in @@ -6994,7 +6954,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7022,7 +6982,7 @@ set dummy "java"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVA+:} false; then : +if test "${ac_cv_path_JAVA+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVA in @@ -7036,7 +6996,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7064,7 +7024,7 @@ set dummy "gij"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVA+:} false; then : +if test "${ac_cv_path_JAVA+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVA in @@ -7078,7 +7038,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7128,7 +7088,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if java.util.jar.Pack200 is available" >&5 $as_echo_n "checking if java.util.jar.Pack200 is available... " >&6; } -if ${it_cv_JAVA_UTIL_JAR_PACK200+:} false; then : +if test "${it_cv_JAVA_UTIL_JAR_PACK200+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7137,7 +7097,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7140 "configure" */ +/* [#]line 7100 "configure" */ package sun.applet; import java.util.jar.Pack200; @@ -7178,7 +7138,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if java.net.CookieManager is available" >&5 $as_echo_n "checking if java.net.CookieManager is available... " >&6; } -if ${it_cv_JAVA_NET_COOKIEMANAGER+:} false; then : +if test "${it_cv_JAVA_NET_COOKIEMANAGER+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7187,7 +7147,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7190 "configure" */ +/* [#]line 7150 "configure" */ package sun.applet; import java.net.CookieManager; @@ -7228,7 +7188,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if java.net.HttpCookie is available" >&5 $as_echo_n "checking if java.net.HttpCookie is available... " >&6; } -if ${it_cv_JAVA_NET_HTTPCOOKIE+:} false; then : +if test "${it_cv_JAVA_NET_HTTPCOOKIE+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7237,7 +7197,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7240 "configure" */ +/* [#]line 7200 "configure" */ package sun.applet; import java.net.HttpCookie; @@ -7278,7 +7238,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if java.net.CookieHandler is available" >&5 $as_echo_n "checking if java.net.CookieHandler is available... " >&6; } -if ${it_cv_JAVA_NET_COOKIEHANDLER+:} false; then : +if test "${it_cv_JAVA_NET_COOKIEHANDLER+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7287,7 +7247,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7290 "configure" */ +/* [#]line 7250 "configure" */ package sun.applet; import java.net.CookieHandler; @@ -7328,7 +7288,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.provider.X509Factory is available" >&5 $as_echo_n "checking if sun.security.provider.X509Factory is available... " >&6; } -if ${it_cv_SUN_SECURITY_PROVIDER_X509FACTORY+:} false; then : +if test "${it_cv_SUN_SECURITY_PROVIDER_X509FACTORY+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7337,7 +7297,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7340 "configure" */ +/* [#]line 7300 "configure" */ package sun.applet; import sun.security.provider.X509Factory; @@ -7378,7 +7338,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.util.SecurityConstants is available" >&5 $as_echo_n "checking if sun.security.util.SecurityConstants is available... " >&6; } -if ${it_cv_SUN_SECURITY_UTIL_SECURITYCONSTANTS+:} false; then : +if test "${it_cv_SUN_SECURITY_UTIL_SECURITYCONSTANTS+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7387,7 +7347,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7390 "configure" */ +/* [#]line 7350 "configure" */ package sun.applet; import sun.security.util.SecurityConstants; @@ -7428,7 +7388,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.util.HostnameChecker is available" >&5 $as_echo_n "checking if sun.security.util.HostnameChecker is available... " >&6; } -if ${it_cv_SUN_SECURITY_UTIL_HOSTNAMECHECKER+:} false; then : +if test "${it_cv_SUN_SECURITY_UTIL_HOSTNAMECHECKER+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7437,7 +7397,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7440 "configure" */ +/* [#]line 7400 "configure" */ package sun.applet; import sun.security.util.HostnameChecker; @@ -7478,7 +7438,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.x509.X500Name is available" >&5 $as_echo_n "checking if sun.security.x509.X500Name is available... " >&6; } -if ${it_cv_SUN_SECURITY_X509_X500NAME+:} false; then : +if test "${it_cv_SUN_SECURITY_X509_X500NAME+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7487,7 +7447,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7490 "configure" */ +/* [#]line 7450 "configure" */ package sun.applet; import sun.security.x509.X500Name; @@ -7528,7 +7488,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.misc.HexDumpEncoder is available" >&5 $as_echo_n "checking if sun.misc.HexDumpEncoder is available... " >&6; } -if ${it_cv_SUN_MISC_HEXDUMPENCODER+:} false; then : +if test "${it_cv_SUN_MISC_HEXDUMPENCODER+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7537,7 +7497,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7540 "configure" */ +/* [#]line 7500 "configure" */ package sun.applet; import sun.misc.HexDumpEncoder; @@ -7578,7 +7538,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.validator.ValidatorException is available" >&5 $as_echo_n "checking if sun.security.validator.ValidatorException is available... " >&6; } -if ${it_cv_SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION+:} false; then : +if test "${it_cv_SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7587,7 +7547,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7590 "configure" */ +/* [#]line 7550 "configure" */ package sun.applet; import sun.security.validator.ValidatorException; @@ -7628,7 +7588,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager is available" >&5 $as_echo_n "checking if com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager is available... " >&6; } -if ${it_cv_COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER+:} false; then : +if test "${it_cv_COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7637,7 +7597,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7640 "configure" */ +/* [#]line 7600 "configure" */ package sun.applet; import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager; @@ -7678,7 +7638,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.net.www.protocol.jar.URLJarFile is available" >&5 $as_echo_n "checking if sun.net.www.protocol.jar.URLJarFile is available... " >&6; } -if ${it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE+:} false; then : +if test "${it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7687,7 +7647,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7690 "configure" */ +/* [#]line 7650 "configure" */ package sun.applet; import sun.net.www.protocol.jar.URLJarFile; @@ -7728,7 +7688,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.net.www.protocol.jar.URLJarFileCallBack is available" >&5 $as_echo_n "checking if sun.net.www.protocol.jar.URLJarFileCallBack is available... " >&6; } -if ${it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK+:} false; then : +if test "${it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7737,7 +7697,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7740 "configure" */ +/* [#]line 7700 "configure" */ package sun.applet; import sun.net.www.protocol.jar.URLJarFileCallBack; @@ -7778,7 +7738,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.awt.X11.XEmbeddedFrame is available" >&5 $as_echo_n "checking if sun.awt.X11.XEmbeddedFrame is available... " >&6; } -if ${it_cv_SUN_AWT_X11_XEMBEDDEDFRAME+:} false; then : +if test "${it_cv_SUN_AWT_X11_XEMBEDDEDFRAME+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7787,7 +7747,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7790 "configure" */ +/* [#]line 7750 "configure" */ package sun.applet; import sun.awt.X11.XEmbeddedFrame; @@ -7828,7 +7788,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.misc.Ref is available" >&5 $as_echo_n "checking if sun.misc.Ref is available... " >&6; } -if ${it_cv_SUN_MISC_REF+:} false; then : +if test "${it_cv_SUN_MISC_REF+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7837,7 +7797,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7840 "configure" */ +/* [#]line 7800 "configure" */ package sun.applet; import sun.misc.Ref; @@ -7876,9 +7836,59 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.misc.BASE64Decoder is available" >&5 +$as_echo_n "checking if sun.misc.BASE64Decoder is available... " >&6; } +if test "${it_cv_SUN_MISC_BASE64DECODER+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + +CLASS=sun/applet/Test.java +BYTECODE=$(echo $CLASS|sed 's#\.java##') +mkdir -p tmp.$$/$(dirname $CLASS) +cd tmp.$$ +cat << \EOF > $CLASS +/* [#]line 7850 "configure" */ +package sun.applet; + +import sun.misc.BASE64Decoder; + +public class Test +{ + public static void main(String[] args) + throws Exception + { + System.out.println(Class.forName("sun.misc.BASE64Decoder")); + } +} + +EOF +if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then + if $JAVA -classpath . $BYTECODE >&5 2>&1; then + it_cv_SUN_MISC_BASE64DECODER=yes; + else + it_cv_SUN_MISC_BASE64DECODER=no; + fi +else + it_cv_SUN_MISC_BASE64DECODER=no; +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_MISC_BASE64DECODER" >&5 +$as_echo "$it_cv_SUN_MISC_BASE64DECODER" >&6; } +rm -f $CLASS *.class +cd .. +# should be rmdir but has to be rm -rf due to sun.applet usage +rm -rf tmp.$$ +if test x"${it_cv_SUN_MISC_BASE64DECODER}" = "xno"; then + as_fn_error $? "sun.misc.BASE64Decoder not found." "$LINENO" 5 +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if com.sun.jndi.toolkit.url.UrlUtil is available" >&5 $as_echo_n "checking if com.sun.jndi.toolkit.url.UrlUtil is available... " >&6; } -if ${it_cv_COM_SUN_JNDI_TOOLKIT_URL_URLUTIL+:} false; then : +if test "${it_cv_COM_SUN_JNDI_TOOLKIT_URL_URLUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7887,7 +7897,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7890 "configure" */ +/* [#]line 7900 "configure" */ package sun.applet; import com.sun.jndi.toolkit.url.UrlUtil; @@ -7928,7 +7938,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.applet.AppletImageRef is available" >&5 $as_echo_n "checking if sun.applet.AppletImageRef is available... " >&6; } -if ${it_cv_SUN_APPLET_APPLETIMAGEREF+:} false; then : +if test "${it_cv_SUN_APPLET_APPLETIMAGEREF+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7937,7 +7947,7 @@ mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7940 "configure" */ +/* [#]line 7950 "configure" */ package sun.applet; import sun.applet.AppletImageRef; @@ -7978,7 +7988,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.applet.AppletViewerPanel is available and public" >&5 $as_echo_n "checking if sun.applet.AppletViewerPanel is available and public... " >&6; } -if ${it_cv_applet_hole+:} false; then : +if test "${it_cv_applet_hole+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7987,7 +7997,7 @@ mkdir -p tmp.$$ cd tmp.$$ cat << \EOF > $CLASS -/* [#]line 7990 "configure" */ +/* [#]line 8000 "configure" */ import java.lang.reflect.Modifier; public class TestAppletViewer @@ -8054,7 +8064,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB2_V_216_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.16" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -8071,7 +8080,6 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB2_V_216_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.16" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -8091,9 +8099,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GLIB2_V_216_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.16" 2>&1` + GLIB2_V_216_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.16" 2>&1` else - GLIB2_V_216_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.16" 2>&1` + GLIB2_V_216_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.16" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB2_V_216_PKG_ERRORS" >&5 @@ -8173,7 +8181,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_XSLTPROC+:} false; then : +if test "${ac_cv_prog_XSLTPROC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$XSLTPROC"; then @@ -8185,7 +8193,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XSLTPROC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8250,7 +8258,7 @@ set dummy ${ac_tool_prefix}; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FIREFOX+:} false; then : +if test "${ac_cv_path_FIREFOX+set}" = set; then : $as_echo_n "(cached) " >&6 else case $FIREFOX in @@ -8264,7 +8272,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FIREFOX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8293,7 +8301,7 @@ set dummy ; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_FIREFOX+:} false; then : +if test "${ac_cv_path_ac_pt_FIREFOX+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_FIREFOX in @@ -8307,7 +8315,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_FIREFOX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8349,7 +8357,7 @@ set dummy ${ac_tool_prefix}firefox; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FIREFOX+:} false; then : +if test "${ac_cv_path_FIREFOX+set}" = set; then : $as_echo_n "(cached) " >&6 else case $FIREFOX in @@ -8363,7 +8371,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FIREFOX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8392,7 +8400,7 @@ set dummy firefox; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_FIREFOX+:} false; then : +if test "${ac_cv_path_ac_pt_FIREFOX+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_FIREFOX in @@ -8406,7 +8414,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_FIREFOX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8489,7 +8497,7 @@ set dummy ${ac_tool_prefix}google-chrome; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHROME+:} false; then : +if test "${ac_cv_path_CHROME+set}" = set; then : $as_echo_n "(cached) " >&6 else case $CHROME in @@ -8503,7 +8511,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CHROME="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8532,7 +8540,7 @@ set dummy google-chrome; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CHROME+:} false; then : +if test "${ac_cv_path_ac_pt_CHROME+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_CHROME in @@ -8546,7 +8554,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_CHROME="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8588,7 +8596,7 @@ set dummy ${ac_tool_prefix}chrome; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHROME+:} false; then : +if test "${ac_cv_path_CHROME+set}" = set; then : $as_echo_n "(cached) " >&6 else case $CHROME in @@ -8602,7 +8610,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CHROME="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8631,7 +8639,7 @@ set dummy chrome; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CHROME+:} false; then : +if test "${ac_cv_path_ac_pt_CHROME+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_CHROME in @@ -8645,7 +8653,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_CHROME="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8728,7 +8736,7 @@ set dummy ${ac_tool_prefix}chromium-browser; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHROMIUM+:} false; then : +if test "${ac_cv_path_CHROMIUM+set}" = set; then : $as_echo_n "(cached) " >&6 else case $CHROMIUM in @@ -8742,7 +8750,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CHROMIUM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8771,7 +8779,7 @@ set dummy chromium-browser; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CHROMIUM+:} false; then : +if test "${ac_cv_path_ac_pt_CHROMIUM+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_CHROMIUM in @@ -8785,7 +8793,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_CHROMIUM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8827,7 +8835,7 @@ set dummy ${ac_tool_prefix}chromium; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CHROMIUM+:} false; then : +if test "${ac_cv_path_CHROMIUM+set}" = set; then : $as_echo_n "(cached) " >&6 else case $CHROMIUM in @@ -8841,7 +8849,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CHROMIUM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8870,7 +8878,7 @@ set dummy chromium; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CHROMIUM+:} false; then : +if test "${ac_cv_path_ac_pt_CHROMIUM+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_CHROMIUM in @@ -8884,7 +8892,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_CHROMIUM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8967,7 +8975,7 @@ set dummy ${ac_tool_prefix}; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OPERA+:} false; then : +if test "${ac_cv_path_OPERA+set}" = set; then : $as_echo_n "(cached) " >&6 else case $OPERA in @@ -8981,7 +8989,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_OPERA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9010,7 +9018,7 @@ set dummy ; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_OPERA+:} false; then : +if test "${ac_cv_path_ac_pt_OPERA+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_OPERA in @@ -9024,7 +9032,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_OPERA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9066,7 +9074,7 @@ set dummy ${ac_tool_prefix}opera; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OPERA+:} false; then : +if test "${ac_cv_path_OPERA+set}" = set; then : $as_echo_n "(cached) " >&6 else case $OPERA in @@ -9080,7 +9088,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_OPERA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9109,7 +9117,7 @@ set dummy opera; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_OPERA+:} false; then : +if test "${ac_cv_path_ac_pt_OPERA+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_OPERA in @@ -9123,7 +9131,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_OPERA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9206,7 +9214,7 @@ set dummy ${ac_tool_prefix}; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MIDORI+:} false; then : +if test "${ac_cv_path_MIDORI+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MIDORI in @@ -9220,7 +9228,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MIDORI="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9249,7 +9257,7 @@ set dummy ; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_MIDORI+:} false; then : +if test "${ac_cv_path_ac_pt_MIDORI+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_MIDORI in @@ -9263,7 +9271,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_MIDORI="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9305,7 +9313,7 @@ set dummy ${ac_tool_prefix}midori; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MIDORI+:} false; then : +if test "${ac_cv_path_MIDORI+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MIDORI in @@ -9319,7 +9327,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MIDORI="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9348,7 +9356,7 @@ set dummy midori; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_MIDORI+:} false; then : +if test "${ac_cv_path_ac_pt_MIDORI+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_MIDORI in @@ -9362,7 +9370,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_MIDORI="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9445,7 +9453,7 @@ set dummy ${ac_tool_prefix}; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_EPIPHANY+:} false; then : +if test "${ac_cv_path_EPIPHANY+set}" = set; then : $as_echo_n "(cached) " >&6 else case $EPIPHANY in @@ -9459,7 +9467,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_EPIPHANY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9488,7 +9496,7 @@ set dummy ; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_EPIPHANY+:} false; then : +if test "${ac_cv_path_ac_pt_EPIPHANY+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_EPIPHANY in @@ -9502,7 +9510,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_EPIPHANY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9544,7 +9552,7 @@ set dummy ${ac_tool_prefix}epiphany; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_EPIPHANY+:} false; then : +if test "${ac_cv_path_EPIPHANY+set}" = set; then : $as_echo_n "(cached) " >&6 else case $EPIPHANY in @@ -9558,7 +9566,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_EPIPHANY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9587,7 +9595,7 @@ set dummy epiphany; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_EPIPHANY+:} false; then : +if test "${ac_cv_path_ac_pt_EPIPHANY+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_EPIPHANY in @@ -9601,7 +9609,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_EPIPHANY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9903,6 +9911,150 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jacoco jar" >&5 +$as_echo_n "checking for jacoco jar... " >&6; } + +# Check whether --with-jacoco was given. +if test "${with_jacoco+set}" = set; then : + withval=$with_jacoco; + case "${withval}" in + yes) + JACOCO_JAR=yes + ;; + no) + JACOCO_JAR=no + ;; + *) + if test -f "${withval}"; then + JACOCO_JAR="${withval}" + elif test -z "${withval}"; then + JACOCO_JAR=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "\"The jacoco jar ${withval} was not found.\"" "$LINENO" 5 + fi + ;; + esac + +else + + JACOCO_JAR=yes + +fi + + it_extra_paths_jacoco="/usr/share/java/jacoco/org.jacoco.core.jar" + if test "x${JACOCO_JAR}" = "xyes"; then + for path in ${it_extra_paths_jacoco}; do + if test -f ${path}; then + JACOCO_JAR=${path} + break + fi + done + fi + if test x"${JACOCO_JAR}" = "xyes"; then + if test -f "/usr/share/java/jacoco.jar"; then + JACOCO_JAR=/usr/share/java/jacoco.jar + fi + fi + if test x"${JACOCO_JAR}" = "xyes"; then + JACOCO_JAR=no + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JACOCO_JAR}" >&5 +$as_echo "${JACOCO_JAR}" >&6; } + if test x"${JACOCO_JAR}" != "xno"; then + WITH_JACOCO_TRUE= + WITH_JACOCO_FALSE='#' +else + WITH_JACOCO_TRUE='#' + WITH_JACOCO_FALSE= +fi + + # Clear JACOCO_JAR if it doesn't contain a valid filename + if test x"${JACOCO_JAR}" = "xno"; then + JACOCO_JAR= + fi + if test -n "${JACOCO_JAR}" ; then + JACOCO_AVAILABLE=true + else + JACOCO_AVAILABLE=false + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for asm jar" >&5 +$as_echo_n "checking for asm jar... " >&6; } + +# Check whether --with-asm was given. +if test "${with_asm+set}" = set; then : + withval=$with_asm; + case "${withval}" in + yes) + ASM_JAR=yes + ;; + no) + ASM_JAR=no + ;; + *) + if test -f "${withval}"; then + ASM_JAR="${withval}" + elif test -z "${withval}"; then + ASM_JAR=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "\"The asm jar ${withval} was not found.\"" "$LINENO" 5 + fi + ;; + esac + +else + + ASM_JAR=yes + +fi + + it_extra_paths_asm="/usr/share/java/objectweb-asm4/asm-all.jar /usr/share/java/objectweb-asm4/asm-all-4.0.jar /usr/share/java/objectweb-asm/asm-all.jar" + if test "x${ASM_JAR}" = "xyes"; then + for path in ${it_extra_paths_asm}; do + if test -f ${path}; then + ASM_JAR=${path} + break + fi + done + fi + if test x"${ASM_JAR}" = "xyes"; then + if test -f "/usr/share/java/asm.jar"; then + ASM_JAR=/usr/share/java/asm.jar + fi + fi + if test x"${ASM_JAR}" = "xyes"; then + ASM_JAR=no + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ASM_JAR}" >&5 +$as_echo "${ASM_JAR}" >&6; } + if test x"${ASM_JAR}" != "xno"; then + WITH_ASM_TRUE= + WITH_ASM_FALSE='#' +else + WITH_ASM_TRUE='#' + WITH_ASM_FALSE= +fi + + # Clear ASM_JAR if it doesn't contain a valid filename + if test x"${ASM_JAR}" = "xno"; then + ASM_JAR= + fi + if test -n "${ASM_JAR}" ; then + ASM_AVAILABLE=true + else + ASM_AVAILABLE=false + fi + + + + ac_config_files="$ac_config_files jrunscript" ac_config_files="$ac_config_files build.properties" @@ -9972,21 +10124,10 @@ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then + test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi + cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -10053,14 +10194,6 @@ LTLIBOBJS=$ac_ltlibobjs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -10129,8 +10262,16 @@ as_fn_error $? "conditional \"WITH_EMMA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${WITH_JACOCO_TRUE}" && test -z "${WITH_JACOCO_FALSE}"; then + as_fn_error $? "conditional \"WITH_JACOCO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_ASM_TRUE}" && test -z "${WITH_ASM_FALSE}"; then + as_fn_error $? "conditional \"WITH_ASM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi -: "${CONFIG_STATUS=./config.status}" +: ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -10231,7 +10372,6 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -10427,16 +10567,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' + as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -10496,16 +10636,28 @@ as_mkdir_p=false fi - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -10526,8 +10678,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by icedtea-web $as_me 1.3.2, which was -generated by GNU Autoconf 2.69. Invocation command line was +This file was extended by icedtea-web $as_me 1.4, which was +generated by GNU Autoconf 2.66. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -10584,11 +10736,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -icedtea-web config.status 1.3.2 -configured by $0, generated by GNU Autoconf 2.69, +icedtea-web config.status 1.4 +configured by $0, generated by GNU Autoconf 2.66, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -10606,16 +10758,11 @@ while test $# != 0 do case $1 in - --*=?*) + --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; *) ac_option=$1 ac_optarg=$2 @@ -10637,7 +10784,6 @@ $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -10668,7 +10814,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -10731,10 +10877,9 @@ # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= ac_tmp= + tmp= trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -10742,13 +10887,12 @@ { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" + test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -10770,7 +10914,7 @@ ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF @@ -10798,7 +10942,7 @@ rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -10846,7 +10990,7 @@ rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && +cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -10878,7 +11022,7 @@ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -10937,7 +11081,7 @@ for ac_f do case $ac_f in - -) ac_f="$ac_tmp/stdin";; + -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -10972,7 +11116,7 @@ esac case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ + *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; @@ -11109,22 +11253,21 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$ac_tmp/stdin" + rm -f "$tmp/stdin" case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -11151,7 +11294,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but + # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -11185,19 +11328,21 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. + # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || diff -Nru icedtea-web-1.3.2/configure.ac icedtea-web-1.4/configure.ac --- icedtea-web-1.3.2/configure.ac 2013-04-11 16:04:12.611202000 +0000 +++ icedtea-web-1.4/configure.ac 2013-05-03 19:08:24.132521605 +0000 @@ -1,4 +1,4 @@ -AC_INIT([icedtea-web],[1.3.2],[distro-pkg-dev@openjdk.java.net], [icedtea-web], [http://icedtea.classpath.org/wiki/IcedTea-Web]) +AC_INIT([icedtea-web],[1.4],[distro-pkg-dev@openjdk.java.net], [icedtea-web], [http://icedtea.classpath.org/wiki/IcedTea-Web]) AM_INIT_AUTOMAKE([1.9 tar-pax foreign]) AC_CONFIG_FILES([Makefile netx.manifest]) @@ -77,6 +77,7 @@ IT_CHECK_FOR_CLASS(SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK, [sun.net.www.protocol.jar.URLJarFileCallBack]) IT_CHECK_FOR_CLASS(SUN_AWT_X11_XEMBEDDEDFRAME, [sun.awt.X11.XEmbeddedFrame]) IT_CHECK_FOR_CLASS(SUN_MISC_REF, [sun.misc.Ref]) +IT_CHECK_FOR_CLASS(SUN_MISC_BASE64DECODER, [sun.misc.BASE64Decoder]) IT_CHECK_FOR_CLASS(COM_SUN_JNDI_TOOLKIT_URL_URLUTIL, [com.sun.jndi.toolkit.url.UrlUtil]) IT_CHECK_FOR_CLASS(SUN_APPLET_APPLETIMAGEREF, [sun.applet.AppletImageRef]) IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE @@ -105,6 +106,10 @@ [/usr/share/java/junit4.jar /usr/share/junit-4/lib/junit.jar]) IT_FIND_OPTIONAL_JAR([emma], EMMA, [/usr/share/java/emma.jar]) +IT_FIND_OPTIONAL_JAR([jacoco], JACOCO, + [/usr/share/java/jacoco/org.jacoco.core.jar]) +IT_FIND_OPTIONAL_JAR([asm], ASM, + [/usr/share/java/objectweb-asm4/asm-all.jar /usr/share/java/objectweb-asm4/asm-all-4.0.jar /usr/share/java/objectweb-asm/asm-all.jar]) AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript]) AC_CONFIG_FILES([build.properties]) diff -Nru icedtea-web-1.3.2/debian/changelog icedtea-web-1.4/debian/changelog --- icedtea-web-1.3.2/debian/changelog 2013-07-01 18:20:08.000000000 +0000 +++ icedtea-web-1.4/debian/changelog 2014-03-04 21:04:53.000000000 +0000 @@ -1,8 +1,63 @@ -icedtea-web (1.3.2-1ubuntu2) saucy; urgency=low +icedtea-web (1.4-3ubuntu2.1) saucy-security; urgency=medium - * debian/patches/work-with-icedtea-8004584.patch: work with OpenJDK build 25 + * SECURITY UPDATE: info disclosure via insecure temporary directory use + - debian/patches/CVE-2013-6493.patch: create safe directory in + plugin/icedteanp/IcedTeaNPPlugin.cc, added helper functions to + plugin/icedteanp/IcedTeaPluginUtils.*. + - CVE-2013-6493 + * fix ftbfs with newer xulrunner: + - debian/patches/xulrunner-27-ftbfs.patch + - debian/control*: added dh-autoreconf to Build-Depends - -- Jamie Strandboge Mon, 01 Jul 2013 13:19:18 -0500 + -- Marc Deslauriers Tue, 04 Mar 2014 15:04:16 -0500 + +icedtea-web (1.4-3ubuntu2) saucy; urgency=low + + * SECURITY UPDATE: possible arbitrary code execution via triggering event + attached to applet + - debian/patches/CVE-2013-4349.patch: don't allocate error messages on + heap in plugin/icedteanp/IcedTeaScriptablePluginObject.cc. + - CVE-2013-4349 + + -- Marc Deslauriers Tue, 24 Sep 2013 15:05:29 -0400 + +icedtea-web (1.4-3ubuntu1) saucy; urgency=low + + * Merge with Debian; remaining changes: + - Regenerate the control file. + + -- Matthias Klose Thu, 04 Jul 2013 11:58:02 +0200 + +icedtea-web (1.4-3) unstable; urgency=low + + * Update from the 1.4 branch: + - Fix PR1465, java.io.FileNotFoundException while trying to download + a JAR file. + - Fix PR1473, javaws should not depend on name of local file. + - Fix PR854, resizing an applet several times causes 100% CPU load. + Closes: #707729. + + -- Matthias Klose Thu, 04 Jul 2013 11:01:08 +0200 + +icedtea-web (1.4-2ubuntu1) saucy; urgency=low + + * Merge with Debian; remaining changes: + - Regenerate the control file. + + -- Matthias Klose Wed, 03 Jul 2013 17:50:03 +0200 + +icedtea-web (1.4-2) unstable; urgency=low + + * Fix icedtea-web for use with OpenJDK 7u25. + + -- Matthias Klose Wed, 03 Jul 2013 17:34:23 +0200 + +icedtea-web (1.4-1) unstable; urgency=low + + * IcedTea-Web 1.4 release. + * Stop building the icedtea6-plugin transitional package. + + -- Matthias Klose Thu, 09 May 2013 18:26:47 +0200 icedtea-web (1.3.2-1ubuntu1) raring; urgency=low diff -Nru icedtea-web-1.3.2/debian/control icedtea-web-1.4/debian/control --- icedtea-web-1.3.2/debian/control 2013-07-01 18:20:14.000000000 +0000 +++ icedtea-web-1.4/debian/control 2014-03-04 20:27:49.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Ubuntu Developers XSBC-Original-Maintainer: OpenJDK Team Uploaders: Matthias Klose , Damien Raude-Morvan -Build-Depends: debhelper (>= 5), firefox-dev, openjdk-7-jdk, zip, lsb-release, libgtk2.0-dev, pkg-config, default-jre-headless +Build-Depends: debhelper (>= 5), firefox-dev, openjdk-7-jdk, zip, lsb-release, libgtk2.0-dev, pkg-config, default-jre-headless, dh-autoreconf Standards-Version: 3.9.3 Homepage: http://icedtea.classpath.org/wiki/IcedTea-Web Vcs-Bzr: http://bazaar.launchpad.net/~openjdk/openjdk/icedtea-web @@ -25,17 +25,6 @@ certificate storing, system certificate store checking, and provides the services specified by the jnlp API. -Package: icedtea6-plugin -Section: web -Architecture: all -Depends: icedtea-6-plugin, ${misc:Depends} -Description: web browser plugin to execute Java applets (dependency package) - IcedTeaPlugin is a web browser plugin to execute Java applets, supporting - LiveConnect/JavaScript. It is targeted for xulrunner-1.9 and compatible - browsers that support the NPAPI. - . - This is a dependency package, it can be safely removed after upgrade. - Package: icedtea-plugin Section: web Architecture: all diff -Nru icedtea-web-1.3.2/debian/control.compat icedtea-web-1.4/debian/control.compat --- icedtea-web-1.3.2/debian/control.compat 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/debian/control.compat 2013-05-09 16:54:45.000000000 +0000 @@ -0,0 +1,11 @@ + +Package: icedtea6-plugin +Section: web +Architecture: all +Depends: icedtea-6-plugin, ${misc:Depends} +Description: web browser plugin to execute Java applets (dependency package) + IcedTeaPlugin is a web browser plugin to execute Java applets, supporting + LiveConnect/JavaScript. It is targeted for xulrunner-1.9 and compatible + browsers that support the NPAPI. + . + This is a dependency package, it can be safely removed after upgrade. diff -Nru icedtea-web-1.3.2/debian/control.in icedtea-web-1.4/debian/control.in --- icedtea-web-1.3.2/debian/control.in 2013-07-01 18:20:14.000000000 +0000 +++ icedtea-web-1.4/debian/control.in 2013-09-24 19:07:19.000000000 +0000 @@ -25,17 +25,6 @@ certificate storing, system certificate store checking, and provides the services specified by the jnlp API. -Package: icedtea6-plugin -Section: web -Architecture: all -Depends: icedtea-6-plugin, ${misc:Depends} -Description: web browser plugin to execute Java applets (dependency package) - IcedTeaPlugin is a web browser plugin to execute Java applets, supporting - LiveConnect/JavaScript. It is targeted for xulrunner-1.9 and compatible - browsers that support the NPAPI. - . - This is a dependency package, it can be safely removed after upgrade. - Package: icedtea-plugin Section: web Architecture: all diff -Nru icedtea-web-1.3.2/debian/icedtea6-plugin/DEBIAN/control icedtea-web-1.4/debian/icedtea6-plugin/DEBIAN/control --- icedtea-web-1.3.2/debian/icedtea6-plugin/DEBIAN/control 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/debian/icedtea6-plugin/DEBIAN/control 2013-05-09 16:52:09.000000000 +0000 @@ -0,0 +1,16 @@ +Package: icedtea6-plugin +Source: icedtea-web (1.4-1) +Version: 6b21.4-1 +Architecture: all +Maintainer: OpenJDK Team +Installed-Size: 8 +Depends: icedtea-6-plugin +Section: web +Priority: extra +Homepage: http://icedtea.classpath.org/wiki/IcedTea-Web +Description: web browser plugin to execute Java applets (dependency package) + IcedTeaPlugin is a web browser plugin to execute Java applets, supporting + LiveConnect/JavaScript. It is targeted for xulrunner-1.9 and compatible + browsers that support the NPAPI. + . + This is a dependency package, it can be safely removed after upgrade. diff -Nru icedtea-web-1.3.2/debian/icedtea6-plugin.substvars icedtea-web-1.4/debian/icedtea6-plugin.substvars --- icedtea-web-1.3.2/debian/icedtea6-plugin.substvars 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/debian/icedtea6-plugin.substvars 2013-05-09 16:52:09.000000000 +0000 @@ -0,0 +1 @@ +misc:Depends= diff -Nru icedtea-web-1.3.2/debian/patches/branch-updates.diff icedtea-web-1.4/debian/patches/branch-updates.diff --- icedtea-web-1.3.2/debian/patches/branch-updates.diff 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/debian/patches/branch-updates.diff 2013-07-04 10:01:35.000000000 +0000 @@ -0,0 +1,1651 @@ +Index: b/ChangeLog +=================================================================== +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,123 @@ ++2013-06-28 Adam Domurad ++ ++ * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java ++ (handleMessage): Fix potential NPE on 'GetValue' ++ ++2013-06-24 Jiri Vanek ++ ++ JNLP file is now re-downloading only if is local and have href ++ * /netx/net/sourceforge/jnlp/Launcher.java: (launch) api cleared ++ from (fromSource). (fromUrl) removed always re-downloading code and ++ replaced by conditional. (launchBackground), (toFile), (BgRunner) ++ removed. ++ * netx/net/sourceforge/jnlp/runtime/Boot.java: following new (launch) ++ * tests/reproducers/simple/GeneratedId/srcs/GeneratedId.java: just ++ arguments reprinting application ++ * tests/reproducers/simple/GeneratedId/testcases/GeneratedIdTest.java ++ various tests based on href/no href x local/remote jnlp files ++ * tests/reproducers/simple/GeneratedId/resources/GeneratedId.jnlp: base ++ simple jnlp with someId argument ++ * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: reprinting ++ the get/head correctly and with echo ++ * NEWS: mentioned PR1473 ++ ++2013-06-20 Jiri Vanek ++ ++ Made it work with OpenJDK build 25 ++ * netx/net/sourceforge/jnlp/runtime/Boot.java: (main) ++ Application context created as soon as possible ++ * plugin/icedteanp/java/sun/applet/PluginMain.java:(main) ++ Application context created as soon as possible ++ * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Do not consume ++ exception after setLookAndFeel. ++ ++2013-06-07 Adam Domurad ++ ++ Fix PR1465 ++ * NEWS: Bug fix note ++ * netx/net/sourceforge/jnlp/util/UrlUtils.java ++ (isValidRFC2396Url): New, tests if valid URL by RFC2396 rules ++ (normalizeUrl): Don't normalize if valid by RFC2396 ++ * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: ++ Adapt which URLs we expect to change when normalizing URLs ++ * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: ++ (testIsValidRFC2396Url): New, tests isValidRFC2396Url ++ (testNormalizeUrl): Add new test with valid RFC2396 URL ++ ++2013-06-06 Jiri Vanek ++ ++ Made all tests running wit junit4.10 and higher ++ * tests/junit-runner/CommandLine.java: (runMain) is no longer overriding ++ and (runMainAndExit) is now calling System.exit rather then system.exit ++ ++2013-06-06 Jiri Vanek ++ ++ Silenced deployment.properties and zero size applet exceptions with tests ++ * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: ++ (findSystemConfigFile) and (loadProperties) now prints already cough exception ++ only in debug mode ++ * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (paint) ++ now paints into 1 x 1 applet instead of 0 x 0 in case of 0 x 0 applet ++ * tests/reproducers/simple/AppletTest/resources/appletZeroH.html: new file ++ * tests/reproducers/simple/AppletTest/resources/appletZeroW.html: new file ++ * tests/reproducers/simple/AppletTest/resources/appletZeroWH.html: new file ++ - testing launchers with zero as width, height or both ++ * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: ++ added launchers and evaluations for three new htmls - (appletZeroWH) ++ (appletZeroW) (appletZeroH) ++ ++2013-06-04 Jiri Vanek ++ ++ * netx/net/sourceforge/jnlp/resources/Messages.properties: ++ more detailed hint for CCannotClearCache ++ ++2013-05-29 Adam Domurad ++ ++ * netx/net/sourceforge/jnlp/resources/Messages.properties: ++ "A serious exception occurred" -> "An exception occurred" ++ ++2013-05-21 Adam Domurad ++ ++ Reproducer for PR854. ++ * tests/reproducers/simple/ResizeApplet/resources/ResizeApplet.html: ++ Resizes applet from Javascript. ++ * tests/reproducers/simple/ResizeApplet/srcs/ResizeApplet.java: ++ Simple applet with a few helper methods. ++ * tests/reproducers/simple/ResizeApplet/testcases/ResizeAppletTests.java: ++ Test applet resizing. ++ ++2013-05-14 Adam Domurad ++ ++ Fix PR854: Resizing an applet several times causes 100% CPU load ++ * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java ++ (handleMessage): Replace buggy initialization wait. ++ ++2013-05-20 Jiri Vanek ++ ++ Fixed possible deadlock for applet->js->applet call ++ * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: ++ (REQUEST_TIMEOUT) new constant, 60s, to define timeout of applet->js call ++ (waitForRequestCompletion) new method waiting to request to be done with ++ timeout of REQUEST_TIMEOUT. ++ (javascriptToString) using the waitForRequestCompletion instead of plain ++ wait() ++ * tests/reproducers/simple/AppletJsAppletDeadlock/resources/AppletJsAppletDeadlock.html ++ and ++ * tests/reproducers/simple/AppletJsAppletDeadlock/srcs/AppletJsAppletDeadlock.java ++ reproducer ++ * tests/reproducers/simple/AppletJsAppletDeadlock/testcases/AppletJsAppletDeadlockTest.java ++ testcase ++ ++2013-05-14 Matthias Klose ++ ++ * launcher/javaws.in: Use bash as shebang. ++ ++2013-05-14 Jiri Vanek ++ Jacob Wisor ++ ++ * netx/net/sourceforge/jnlp/resources/Messages.properties: (CPJVMitwExec) ++ fixed invalid unicode character ++ + 2013-05-03 Jiri Vanek + + Reverted "Remove only occurence of LEGACY_XULRUNNERAPI" patch +Index: b/launcher/javaws.in +=================================================================== +--- a/launcher/javaws.in ++++ b/launcher/javaws.in +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + JAVA=@JAVA@ + LAUNCHER_BOOTCLASSPATH=@LAUNCHER_BOOTCLASSPATH@ +Index: b/netx/net/sourceforge/jnlp/Launcher.java +=================================================================== +--- a/netx/net/sourceforge/jnlp/Launcher.java ++++ b/netx/net/sourceforge/jnlp/Launcher.java +@@ -264,30 +264,18 @@ + return tg.getApplication(); + } + +- /** +- * Launches a JNLP file by calling the launch method for the +- * appropriate file type. +- * +- * @param location the URL of the JNLP file to launch +- * @throws LaunchException if there was an exception +- * @return the application instance +- */ +- public ApplicationInstance launch(URL location) throws LaunchException { +- return launch(toFile(location)); +- } + + /** + * Launches a JNLP file by calling the launch method for the + * appropriate file type. + * + * @param location the URL of the JNLP file to launch +- * @param fromSource if true, the JNLP file will be re-read from the source + * location to get the pristine version + * @throws LaunchException if there was an exception + * @return the application instance + */ +- public ApplicationInstance launch(URL location, boolean fromSource) throws LaunchException { +- return launch(fromUrl(location, fromSource)); ++ public ApplicationInstance launch(URL location) throws LaunchException { ++ return launch(fromUrl(location)); + } + + /** +@@ -376,28 +364,7 @@ + } + } + +- /** +- * Launches a JNLP file by calling the launch method for the +- * appropriate file type in a different thread. +- * +- * @param file the JNLP file to launch +- */ +- public void launchBackground(JNLPFile file) { +- BgRunner runner = new BgRunner(file, null); +- new Thread(runner).start(); +- } +- +- /** +- * Launches the JNLP file at the specified location in the +- * background by calling the launch method for its file type. +- * +- * @param location the location of the JNLP file +- */ +- public void launchBackground(URL location) { +- BgRunner runner = new BgRunner(null, location); +- new Thread(runner).start(); +- } +- ++ + /** + * Launches the JNLP file in a new JVM instance. The launched + * application's output is sent to the system out and it's +@@ -477,60 +444,38 @@ + /** + * Returns the JNLPFile for the URL, with error handling. + */ +- private JNLPFile fromUrl(URL location, boolean fromSource) throws LaunchException { ++ ++ private JNLPFile fromUrl(URL location) throws LaunchException { + try { + JNLPFile file = null; + + file = new JNLPFile(location, parserSettings.isStrict()); +- +- if (fromSource) { +- // Launches the jnlp file where this file originated. +- if (file.getSourceLocation() != null) { +- file = new JNLPFile(file.getSourceLocation(), parserSettings.isStrict()); +- } ++ ++ boolean isLocal = false; ++ boolean haveHref = false; ++ if ("file".equalsIgnoreCase(location.getProtocol()) && new File(location.getFile()).exists()) { ++ isLocal = true; + } +- return file; +- } catch (Exception ex) { +- if (ex instanceof LaunchException) +- throw (LaunchException) ex; // already sent to handler when first thrown +- else +- // IO and Parse +- throw launchError(new LaunchException(null, ex, R("LSFatal"), R("LCReadError"), R("LCantRead"), R("LCantReadInfo"))); +- } +- } +- +- /** +- * Returns the JNLPFile for the URL, with error handling. +- */ +- @Deprecated +- private JNLPFile toFile(URL location) throws LaunchException { +- try { +- JNLPFile file = null; +- +- try { +- file = new JNLPFile(location, (Version) null, true, updatePolicy); // strict +- } catch (ParseException ex) { +- file = new JNLPFile(location, (Version) null, false, updatePolicy); +- +- // only here if strict failed but lax did not fail +- LaunchException lex = +- launchWarning(new LaunchException(file, ex, R("LSMinor"), R("LCFileFormat"), R("LNotToSpec"), R("LNotToSpecInfo"))); +- +- if (lex != null) +- throw lex; ++ if (file.getSourceLocation() != null) { ++ haveHref = true; + } + ++ if (isLocal && haveHref) { ++ file = new JNLPFile(file.getSourceLocation(), parserSettings.isStrict()); ++ } + return file; + } catch (Exception ex) { +- if (ex instanceof LaunchException) ++ if (ex instanceof LaunchException) { + throw (LaunchException) ex; // already sent to handler when first thrown +- else ++ } else { + // IO and Parse + throw launchError(new LaunchException(null, ex, R("LSFatal"), R("LCReadError"), R("LCantRead"), R("LCantReadInfo"))); ++ } + } + } ++ + +- /** ++ /** + * Launches a JNLP application. This method should be called + * from a thread in the application's thread group. + */ +@@ -998,31 +943,6 @@ + + }; + +- /** +- * This runnable is used by the launchBackground +- * methods to launch a JNLP file from a separate thread. +- */ +- private class BgRunner implements Runnable { +- private JNLPFile file; +- private URL location; +- +- BgRunner(JNLPFile file, URL location) { +- this.file = file; +- this.location = location; +- } +- +- public void run() { +- try { +- if (file != null) +- launch(file); +- if (location != null) +- launch(location); +- } catch (LaunchException ex) { +- // launch method communicates error conditions to the +- // handler if it exists, otherwise we don't care because +- // there's nothing that can be done about the exception. +- } +- } +- }; ++ + + } +Index: b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java +=================================================================== +--- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java ++++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java +@@ -427,7 +427,9 @@ + jrePath = jreSetting.getValue(); + } + } catch (Exception ex) { +- ex.printStackTrace(); ++ if (JNLPRuntime.isDebug()){ ++ ex.printStackTrace(); ++ } + } + + File jreFile; +@@ -530,6 +532,9 @@ + try { + return parsePropertiesFile(file); + } catch (IOException e) { ++ if (JNLPRuntime.isDebug()){ ++ e.printStackTrace(); ++ } + return null; + } + } +Index: b/netx/net/sourceforge/jnlp/resources/Messages.properties +=================================================================== +--- a/netx/net/sourceforge/jnlp/resources/Messages.properties ++++ b/netx/net/sourceforge/jnlp/resources/Messages.properties +@@ -202,7 +202,7 @@ + CChooseCache=Choose a cache directory... + CChooseCacheInfo=NetX needs a location for storing cache files. + CChooseCacheDir=Cache directory +-CCannotClearCache=Can not clear cache at this time ++CCannotClearCache=Can not clear the cache at this time. Try later. If the problem persists, try closing your browser(s) & JNLP applications. At the end you can try to kill all java applications. + CFakeCache=Cache is corrupt. Fixing. + CFakedCache=Cache was corrupt and has been fixed. It is strongly recommended that you run 'javaws -Xclearcache' and rerun your application as soon as possible. + +@@ -313,7 +313,7 @@ + CPDebuggingDescription=Enable options here to help with debugging + CPDesktopIntegrationDescription=Set whether or not to allow creation of desktop shortcut. + CPJVMPluginArguments=Set JVM arguments for plugin. +-CPJVMitwExec=Set JVM for IcedTea-Web — working best with OpenJDK ++CPJVMitwExec=Set JVM for IcedTea-Web \u2014 working best with OpenJDK + CPJVMitwExecValidation=Validate JVM for IcedTea-Web + CPJVMPluginSelectExec=Browse for JVM for IcedTea-Web + CPJVMnone=No validation result for +@@ -484,7 +484,7 @@ + CLHelpDescription=The itweb-settings tool allows a user to modify, view and check configuration.\nTo use the GUI, do not pass any arguments. To use the CLI mode, pass in the approrpiate command and parameters. For help with a particular command, try: {0} command help + + # splash screen related +-SPLASHerror = Click here for details. Serious exception occurred. ++SPLASHerror = Click here for details. An exception has occurred. + SPLASH_ERROR = ERROR + SPLASHtitle = Title + SPLASHvendor = Vendor +@@ -492,7 +492,7 @@ + SPLASHdescription = Description + SPLASHClose= Close + SPLASHclosewAndCopyException = Close and copy the stack trace to clipboard +-SPLASHexOccured = A serious exception has occurred... ++SPLASHexOccured = An exception has occurred... + SPLASHHome = Home + SPLASHcantCopyEx = Can not copy exception + SPLASHnoExRecorded = No exception recorded +Index: b/netx/net/sourceforge/jnlp/runtime/Boot.java +=================================================================== +--- a/netx/net/sourceforge/jnlp/runtime/Boot.java ++++ b/netx/net/sourceforge/jnlp/runtime/Boot.java +@@ -35,6 +35,8 @@ + import net.sourceforge.jnlp.cache.UpdatePolicy; + import net.sourceforge.jnlp.security.viewer.CertificateViewer; + import net.sourceforge.jnlp.services.ServiceUtil; ++import sun.awt.AppContext; ++import sun.awt.SunToolkit; + + /** + * This is the main entry point for the JNLP client. The main +@@ -113,6 +115,9 @@ + * Launch the JNLP file specified by the command-line arguments. + */ + public static void main(String[] argsIn) { ++ if (AppContext.getAppContext() == null) { ++ SunToolkit.createNewAppContext(); ++ } + args = argsIn; + + if (null != getOption("-viewer")) { +@@ -203,7 +208,7 @@ + Launcher launcher = new Launcher(false); + launcher.setParserSettings(settings); + launcher.setInformationToMerge(extra); +- launcher.launch(getFileLocation(), true); ++ launcher.launch(getFileLocation()); + } catch (LaunchException ex) { + // default handler prints this + } catch (Exception ex) { +Index: b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java +=================================================================== +--- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java ++++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java +@@ -234,7 +234,7 @@ + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception e) { +- // ignore it ++ e.printStackTrace(); + } + + doMainAppContextHacks(); +Index: b/netx/net/sourceforge/jnlp/util/UrlUtils.java +=================================================================== +--- a/netx/net/sourceforge/jnlp/util/UrlUtils.java ++++ b/netx/net/sourceforge/jnlp/util/UrlUtils.java +@@ -86,16 +86,29 @@ + } + } + ++ /* Use the URI syntax check of 'toURI' to see if it matches RFC2396. ++ * See http://www.ietf.org/rfc/rfc2396.txt */ ++ public static boolean isValidRFC2396Url(URL url) { ++ try { ++ url.toURI(); ++ return true; ++ } catch (URISyntaxException e) { ++ return false; ++ } ++ } ++ + /* Ensure a URL is properly percent-encoded. + * Certain usages require local-file URLs to be encoded, eg for code-base & document-base. */ + public static URL normalizeUrl(URL url, boolean encodeFileUrls) throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { + if (url == null) { + return null; + } ++ + String protocol = url.getProtocol(); + boolean shouldEncode = (encodeFileUrls || !"file".equals(protocol)); + +- if (protocol == null || !shouldEncode || url.getPath() == null) { ++ // PR1465: We should not call 'URLDecoder.decode' on RFC2396-compliant URLs ++ if (protocol == null || !shouldEncode || url.getPath() == null || isValidRFC2396Url(url)) { + return url; + } + +Index: b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java +=================================================================== +--- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java ++++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java +@@ -522,8 +522,9 @@ + Integer index = parseCall(args[1], null, Integer.class); + + Object ret = store.getObject(index); ++ Class retClass = ret != null ? ret.getClass() : null; + +- String objIDStr = toObjectIDString(ret, ret.getClass(), true /*unbox primitives*/); ++ String objIDStr = toObjectIDString(ret, retClass, true /*unbox primitives*/); + write(reference, "GetValue " + objIDStr); + } else if (message.startsWith("SetStaticField") || + message.startsWith("SetField")) { +Index: b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java +=================================================================== +--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java ++++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java +@@ -181,7 +181,23 @@ + + + private SplashPanel splashPanel; +- ++ ++ private static long REQUEST_TIMEOUT=60000;//60s ++ ++ private static void waitForRequestCompletion(PluginCallRequest request) { ++ try { ++ if (!request.isDone()) { ++ request.wait(REQUEST_TIMEOUT); ++ } ++ if (!request.isDone()) { ++ // Do not wait indefinitely to avoid the potential of deadlock ++ throw new RuntimeException("Possible deadlock, releasing"); ++ } ++ } catch (InterruptedException ex) { ++ throw new RuntimeException("Interrupted waiting for call request.", ex); ++ } ++ } ++ + /** + * Null constructor to allow instantiation via newInstance() + */ +@@ -665,18 +681,7 @@ + if (message.startsWith("width")) { + + // Wait for panel to come alive +- long maxTimeToSleep = APPLET_TIMEOUT; +- statusLock.lock(); +- try { +- while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && +- maxTimeToSleep > 0) { +- maxTimeToSleep -= waitTillTimeout(statusLock, initComplete, +- maxTimeToSleep); +- } +- } +- finally { +- statusLock.unlock(); +- } ++ waitForAppletInit(panel); + + // 0 => width, 1=> width_value, 2 => height, 3=> height_value + String[] dimMsg = message.split(" "); +@@ -1301,18 +1306,13 @@ + + streamhandler.postCallRequest(request); + streamhandler.write(request.getMessage()); +- try { +- PluginDebug.debug("wait ToString request 1"); +- synchronized (request) { +- PluginDebug.debug("wait ToString request 2"); +- while (request.isDone() == false) +- request.wait(); +- PluginDebug.debug("wait ToString request 3"); +- } +- } catch (InterruptedException e) { +- throw new RuntimeException("Interrupted waiting for call request.", +- e); ++ PluginDebug.debug("wait ToString request 1"); ++ synchronized (request) { ++ PluginDebug.debug("wait ToString request 2"); ++ waitForRequestCompletion(request); ++ PluginDebug.debug("wait ToString request 3"); + } ++ + PluginDebug.debug(" ToString DONE"); + return (String) request.getObject(); + } +@@ -1538,7 +1538,9 @@ + + // If the image or the graphics don't exist, create new ones + if (bufFrameImg == null || bufFrameImgGraphics == null) { +- bufFrameImg = createImage(getWidth(), getHeight()); ++ // although invisible applets do not have right to paint ++ // we rather paint to 1x1 to be sure all callbacks will be completed ++ bufFrameImg = createImage(Math.max(1, getWidth()), Math.max(1, getHeight())); + bufFrameImgGraphics = bufFrameImg.getGraphics(); + } + +Index: b/plugin/icedteanp/java/sun/applet/PluginMain.java +=================================================================== +--- a/plugin/icedteanp/java/sun/applet/PluginMain.java ++++ b/plugin/icedteanp/java/sun/applet/PluginMain.java +@@ -72,6 +72,8 @@ + import java.net.ProxySelector; + import java.util.Enumeration; + import java.util.Properties; ++import sun.awt.AppContext; ++import sun.awt.SunToolkit; + + import net.sourceforge.jnlp.config.DeploymentConfiguration; + import net.sourceforge.jnlp.runtime.JNLPRuntime; +@@ -94,6 +96,9 @@ + */ + public static void main(String args[]) + throws IOException { ++ if (AppContext.getAppContext() == null) { ++ SunToolkit.createNewAppContext(); ++ } + if (args.length != 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) { + System.err.println("Invalid pipe names provided. Refusing to proceed."); + System.exit(1); +Index: b/tests/junit-runner/CommandLine.java +=================================================================== +--- a/tests/junit-runner/CommandLine.java ++++ b/tests/junit-runner/CommandLine.java +@@ -26,10 +26,9 @@ + + public static void runMainAndExit(JUnitSystem system, String... args) { + new CommandLine().runMain(system, args); +- system.exit(0); ++ System.exit(0); + } + +- @Override + public Result runMain(JUnitSystem system, String... args) { + List> classes = new ArrayList>(); + List missingClasses = new ArrayList(); +Index: b/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java +=================================================================== +--- a/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java ++++ b/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java +@@ -80,7 +80,7 @@ + Assert.assertFalse("url " + i + " must be normalized (and so not equals) too normalized url " + i, u[i].equals(n[i])); + } + } +- public static final int CHANGE_BORDER = 6; ++ public static final int CHANGE_BORDER = 8; + + public static URL[] getUrls() throws MalformedURLException { + URL[] u = { +@@ -91,9 +91,9 @@ + new URL("http:///SpacesCanBeEverywhere1.jnlp"), + new URL("file://localhost/home/jvanek/Desktop/icedtea-web/tests.build/jnlp_test_server/Spaces can be everywhere2.jnlp"), + new URL("http://localhost:44321/testpage.jnlp?applicationID=25"), +- /*changing*/ + new URL("http://localhost:44321/Spaces%20Can%20Be%20Everyw%2Fhere1.jnlp"), + new URL("http://localhost/Spaces+Can+Be+Everywhere1.jnlp"), ++ /*changing*/ + new URL("http://localhost/SpacesC anBeEverywhere1.jnlp?a=5&b=10#df"), + new URL("http:///oook.jnlp?a=5&b=ahoj šš dd#df"), + new URL("http://localhost/Spacesěčšžšřýžčřú can !@^*(){}[].jnlp?a=5&ahoj šš dd#df"), +Index: b/tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java +=================================================================== +--- a/tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java ++++ b/tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java +@@ -39,8 +39,11 @@ + + import static org.junit.Assert.assertEquals; + import static org.junit.Assert.assertFalse; ++import static org.junit.Assert.assertTrue; + + import java.io.File; ++import java.net.MalformedURLException; ++import java.net.URISyntaxException; + import java.net.URL; + + import org.junit.Test; +@@ -95,6 +98,27 @@ + // Test file URL with file URL encoding turned on + assertEquals("file://example/%20test", + UrlUtils.normalizeUrl(new URL("file://example/ test"), true).toString()); ++ ++ // PR1465: Test that RFC2396-compliant URLs are not touched ++ // Example taken from bug report: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1465 ++ String rfc2396Valid = "https://example.com/,DSID=64c19c5b657df383835706571a7c7216,DanaInfo=example.com,CT=java+JICAComponents/JICA-sicaN.jar"; ++ assertEquals(rfc2396Valid, ++ UrlUtils.normalizeUrl(new URL(rfc2396Valid)).toString()); ++ } ++ ++ @Test ++ public void testIsValidRFC2396Url() throws Exception { ++ String rfc2396Valid = "https://example.com/,foo=bar+baz/JICA-sicaN.jar"; ++ assertTrue(UrlUtils.isValidRFC2396Url(new URL(rfc2396Valid))); ++ ++ // These should invalidate the URL ++ // See http://www.ietf.org/rfc/rfc2396.txt (2.4.3. Excluded US-ASCII Characters) ++ char[] invalidCharacters = {'<', '>', '%', '"', }; ++ for (char chr : invalidCharacters) { ++ assertFalse("validation failed with '" + chr + "'",UrlUtils.isValidRFC2396Url(new URL(rfc2396Valid + chr))); ++ } ++ //special test for space inisde. Space at the end can be trimmed ++ assertFalse("validation failed with '" + ' ' + "'",UrlUtils.isValidRFC2396Url(new URL("https://example.com/,foo=bar+ba z/JICA-sicaN.jar"))); + } + + @Test +@@ -116,4 +140,4 @@ + assertEquals(testFile, UrlUtils.decodeUrlAsFile(encodedUrl)); + } + } +-} +\ No newline at end of file ++} +Index: b/tests/reproducers/simple/AppletJsAppletDeadlock/resources/AppletJsAppletDeadlock.html +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/AppletJsAppletDeadlock/resources/AppletJsAppletDeadlock.html +@@ -0,0 +1,55 @@ ++ ++ ++

++

++ +Index: b/tests/reproducers/simple/AppletJsAppletDeadlock/srcs/AppletJsAppletDeadlock.java +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/AppletJsAppletDeadlock/srcs/AppletJsAppletDeadlock.java +@@ -0,0 +1,89 @@ ++/* ++ Copyright (C) 2012 Red Hat, Inc. ++ ++ This file is part of IcedTea. ++ ++ IcedTea is free software; you can redistribute it and/or ++ modify it under the terms of the GNU General Public License as published by ++ the Free Software Foundation, version 2. ++ ++ IcedTea 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 for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with IcedTea; see the file COPYING. If not, write to ++ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA. ++ ++ Linking this library statically or dynamically with other modules is ++ making a combined work based on this library. Thus, the terms and ++ conditions of the GNU General Public License cover the whole ++ combination. ++ ++ As a special exception, the copyright holders of this library give you ++ permission to link this library with independent modules to produce an ++ executable, regardless of the license terms of these independent ++ modules, and to copy and distribute the resulting executable under ++ terms of your choice, provided that you also meet, for each linked ++ independent module, the terms and conditions of the license of that ++ module. An independent module is a module which is not derived from ++ or based on this library. If you modify this library, you may extend ++ this exception to your version of the library, but you are not ++ obligated to do so. If you do not wish to do so, delete this ++ exception statement from your version. ++ */ ++ ++import java.awt.TextArea; ++import java.io.BufferedReader; ++import java.io.InputStreamReader; ++import java.net.URL; ++import java.net.URLConnection; ++import netscape.javascript.JSObject; ++ ++public class AppletJsAppletDeadlock extends java.applet.Applet { ++ ++ private TextArea outputText = null; ++ ++ public void printOutput(String msg) { ++ System.out.println(msg); ++ outputText.setText(outputText.getText() + msg + "\n"); ++ } ++ ++ public void jsCallback(String location) { ++ printOutput("Callback function called"); ++ ++ // try requesting the page ++ try { ++ URL url = new URL(location); ++ URLConnection con = url.openConnection(); ++ BufferedReader br = new BufferedReader(new InputStreamReader( ++ con.getInputStream())); ++ ++ String line; ++ while ((line = br.readLine()) != null) { ++ System.err.println(line); ++ } ++ ++ printOutput("Succesfully connected to " + location); ++ } catch (Exception e) { ++ printOutput("Failed to connect to '" + location + "': " + e.getMessage()); ++ } ++ ++ } ++ ++ @Override ++ public void start() { ++// public void init() { ++ outputText = new TextArea("", 12, 95); ++ this.add(outputText); ++ ++ printOutput("AppletJsAppletDeadlock started"); ++ ++ JSObject win = JSObject.getWindow(this); ++ win.eval("callApplet();"); ++ ++ printOutput("JS call finished"); ++ } ++} +Index: b/tests/reproducers/simple/AppletJsAppletDeadlock/testcases/AppletJsAppletDeadlockTest.java +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/AppletJsAppletDeadlock/testcases/AppletJsAppletDeadlockTest.java +@@ -0,0 +1,95 @@ ++/* ++ Copyright (C) 2012 Red Hat, Inc. ++ ++ This file is part of IcedTea. ++ ++ IcedTea is free software; you can redistribute it and/or ++ modify it under the terms of the GNU General Public License as published by ++ the Free Software Foundation, version 2. ++ ++ IcedTea 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 for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with IcedTea; see the file COPYING. If not, write to ++ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA. ++ ++ Linking this library statically or dynamically with other modules is ++ making a combined work based on this library. Thus, the terms and ++ conditions of the GNU General Public License cover the whole ++ combination. ++ ++ As a special exception, the copyright holders of this library give you ++ permission to link this library with independent modules to produce an ++ executable, regardless of the license terms of these independent ++ modules, and to copy and distribute the resulting executable under ++ terms of your choice, provided that you also meet, for each linked ++ independent module, the terms and conditions of the license of that ++ module. An independent module is a module which is not derived from ++ or based on this library. If you modify this library, you may extend ++ this exception to your version of the library, but you are not ++ obligated to do so. If you do not wish to do so, delete this ++ exception statement from your version. ++ */ ++ ++import net.sourceforge.jnlp.ProcessResult; ++import net.sourceforge.jnlp.ServerAccess; ++import net.sourceforge.jnlp.annotations.KnownToFail; ++import net.sourceforge.jnlp.annotations.NeedsDisplay; ++import net.sourceforge.jnlp.annotations.TestInBrowsers; ++import net.sourceforge.jnlp.browsertesting.BrowserTest; ++import net.sourceforge.jnlp.browsertesting.Browsers; ++import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; ++import org.junit.AfterClass; ++import org.junit.Assert; ++import org.junit.BeforeClass; ++import org.junit.Test; ++ ++public class AppletJsAppletDeadlockTest extends BrowserTest { ++ ++ private static final String called = "Callback function called"; ++ private static final String started = "AppletJsAppletDeadlock started"; ++ private static final String finished = "JS call finished"; ++ private static final RulesFolowingClosingListener.ContainsRule calledRule = new RulesFolowingClosingListener.ContainsRule(called); ++ private static final RulesFolowingClosingListener.ContainsRule startedRule = new RulesFolowingClosingListener.ContainsRule(started); ++ private static final RulesFolowingClosingListener.ContainsRule finishedRule = new RulesFolowingClosingListener.ContainsRule(finished); ++ private static final long defaultTimeout = ServerAccess.PROCESS_TIMEOUT; ++ ++ @BeforeClass ++ public static void setTimeout() { ++ //the timeout is js call is 60s ++ //see sun.applet.PluginAppletViewer.REQUEST_TIMEOUT ++ //so wee need to have little longer timooute here ++ ServerAccess.PROCESS_TIMEOUT = 120000;//120 s ++ } ++ ++ @AfterClass ++ public static void resetTimeout() { ++ ServerAccess.PROCESS_TIMEOUT = defaultTimeout; ++ } ++ ++ @Test ++ @NeedsDisplay ++ @TestInBrowsers(testIn = Browsers.one) ++ public void callAppletJsAppletNotDeadlock() throws Exception { ++ ProcessResult processResult = server.executeBrowser("AppletJsAppletDeadlock.html", new RulesFolowingClosingListener(finishedRule), null); ++ Assert.assertTrue(startedRule.toPassingString(), startedRule.evaluate(processResult.stdout)); ++ Assert.assertTrue(finishedRule.toPassingString(), finishedRule.evaluate(processResult.stdout)); ++ //this is representing another error, not sure now it is worthy to be fixed ++ //Assert.assertTrue(calledRule.toPassingString(), calledRule.evaluate(processResult.stdout)); ++ } ++ ++ @Test ++ @NeedsDisplay ++ @TestInBrowsers(testIn = Browsers.one) ++ @KnownToFail ++ public void callAppletJsAppletSuccessfullyEvaluated() throws Exception { ++ ProcessResult processResult = server.executeBrowser("AppletJsAppletDeadlock.html", new RulesFolowingClosingListener(finishedRule), null); ++ Assert.assertTrue(startedRule.toPassingString(), startedRule.evaluate(processResult.stdout)); ++ Assert.assertTrue(finishedRule.toPassingString(), finishedRule.evaluate(processResult.stdout)); ++ Assert.assertTrue(calledRule.toPassingString(), calledRule.evaluate(processResult.stdout)); ++ } ++} +Index: b/tests/reproducers/simple/AppletTest/resources/appletZeroH.html +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/AppletTest/resources/appletZeroH.html +@@ -0,0 +1,44 @@ ++ ++ ++

++ ++ ++

++ ++ +Index: b/tests/reproducers/simple/AppletTest/resources/appletZeroW.html +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/AppletTest/resources/appletZeroW.html +@@ -0,0 +1,44 @@ ++ ++ ++

++ ++ ++

++ ++ +Index: b/tests/reproducers/simple/AppletTest/resources/appletZeroWH.html +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/AppletTest/resources/appletZeroWH.html +@@ -0,0 +1,44 @@ ++ ++ ++

++ ++ ++

++ ++ +Index: b/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java +=================================================================== +--- a/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java ++++ b/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java +@@ -1,4 +1,4 @@ +-/* AppletTestTests.java ++/* + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. +@@ -154,4 +154,29 @@ + ServerAccess.PROCESS_TIMEOUT = 20 * 1000; //back to normal + } + } ++ ++ ++ @Test ++ @TestInBrowsers(testIn = {Browsers.one}) ++ @NeedsDisplay ++ public void appletZeroWH() throws Exception { ++ ProcessResult pr = server.executeBrowser("/appletZeroWH.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); ++ evaluateApplet(pr, false); ++ } ++ ++ @Test ++ @TestInBrowsers(testIn = {Browsers.one}) ++ @NeedsDisplay ++ public void appletZeroW() throws Exception { ++ ProcessResult pr = server.executeBrowser("/appletZeroW.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); ++ evaluateApplet(pr, false); ++ } ++ ++ @Test ++ @TestInBrowsers(testIn = {Browsers.one}) ++ @NeedsDisplay ++ public void appletZeroH() throws Exception { ++ ProcessResult pr = server.executeBrowser("/appletZeroH.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); ++ evaluateApplet(pr, false); ++ } + } +Index: b/tests/reproducers/simple/GeneratedId/resources/GeneratedId.jnlp +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/GeneratedId/resources/GeneratedId.jnlp +@@ -0,0 +1,51 @@ ++ ++ ++ ++ ++ ++ ++ Test Generated Id ++ IcedTea ++ ++ ++ ++ ++ ++ SomeId ++ ++ +Index: b/tests/reproducers/simple/GeneratedId/srcs/GeneratedId.java +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/GeneratedId/srcs/GeneratedId.java +@@ -0,0 +1,44 @@ ++/* Copyright (C) 2012 Red Hat, Inc. ++ ++This file is part of IcedTea. ++ ++IcedTea is free software; you can redistribute it and/or ++modify it under the terms of the GNU General Public License as published by ++the Free Software Foundation, version 2. ++ ++IcedTea 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 for more details. ++ ++You should have received a copy of the GNU General Public License ++along with IcedTea; see the file COPYING. If not, write to ++the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++02110-1301 USA. ++ ++Linking this library statically or dynamically with other modules is ++making a combined work based on this library. Thus, the terms and ++conditions of the GNU General Public License cover the whole ++combination. ++ ++As a special exception, the copyright holders of this library give you ++permission to link this library with independent modules to produce an ++executable, regardless of the license terms of these independent ++modules, and to copy and distribute the resulting executable under ++terms of your choice, provided that you also meet, for each linked ++independent module, the terms and conditions of the license of that ++module. An independent module is a module which is not derived from ++or based on this library. If you modify this library, you may extend ++this exception to your version of the library, but you are not ++obligated to do so. If you do not wish to do so, delete this ++exception statement from your version. ++ */ ++ ++ ++public class GeneratedId { ++ static public void main(String[] args) { ++ for(int x = 0; x l = new ArrayList(3); ++ l.add(server.getJavawsLocation()); ++ l.add(ServerAccess.HEADLES_OPTION); ++ l.add(dest.getAbsolutePath()); ++ ProcessResult pr = ServerAccess.executeProcess(l); ++ Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); ++ } ++ ++ @Test ++ //do not have href ++ //is local ++ //should NOT be redownloaded ++ public void launchLocalChangedFileWithNoHref() throws Exception { ++ File dest = prepareChangedFileNoHref(); ++ List l = new ArrayList(3); ++ l.add(server.getJavawsLocation()); ++ l.add(ServerAccess.HEADLES_OPTION); ++ l.add(dest.getAbsolutePath()); ++ ProcessResult pr = ServerAccess.executeProcess(l); ++ Assert.assertTrue("Stdout should contain '" + okBase2 + "', but did not.", pr.stdout.contains(okBase2)); ++ } ++ ++ @Test ++ //do have href ++ //is local ++ //should be redownloaded (how to verify!?!) ++ public void launchLocalFileWithHref() throws Exception { ++ File dest = new File(server.getDir(), baseName1); ++ List l = new ArrayList(3); ++ l.add(server.getJavawsLocation()); ++ l.add(ServerAccess.HEADLES_OPTION); ++ l.add(dest.getAbsolutePath()); ++ ProcessResult pr = ServerAccess.executeProcess(l); ++ Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); ++ } ++ ++ @Test ++ //do not have href ++ //is local ++ //should NOT be redownloaded (how to verify!?!) ++ public void launchLocalFileNoHref() throws Exception { ++ File dest = prepareCopiedFileNoHref(); ++ List l = new ArrayList(3); ++ l.add(server.getJavawsLocation()); ++ l.add(ServerAccess.HEADLES_OPTION); ++ l.add(dest.getAbsolutePath()); ++ ProcessResult pr = ServerAccess.executeProcess(l); ++ Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); ++ } ++ ++ @Test ++ //remote ++ //have href ++ //should not be redownloaded (how to verify!?!) ++ //href is same file ++ public void launchRemoteFileWithHref() throws Exception { ++ ProcessResult pr = server.executeJavawsHeadless("/" + baseName1); ++ Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); ++ } ++ ++ //remote ++ //have href ++ //should NOT be redownloaded ++ //href is different file ++ @Test ++ public void launchRemoteChangedFileWithHref() throws Exception { ++ File f = prepareChangedFileWithHref(); ++ ProcessResult pr = server.executeJavawsHeadless("/" + f.getName()); ++ Assert.assertTrue("Stdout should contain '" + okBase2 + "', but did not.", pr.stdout.contains(okBase2)); ++ } ++ ++ @Test ++ //remote ++ //have not href ++ //should not be redownloaded (how to verify!?!) ++ public void launchRemoteFileWithNoHref() throws Exception { ++ File f = prepareCopiedFileNoHref(); ++ ProcessResult pr = server.executeJavawsHeadless("/" + f.getName()); ++ Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); ++ } ++ ++ //remote ++ //have not href ++ //should NOT be redownloaded ++ @Test ++ public void launchRemoteChangedFileWithNoHref() throws Exception { ++ File f = prepareChangedFileNoHref(); ++ ProcessResult pr = server.executeJavawsHeadless("/" + f.getName()); ++ Assert.assertTrue("Stdout should contain '" + okBase2 + "', but did not.", pr.stdout.contains(okBase2)); ++ } ++} +Index: b/tests/reproducers/simple/ResizeApplet/resources/ResizeApplet.html +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/ResizeApplet/resources/ResizeApplet.html +@@ -0,0 +1,57 @@ ++ ++ ++

++

++ ++ ++ ++ ++ +Index: b/tests/reproducers/simple/ResizeApplet/srcs/ResizeApplet.java +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/ResizeApplet/srcs/ResizeApplet.java +@@ -0,0 +1,72 @@ ++ ++import java.applet.Applet; ++ ++/* AppletTest.java ++Copyright (C) 2011 Red Hat, Inc. ++ ++This file is part of IcedTea. ++ ++IcedTea is free software; you can redistribute it and/or ++modify it under the terms of the GNU General Public License as published by ++the Free Software Foundation, version 2. ++ ++IcedTea 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 for more details. ++ ++You should have received a copy of the GNU General Public License ++along with IcedTea; see the file COPYING. If not, write to ++the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++02110-1301 USA. ++ ++Linking this library statically or dynamically with other modules is ++making a combined work based on this library. Thus, the terms and ++conditions of the GNU General Public License cover the whole ++combination. ++ ++As a special exception, the copyright holders of this library give you ++permission to link this library with independent modules to produce an ++executable, regardless of the license terms of these independent ++modules, and to copy and distribute the resulting executable under ++terms of your choice, provided that you also meet, for each linked ++independent module, the terms and conditions of the license of that ++module. An independent module is a module which is not derived from ++or based on this library. If you modify this library, you may extend ++this exception to your version of the library, but you are not ++obligated to do so. If you do not wish to do so, delete this ++exception statement from your version. ++ */ ++public class ResizeApplet extends Applet { ++ ++ /* Make sures the process is exited if we stall */ ++ private static class StallTimeoutThread extends Thread { ++ private static final int MILLISECONDS_TO_SLEEP = 5000; ++ @Override ++ public void run() { ++ try { ++ Thread.sleep(MILLISECONDS_TO_SLEEP); ++ System.out.println("*** APPLET FINISHED ***"); ++ } catch (InterruptedException ie) { ++ } ++ } ++ } ++ ++ @Override ++ public void init() { ++ new StallTimeoutThread().start(); ++ } ++ ++ /* Utility for Javascript-side */ ++ public void print(String str) { ++ System.out.println(str); ++ } ++ ++ /* Utility for Javascript-side */ ++ public synchronized void sleep(int time) { ++ try { ++ wait(time); ++ } catch (InterruptedException e) { ++ } ++ } ++} +Index: b/tests/reproducers/simple/ResizeApplet/testcases/ResizeAppletTests.java +=================================================================== +--- /dev/null ++++ b/tests/reproducers/simple/ResizeApplet/testcases/ResizeAppletTests.java +@@ -0,0 +1,65 @@ ++/* AppletTestTests.java ++Copyright (C) 2011 Red Hat, Inc. ++ ++This file is part of IcedTea. ++ ++IcedTea is free software; you can redistribute it and/or ++modify it under the terms of the GNU General Public License as published by ++the Free Software Foundation, version 2. ++ ++IcedTea 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 for more details. ++ ++You should have received a copy of the GNU General Public License ++along with IcedTea; see the file COPYING. If not, write to ++the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++02110-1301 USA. ++ ++Linking this library statically or dynamically with other modules is ++making a combined work based on this library. Thus, the terms and ++conditions of the GNU General Public License cover the whole ++combination. ++ ++As a special exception, the copyright holders of this library give you ++permission to link this library with independent modules to produce an ++executable, regardless of the license terms of these independent ++modules, and to copy and distribute the resulting executable under ++terms of your choice, provided that you also meet, for each linked ++independent module, the terms and conditions of the license of that ++module. An independent module is a module which is not derived from ++or based on this library. If you modify this library, you may extend ++this exception to your version of the library, but you are not ++obligated to do so. If you do not wish to do so, delete this ++exception statement from your version. ++ */ ++ ++import static org.junit.Assert.assertTrue; ++ ++import net.sourceforge.jnlp.ProcessResult; ++import net.sourceforge.jnlp.ServerAccess.AutoClose; ++import net.sourceforge.jnlp.browsertesting.BrowserTest; ++import net.sourceforge.jnlp.browsertesting.Browsers; ++import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; ++import net.sourceforge.jnlp.annotations.NeedsDisplay; ++import net.sourceforge.jnlp.annotations.TestInBrowsers; ++ ++import org.junit.Test; ++ ++public class ResizeAppletTests extends BrowserTest { ++ ++ void assertContains(String source, String message, String substring) { ++ assertTrue(source + " should contain '" + substring + "' but did not!", ++ message.contains(substring)); ++ } ++ ++ @Test ++ @TestInBrowsers(testIn = { Browsers.all }) ++ @NeedsDisplay ++ public void testResizing() throws Exception { ++ ProcessResult pr = server.executeBrowser("/ResizeApplet.html", AutoClose.CLOSE_ON_CORRECT_END); ++ assertContains("stdout", pr.stdout, AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING); ++ assertContains("stdout", pr.stdout, "Resizing to 500 by 500"); ++ } ++} +Index: b/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java +=================================================================== +--- a/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java ++++ b/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java +@@ -114,8 +114,15 @@ + o.writeBytes("HTTP/1.0 "+HttpURLConnection.HTTP_NOT_IMPLEMENTED+" Not Implemented\n"); + continue; + } +- ++ ++ String request = "unknown"; + if (isGetRequest || isHeadRequest ) { ++ if (isGetRequest){ ++ request = "GET"; ++ } ++ if (isHeadRequest){ ++ request = "HEAD"; ++ } + StringTokenizer t = new StringTokenizer(s, " "); + t.nextToken(); + String op = t.nextToken(); +@@ -123,11 +130,11 @@ + if (p.startsWith(XSX)) { + p = p.replace(XSX, "/"); + } +- ServerAccess.logNoReprint("Getting: " + p); ++ ServerAccess.logOutputReprint("Getting- " + request + ": " + p); + p = URLDecoder.decode(p, "UTF-8"); + p = p.replaceAll("\\?.*", ""); + p = (".".concat((p.endsWith("/")) ? p.concat("index.html") : p)).replace('/', File.separatorChar); +- ServerAccess.logNoReprint("Serving: " + p); ++ ServerAccess.logOutputReprint("Serving- " + request + ": " + p); + File pp = new File(dir, p); + int l = (int) pp.length(); + byte[] b = new byte[l]; diff -Nru icedtea-web-1.3.2/debian/patches/CVE-2013-4349.patch icedtea-web-1.4/debian/patches/CVE-2013-4349.patch --- icedtea-web-1.3.2/debian/patches/CVE-2013-4349.patch 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/debian/patches/CVE-2013-4349.patch 2013-09-24 19:05:20.000000000 +0000 @@ -0,0 +1,51 @@ + +# HG changeset patch +# User Jiri Vanek +# Date 1379319013 -7200 +# Node ID 82e007d8b05ab352086216cec4cac9a896af5635 +# Parent 508f65fc113550e8314f97a04d88569de5418c40 +CVE-2012-4540, RH869040: Heap-based buffer overflow after triggering event attached to applet + +diff -r 508f65fc1135 -r 82e007d8b05a plugin/icedteanp/IcedTeaScriptablePluginObject.cc +--- a/plugin/icedteanp/IcedTeaScriptablePluginObject.cc Wed Sep 11 00:00:00 2013 +0200 ++++ b/plugin/icedteanp/IcedTeaScriptablePluginObject.cc Mon Sep 16 10:10:13 2013 +0200 +@@ -591,10 +591,7 @@ + + if (java_result->error_occurred) + { +- // error message must be allocated on heap +- char* error_msg = (char*) malloc(java_result->error_msg->length()*sizeof(char)); +- strcpy(error_msg, java_result->error_msg->c_str()); +- browser_functions.setexception(npobj, error_msg); ++ browser_functions.setexception(npobj, java_result->error_msg->c_str()); + return false; + } + +@@ -853,11 +850,7 @@ + createJavaObjectFromVariant(instance, args[i], &id); + if (id == "0") + { +- // error message must be allocated on heap +- char* error_msg = (char*) malloc(1024*sizeof(char)); +- strcpy(error_msg, "Unable to create argument on Java side"); +- +- browser_functions.setexception(npobj, error_msg); ++ browser_functions.setexception(npobj, "Unable to create argument on Java side"); + return false; + } + +@@ -871,12 +864,7 @@ + + if (java_result->error_occurred) + { +- // error message must be allocated on heap +- int length = java_result->error_msg->length(); +- char* error_msg = (char*) malloc((length+1)*sizeof(char)); +- strcpy(error_msg, java_result->error_msg->c_str()); +- +- browser_functions.setexception(npobj, error_msg); ++ browser_functions.setexception(npobj, java_result->error_msg->c_str()); + return false; + } + + diff -Nru icedtea-web-1.3.2/debian/patches/CVE-2013-6493.patch icedtea-web-1.4/debian/patches/CVE-2013-6493.patch --- icedtea-web-1.3.2/debian/patches/CVE-2013-6493.patch 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/debian/patches/CVE-2013-6493.patch 2014-03-04 20:04:10.000000000 +0000 @@ -0,0 +1,246 @@ +Description: fix info disclosure via insecure temporary directory use +Origin: backport, http://icedtea.classpath.org/hg/release/icedtea-web-1.4/rev/35f4d27451fd +Origin: backport, http://icedtea.classpath.org/hg/release/icedtea-web-1.4/rev/1ae3613c82f2 +Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2013-6493 + +Index: icedtea-web-1.4.1/plugin/icedteanp/IcedTeaNPPlugin.cc +=================================================================== +--- icedtea-web-1.4.1.orig/plugin/icedteanp/IcedTeaNPPlugin.cc 2014-03-04 14:51:03.000000000 -0500 ++++ icedtea-web-1.4.1/plugin/icedteanp/IcedTeaNPPlugin.cc 2014-03-04 14:55:00.683576417 -0500 +@@ -38,6 +38,9 @@ + + // System includes. + #include ++#include ++#include ++#include + #include + #include + #include +@@ -133,6 +136,7 @@ + + // Data directory for plugin. + static std::string data_directory; ++static DIR *data_directory_descriptor; + + // Fully-qualified appletviewer default executable and rt.jar + static const char* appletviewer_default_executable = ICEDTEA_WEB_JRE "/bin/java"; +@@ -206,7 +210,7 @@ + NPError get_cookie_info(const char* siteAddr, char** cookieString, uint32_t* len); + NPError get_proxy_info(const char* siteAddr, char** proxy, uint32_t* len); + void consume_message(gchar* message); +-void start_jvm_if_needed(); ++NPError start_jvm_if_needed(); + static void appletviewer_monitor(GPid pid, gint status, gpointer data); + void plugin_send_initialization_message(char* instance, gulong handle, + int width, int height, +@@ -281,7 +285,21 @@ + return appletviewer_default_rtjar; + } + +- ++static void cleanUpDir(){ ++ //free data_directory descriptor ++ if (data_directory_descriptor != NULL) { ++ closedir(data_directory_descriptor); ++ } ++ //clean up pipes directory ++ PLUGIN_DEBUG ("Removing runtime directory %s \n", data_directory.c_str()); ++ int removed = rmdir(data_directory.c_str()); ++ if (removed != 0) { ++ PLUGIN_ERROR_THREE ("Failed to remove runtime directory %s, because of %s \n", data_directory.c_str(), strerror(errno)); ++ } else { ++ PLUGIN_DEBUG ("Removed runtime directory %s \n", data_directory.c_str()); ++ } ++ data_directory_descriptor = NULL; ++} + /* + * Find first member in GHashTable* depending on version of glib + */ +@@ -346,6 +364,7 @@ + gchar* cookie_info = NULL; + + NPObject* npPluginObj = NULL; ++ NPError startup_error = NPERR_NO_ERROR; + + if (!instance) + { +@@ -364,7 +383,7 @@ + } + + // start the jvm if needed +- start_jvm_if_needed(); ++ startup_error = start_jvm_if_needed(); + + // Initialize data->instance_id. + // +@@ -436,7 +455,7 @@ + } + + // Starts the JVM if it is not already running +-void start_jvm_if_needed() ++NPError start_jvm_if_needed() + { + + // This is asynchronized function. It must +@@ -451,7 +470,7 @@ + if (jvm_up) + { + PLUGIN_DEBUG("JVM is up. Returning.\n"); +- return; ++ return NPERR_NO_ERROR; + } + + PLUGIN_DEBUG("No JVM is running. Attempting to start one...\n"); +@@ -619,10 +638,12 @@ + g_free (in_pipe_name); + in_pipe_name = NULL; + ++ cleanUpDir(); + done: + + // Now other threads may re-enter.. unlock the mutex + g_mutex_unlock(vm_start_mutex); ++ return np_error; + + } + +@@ -1899,53 +1920,30 @@ + // Make sure the plugin data directory exists, creating it if + // necessary. + +- const char* tmpdir_env = getenv("TMPDIR"); +- if (tmpdir_env != NULL && g_file_test (tmpdir_env, +- (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) +- { +- data_directory = tmpdir_env; +- } +- else if (g_file_test (P_tmpdir, +- (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) +- { +- data_directory = P_tmpdir; +- } +- else +- { +- // If TMPDIR and P_tmpdir do not exist, try /tmp directly +- data_directory = "/tmp"; +- } +- +- data_directory += "/icedteaplugin-"; +- if (getenv("USER") != NULL) +- data_directory += getenv("USER"); +- ++ data_directory = IcedTeaPluginUtilities::getRuntimePath() + "/icedteaplugin-"; ++ if (getenv("USER") != NULL) { ++ data_directory = data_directory + getenv("USER") + "-"; ++ } ++ data_directory += "XXXXXX"; + // Now create a icedteaplugin subdir +- if (!g_file_test (data_directory.c_str(), +- (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) +- { +- int file_error = 0; +- +- file_error = g_mkdir (data_directory.c_str(), 0700); +- if (file_error != 0) +- { +- PLUGIN_ERROR_THREE ("Failed to create data directory", +- data_directory.c_str(), +- strerror (errno)); +- return NPERR_GENERIC_ERROR; +- } +- } +- ++ char fileNameX[data_directory.length()+1]; ++ std::strcpy (fileNameX, data_directory.c_str()); ++ char * fileName = mkdtemp(fileNameX); ++ if (fileName == NULL) { ++ PLUGIN_ERROR_THREE ("Failed to create data directory %s, %s\n", ++ data_directory.c_str(), ++ strerror (errno)); ++ return NPERR_GENERIC_ERROR; ++ } ++ data_directory = std::string(fileName); + +- // If data directory doesn't exist by this point, bail +- if (!g_file_test (data_directory.c_str(), +- (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) +- { +- PLUGIN_ERROR_THREE ("Temp directory does not exist: ", +- data_directory.c_str(), +- strerror (errno)); ++ //open uniques icedteaplugin subdir for one single run ++ data_directory_descriptor = opendir(data_directory.c_str()); ++ if (data_directory_descriptor == NULL) { ++ PLUGIN_ERROR_THREE ("Failed to open data directory %s %s\n", ++ data_directory.c_str(), strerror (errno)); + return NPERR_GENERIC_ERROR; +- } ++ } + + // Set appletviewer_executable. + PLUGIN_DEBUG("Executing java at %s\n", get_plugin_executable().c_str()); +@@ -2128,6 +2126,8 @@ + delete plugin_to_java_bus; + //delete internal_bus; + ++ cleanUpDir(); ++ + PLUGIN_DEBUG ("NP_Shutdown return\n"); + + return NPERR_NO_ERROR; +Index: icedtea-web-1.4.1/plugin/icedteanp/IcedTeaPluginUtils.cc +=================================================================== +--- icedtea-web-1.4.1.orig/plugin/icedteanp/IcedTeaPluginUtils.cc 2014-03-04 14:51:03.000000000 -0500 ++++ icedtea-web-1.4.1/plugin/icedteanp/IcedTeaPluginUtils.cc 2014-03-04 14:51:39.227571022 -0500 +@@ -1074,6 +1074,36 @@ + } + + ++std::string IcedTeaPluginUtilities::getTmpPath(){ ++ const char* tmpdir_env = getenv("TMPDIR"); ++ if (tmpdir_env != NULL && g_file_test (tmpdir_env, ++ (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) ++ { ++ return std::string(tmpdir_env); ++ } ++ else if (g_file_test (P_tmpdir, ++ (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) ++ { ++ return std::string(P_tmpdir); ++ } ++ else ++ { ++ // If TMPDIR and P_tmpdir do not exist, try /tmp directly ++ return "/tmp"; ++ } ++} ++ ++std::string IcedTeaPluginUtilities::getRuntimePath(){ ++ const char* rntdir_env = getenv("XDG_RUNTIME_DIR"); ++ if (rntdir_env != NULL && g_file_test (rntdir_env, ++ (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) ++ { ++ return std::string(rntdir_env); ++ } ++ return IcedTeaPluginUtilities::getTmpPath(); ++} ++ ++ + /****************************************** + * Begin JavaMessageSender implementation * + ****************************************** +Index: icedtea-web-1.4.1/plugin/icedteanp/IcedTeaPluginUtils.h +=================================================================== +--- icedtea-web-1.4.1.orig/plugin/icedteanp/IcedTeaPluginUtils.h 2014-03-04 14:51:03.000000000 -0500 ++++ icedtea-web-1.4.1/plugin/icedteanp/IcedTeaPluginUtils.h 2014-03-04 14:51:39.231571022 -0500 +@@ -277,7 +277,8 @@ + /*cutting whitespaces from end and start of string*/ + static void trim(std::string& str); + static bool file_exists(std::string filename); +- ++ static std::string getTmpPath(); ++ static std::string getRuntimePath(); + }; + + /* diff -Nru icedtea-web-1.3.2/debian/patches/gcc-option-order.diff icedtea-web-1.4/debian/patches/gcc-option-order.diff --- icedtea-web-1.3.2/debian/patches/gcc-option-order.diff 2013-04-16 22:48:40.000000000 +0000 +++ icedtea-web-1.4/debian/patches/gcc-option-order.diff 2013-05-09 16:28:39.000000000 +0000 @@ -1,8 +1,8 @@ Index: b/Makefile.am =================================================================== ---- a/Makefile.am 2013-04-16 22:48:35.237826243 +0000 -+++ b/Makefile.am 2013-04-16 22:48:35.205828869 +0000 -@@ -261,7 +261,7 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -294,7 +294,7 @@ mkdir -p $(PLUGIN_DIR) && \ cd $(PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ @@ -11,19 +11,19 @@ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ -@@ -269,6 +269,7 @@ +@@ -302,6 +302,7 @@ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ + $(VERSION_DEFS) \ $(GLIB_CFLAGS) \ $(MOZILLA_CFLAGS) \ - -fPIC -o $@ -c $< + -fvisibility=hidden \ Index: b/Makefile.in =================================================================== ---- a/Makefile.in 2013-04-16 22:48:35.237826243 +0000 -+++ b/Makefile.in 2013-04-16 22:48:35.237826243 +0000 -@@ -799,7 +799,7 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -795,7 +795,7 @@ @ENABLE_PLUGIN_TRUE@ mkdir -p $(PLUGIN_DIR) && \ @ENABLE_PLUGIN_TRUE@ cd $(PLUGIN_DIR) && \ @ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) \ @@ -32,11 +32,11 @@ @ENABLE_PLUGIN_TRUE@ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ -@@ -807,6 +807,7 @@ +@@ -803,6 +803,7 @@ @ENABLE_PLUGIN_TRUE@ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ @ENABLE_PLUGIN_TRUE@ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ +@ENABLE_PLUGIN_TRUE@ $(VERSION_DEFS) \ @ENABLE_PLUGIN_TRUE@ $(GLIB_CFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(MOZILLA_CFLAGS) \ - @ENABLE_PLUGIN_TRUE@ -fPIC -o $@ -c $< + @ENABLE_PLUGIN_TRUE@ -fvisibility=hidden \ diff -Nru icedtea-web-1.3.2/debian/patches/javaws_change_java_policy.diff icedtea-web-1.4/debian/patches/javaws_change_java_policy.diff --- icedtea-web-1.3.2/debian/patches/javaws_change_java_policy.diff 2012-01-22 14:43:37.000000000 +0000 +++ icedtea-web-1.4/debian/patches/javaws_change_java_policy.diff 2013-05-09 16:28:26.000000000 +0000 @@ -12,7 +12,7 @@ =================================================================== --- a/launcher/javaws.in +++ b/launcher/javaws.in -@@ -50,6 +50,10 @@ +@@ -77,6 +77,10 @@ k=$((k+1)) COMMAND[k]="-Dicedtea-web.bin.location=${BINARY_LOCATION}" k=$((k+1)) diff -Nru icedtea-web-1.3.2/debian/patches/pr854.diff icedtea-web-1.4/debian/patches/pr854.diff --- icedtea-web-1.3.2/debian/patches/pr854.diff 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/debian/patches/pr854.diff 2013-07-04 09:00:25.000000000 +0000 @@ -0,0 +1,39 @@ + +# HG changeset patch +# User Adam Domurad +# Date 1368808292 14400 +# Node ID 29aad2f10875cb4deab6acde8f3617486c7ce344 +# Parent 1b1e547ccb4a34f576d6cc1d93cfb7e4e6f603ec +Fix PR854: Resizing an applet several times causes 100% CPU load + +2013-05-17 Adam Domurad + + Fix PR854: Resizing an applet several times causes 100% CPU load + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java + (handleMessage): Replace buggy initialization wait. + + +diff -r 1b1e547ccb4a -r 29aad2f10875 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java +--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Wed May 15 12:14:26 2013 +0200 ++++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri May 17 12:31:32 2013 -0400 +@@ -665,18 +665,7 @@ + if (message.startsWith("width")) { + + // Wait for panel to come alive +- long maxTimeToSleep = APPLET_TIMEOUT; +- statusLock.lock(); +- try { +- while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && +- maxTimeToSleep > 0) { +- maxTimeToSleep -= waitTillTimeout(statusLock, initComplete, +- maxTimeToSleep); +- } +- } +- finally { +- statusLock.unlock(); +- } ++ waitForAppletInit(panel); + + // 0 => width, 1=> width_value, 2 => height, 3=> height_value + String[] dimMsg = message.split(" "); + diff -Nru icedtea-web-1.3.2/debian/patches/series icedtea-web-1.4/debian/patches/series --- icedtea-web-1.3.2/debian/patches/series 2013-07-01 18:12:20.000000000 +0000 +++ icedtea-web-1.4/debian/patches/series 2014-03-04 20:21:00.000000000 +0000 @@ -1,5 +1,8 @@ +branch-updates.diff javaws_change_java_policy.diff gcc-option-order.diff use-ldflags.diff #hg-updates.diff -work-with-icedtea-8004584.patch +CVE-2013-4349.patch +CVE-2013-6493.patch +xulrunner-27-ftbfs.patch diff -Nru icedtea-web-1.3.2/debian/patches/use-ldflags.diff icedtea-web-1.4/debian/patches/use-ldflags.diff --- icedtea-web-1.3.2/debian/patches/use-ldflags.diff 2013-04-16 22:48:47.000000000 +0000 +++ icedtea-web-1.4/debian/patches/use-ldflags.diff 2013-05-09 16:28:47.000000000 +0000 @@ -1,8 +1,8 @@ Index: b/Makefile.am =================================================================== ---- a/Makefile.am 2013-04-16 22:48:42.077878386 +0000 -+++ b/Makefile.am 2013-04-16 22:48:42.053881907 +0000 -@@ -276,7 +276,7 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -310,7 +310,7 @@ $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) cd $(PLUGIN_DIR) && \ @@ -10,12 +10,12 @@ + $(CXX) $(LDFLAGS) $(CXXFLAGS) \ $(PLUGIN_OBJECTS) \ $(GLIB_LIBS) \ - $(MOZILLA_LIBS)\ + $(MOZILLA_LIBS) \ Index: b/Makefile.in =================================================================== ---- a/Makefile.in 2013-04-16 22:48:42.077878386 +0000 -+++ b/Makefile.in 2013-04-16 22:48:42.073878860 +0000 -@@ -814,7 +814,7 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -811,7 +811,7 @@ @ENABLE_PLUGIN_TRUE@$(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) @ENABLE_PLUGIN_TRUE@ cd $(PLUGIN_DIR) && \ @@ -23,4 +23,4 @@ +@ENABLE_PLUGIN_TRUE@ $(CXX) $(LDFLAGS) $(CXXFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(PLUGIN_OBJECTS) \ @ENABLE_PLUGIN_TRUE@ $(GLIB_LIBS) \ - @ENABLE_PLUGIN_TRUE@ $(MOZILLA_LIBS)\ + @ENABLE_PLUGIN_TRUE@ $(MOZILLA_LIBS) \ diff -Nru icedtea-web-1.3.2/debian/patches/work-with-icedtea-8004584.patch icedtea-web-1.4/debian/patches/work-with-icedtea-8004584.patch --- icedtea-web-1.3.2/debian/patches/work-with-icedtea-8004584.patch 2013-07-01 18:18:54.000000000 +0000 +++ icedtea-web-1.4/debian/patches/work-with-icedtea-8004584.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ - -# HG changeset patch -# User Jiri Vanek -# Date 1371734457 -7200 -# Node ID 2469bedc6d63aa59da025cc1f479846344895ed5 -# Parent fa6a80c73e0daf4fe187ee6f6f7423dc2e2a497d -Made it work with OpenJDK build 25 by creating application as soon as possible - -Index: icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/Boot.java -=================================================================== ---- icedtea-web-1.3.2.orig/netx/net/sourceforge/jnlp/runtime/Boot.java 2013-04-10 09:30:03.000000000 -0500 -+++ icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/Boot.java 2013-07-01 13:13:53.000000000 -0500 -@@ -35,6 +35,8 @@ - import net.sourceforge.jnlp.cache.UpdatePolicy; - import net.sourceforge.jnlp.security.viewer.CertificateViewer; - import net.sourceforge.jnlp.services.ServiceUtil; -+import sun.awt.AppContext; -+import sun.awt.SunToolkit; - - /** - * This is the main entry point for the JNLP client. The main -@@ -113,6 +115,9 @@ - * Launch the JNLP file specified by the command-line arguments. - */ - public static void main(String[] argsIn) { -+ if (AppContext.getAppContext() == null) { -+ SunToolkit.createNewAppContext(); -+ } - args = argsIn; - - if (null != getOption("-viewer")) { -Index: icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java -=================================================================== ---- icedtea-web-1.3.2.orig/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java 2013-04-10 09:30:03.000000000 -0500 -+++ icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java 2013-07-01 13:14:31.000000000 -0500 -@@ -233,7 +233,7 @@ - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (Exception e) { -- // ignore it -+ e.printStackTrace(); - } - - doMainAppContextHacks(); -Index: icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/PluginMain.java -=================================================================== ---- icedtea-web-1.3.2.orig/plugin/icedteanp/java/sun/applet/PluginMain.java 2013-04-10 06:40:23.000000000 -0500 -+++ icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/PluginMain.java 2013-07-01 13:15:28.000000000 -0500 -@@ -72,6 +72,8 @@ - import java.net.ProxySelector; - import java.util.Enumeration; - import java.util.Properties; -+import sun.awt.AppContext; -+import sun.awt.SunToolkit; - - import net.sourceforge.jnlp.config.DeploymentConfiguration; - import net.sourceforge.jnlp.runtime.JNLPRuntime; -@@ -94,6 +96,9 @@ - */ - public static void main(String args[]) - throws IOException { -+ if (AppContext.getAppContext() == null) { -+ SunToolkit.createNewAppContext(); -+ } - if (args.length != 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) { - System.err.println("Invalid pipe names provided. Refusing to proceed."); - System.exit(1); diff -Nru icedtea-web-1.3.2/debian/patches/xulrunner-27-ftbfs.patch icedtea-web-1.4/debian/patches/xulrunner-27-ftbfs.patch --- icedtea-web-1.3.2/debian/patches/xulrunner-27-ftbfs.patch 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/debian/patches/xulrunner-27-ftbfs.patch 2014-03-04 20:21:00.000000000 +0000 @@ -0,0 +1,51 @@ + +# HG changeset patch +# User Jiri Vanek +# Date 1392994123 -3600 +# Node ID 9eadfcabb570a6c267e8e0b1ba1391bde7a0cb19 +# Parent 1d4c7bc579d887565ec5d8cd178f4bf6f2402552 +Make it build with xulrunner 27 + +diff -r 1d4c7bc579d8 -r 9eadfcabb570 acinclude.m4 +--- a/acinclude.m4 Wed Feb 19 15:38:50 2014 +0100 ++++ b/acinclude.m4 Fri Feb 21 15:48:43 2014 +0100 +@@ -515,6 +515,27 @@ + AC_LANG_POP(C++) + ]) + ++AC_DEFUN_ONCE([IT_CHECK_XULRUNNER_REQUIRES_C11], ++[ ++ AC_MSG_CHECKING([for xulrunner enforcing C++11 standard]) ++ AC_LANG_PUSH(C++) ++ CXXFLAGS_BACKUP="$CXXFLAGS" ++ CXXFLAGS="$CXXFLAGS"" ""$MOZILLA_CFLAGS" ++ AC_COMPILE_IFELSE([ ++ #include ++ #include ] ++ [void setnpptr (NPVariant *result) ++ {VOID_TO_NPVARIANT(*result);} ++ ],[ ++ AC_MSG_RESULT(no) ++ CXXFLAGS="$CXXFLAGS_BACKUP" ++ ],[ ++ AC_MSG_RESULT(yes) ++ CXXFLAGS="$CXXFLAGS_BACKUP -std=c++11" ++ ]) ++ AC_LANG_POP(C++) ++]) ++ + AC_DEFUN([IT_CHECK_WITH_GCJ], + [ + AC_MSG_CHECKING([whether to compile ecj natively]) +diff -r 1d4c7bc579d8 -r 9eadfcabb570 configure.ac +--- a/configure.ac Wed Feb 19 15:38:50 2014 +0100 ++++ b/configure.ac Fri Feb 21 15:48:43 2014 +0100 +@@ -83,6 +83,7 @@ + IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE + IT_CHECK_GLIB_VERSION + IT_CHECK_XULRUNNER_API_VERSION ++IT_CHECK_XULRUNNER_REQUIRES_C11 + + # + # Find optional depedencies + diff -Nru icedtea-web-1.3.2/debian/rules icedtea-web-1.4/debian/rules --- icedtea-web-1.3.2/debian/rules 2012-12-20 15:26:32.000000000 +0000 +++ icedtea-web-1.4/debian/rules 2013-05-09 16:59:11.000000000 +0000 @@ -61,6 +61,11 @@ endif endif +# dependency package for older releases +ifeq (,$(filter $(distrel),hardy intrepid jaunty karmic lucid maverick natty oneiric precise quantal raring lenny etch squeeze wheezy)) + nopkgs = -Nicedtea6-plugin +endif + TOP = usr/lib/jvm jdirname = java-$(shortver)-$(origin) origin = openjdk @@ -189,6 +194,7 @@ $(if $(DEB_HOST_MULTIARCH),debian/control.common) \ $(if $(filter 6, $(jre_versions)),debian/control.6) \ $(if $(filter 7, $(jre_versions)),debian/control.7) \ + $(if $(nopkgs),,debian/control.compat) \ $(if $(DEB_HOST_MULTIARCH),,| grep -v '^Multi-Arch:') \ > debian/control @if cmp -s debian/control debian/control.old; then \ @@ -410,21 +416,25 @@ binary-indep: install dh_testdir -i dh_testroot -i - dh_installdocs -i - dh_installchangelogs -i + dh_installdocs -i $(nopkgs) + dh_installchangelogs -i $(nopkgs) rm -rf $(d_plug)/usr/share/doc/$(p_plug) ln -s $(p_netx) $(d_plug)/usr/share/doc/$(p_plug) +ifeq (,$(nopkgs)) rm -rf debian/icedtea6-plugin/usr/share/doc/icedtea6-plugin ln -s $(p_plug) debian/icedtea6-plugin/usr/share/doc/icedtea6-plugin - dh_compress -i - dh_fixperms -i - dh_installdeb -i +endif + dh_compress -i $(nopkgs) + dh_fixperms -i $(nopkgs) + dh_installdeb -i $(nopkgs) ifneq (,$(DEB_HOST_MULTIARCH)) dh_gencontrol -p icedtea-netx-common -p icedtea-plugin -- $(control_vars) endif +ifeq (,$(nopkgs)) dh_gencontrol -p icedtea6-plugin -- -v6b2$(PKGVERSION) $(control_vars) - dh_md5sums -i - dh_builddeb -i +endif + dh_md5sums -i $(nopkgs) + dh_builddeb -i $(nopkgs) binary: binary-arch binary-indep @@ -440,8 +450,7 @@ dh_fixperms -s dh_installdeb -s dh_shlibdeps -s - dh_gencontrol -s -N icedtea6-plugin -- $(control_vars) - dh_gencontrol -p icedtea6-plugin -- -v6b2$(PKGVERSION) $(control_vars) + dh_gencontrol -s -- $(control_vars) dh_md5sums -s dh_builddeb -s diff -Nru icedtea-web-1.3.2/install-sh icedtea-web-1.4/install-sh --- icedtea-web-1.3.2/install-sh 2013-04-11 16:15:37.729212805 +0000 +++ icedtea-web-1.4/install-sh 2013-05-03 19:23:56.182805339 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it +# `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,10 +156,6 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac shift;; -T) no_target_directory=true;; @@ -190,10 +186,6 @@ fi shift # arg dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac done fi @@ -202,17 +194,13 @@ echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call 'install-sh -d' without argument. + # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 + trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -240,9 +228,9 @@ for src do - # Protect names problematic for 'test' and other utilities. + # Protect names starting with `-'. case $src in - -* | [=\(\)!]) src=./$src;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -264,7 +252,12 @@ echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -354,7 +347,7 @@ if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. + # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in @@ -392,7 +385,7 @@ case $dstdir in /*) prefix='/';; - [-=\(\)!]*) prefix='./';; + -*) prefix='./';; *) prefix='';; esac @@ -410,7 +403,7 @@ for d do - test X"$d" = X && continue + test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then diff -Nru icedtea-web-1.3.2/itweb-settings.desktop.in icedtea-web-1.4/itweb-settings.desktop.in --- icedtea-web-1.3.2/itweb-settings.desktop.in 2013-04-10 11:40:23.834668000 +0000 +++ icedtea-web-1.4/itweb-settings.desktop.in 2013-05-03 19:08:24.146521428 +0000 @@ -1,8 +1,15 @@ [Desktop Entry] -Name=IcedTea Web Control Panel -Comment=Configure IcedTea Web (javaws and plugin) +Name=IcedTea-Web Control Panel +Name[de]=IcedTea-Web Systemsteuerung +Name[pl]=Panel sterowania IcedTea-Web +Name[cs]=Ovládací panel IcedTea-Web +Comment=Configure IcedTea-Web (javaws and plugin) +Comment[de]=Konfiguriert IcedTea-Web (javaws und Plug-in) +Comment[pl]=Konfiguruj IcedTea-Web (javaws i wtyczkę) +Comment[cs]=Konfigurace aplikace IcedTea-Web (javaws a zásuvný modul) Exec=PATH_TO_ITWEB_SETTINGS Icon=javaws Terminal=false Type=Application Categories=Settings; +Keywords=IcedTea;IcedTea-Web;java;javaws;web;start;webstart;jnlp; diff -Nru icedtea-web-1.3.2/launcher/itweb-settings.in icedtea-web-1.4/launcher/itweb-settings.in --- icedtea-web-1.3.2/launcher/itweb-settings.in 2013-04-10 11:40:23.836668000 +0000 +++ icedtea-web-1.4/launcher/itweb-settings.in 2013-05-03 19:08:24.149521391 +0000 @@ -7,6 +7,20 @@ BINARY_LOCATION=@ITWEB_SETTINGS_BIN_LOCATION@ PROGRAM_NAME=itweb-settings +PROPERTY_NAME=deployment.jre.dir +CUSTOM_JRE_REGEX="^$PROPERTY_NAME *= *" +CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" ~/.icedtea/deployment.properties 2>/dev/null | sed "s/$CUSTOM_JRE_REGEX//g"` +if [ "x$CUSTOM_JRE" = "x" ] ; then + CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" /etc/.java/.deploy/deployment.properties 2>/dev/null | sed "s/$CUSTOM_JRE_REGEX//g"` +fi; +if [ "x$CUSTOM_JRE" != "x" ] ; then + if [ -e "$CUSTOM_JRE" -a -e "$CUSTOM_JRE/bin/java" ] ; then + JAVA=$CUSTOM_JRE/bin/java + else + echo "Your custom JRE $CUSTOM_JRE read from deployment.properties under key $PROPERTY_NAME as $CUSTOM_JRE is not valid. Using default ($JAVA) in attempt to start. Please fix this." + fi +fi; + ${JAVA} ${LAUNCHER_BOOTCLASSPATH} ${LAUNCHER_FLAGS} \ -Dicedtea-web.bin.name=${PROGRAM_NAME} \ -Dicedtea-web.bin.location=${BINARY_LOCATION} \ diff -Nru icedtea-web-1.3.2/launcher/java.c icedtea-web-1.4/launcher/java.c --- icedtea-web-1.3.2/launcher/java.c 2013-04-10 11:40:23.836668000 +0000 +++ icedtea-web-1.4/launcher/java.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2019 +0,0 @@ -/* - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -/* - * Shared source for 'java' command line tool. - * - * If JAVA_ARGS is defined, then acts as a launcher for applications. For - * instance, the JDK command line tools such as javac and javadoc (see - * makefiles for more details) are built with this program. Any arguments - * prefixed with '-J' will be passed directly to the 'java' command. - */ - -/* - * One job of the launcher is to remove command line options which the - * vm does not understand and will not process. These options include - * options which select which style of vm is run (e.g. -client and - * -server) as well as options which select the data model to use. - * Additionally, for tools which invoke an underlying vm "-J-foo" - * options are turned into "-foo" options to the vm. This option - * filtering is handled in a number of places in the launcher, some of - * it in machine-dependent code. In this file, the function - * CheckJVMType removes vm style options and TranslateApplicationArgs - * removes "-J" prefixes. On unix platforms, the - * CreateExecutionEnvironment function from the unix java_md.c file - * processes and removes -d options. However, in case - * CreateExecutionEnvironment does not need to exec because - * LD_LIBRARY_PATH is set acceptably and the data model does not need - * to be changed, ParseArguments will screen out the redundant -d - * options and prevent them from being passed to the vm; this is done - * by using the machine-dependent call - * RemovableMachineDependentOption. - */ - -#include -#include -#include - -#include -#include -#include "java.h" -#include "manifest_info.h" -#include "version_comp.h" -#include "wildcard.h" -#include "splashscreen.h" - -#ifndef FULL_VERSION -#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION -#endif - -/* - * The following environment variable is used to influence the behavior - * of the jre exec'd through the SelectVersion routine. The command line - * options which specify the version are not passed to the exec'd version, - * because that jre may be an older version which wouldn't recognize them. - * This environment variable is known to this (and later) version and serves - * to suppress the version selection code. This is not only for efficiency, - * but also for correctness, since any command line options have been - * removed which would cause any value found in the manifest to be used. - * This would be incorrect because the command line options are defined - * to take precedence. - * - * The value associated with this environment variable is the MainClass - * name from within the executable jar file (if any). This is strictly a - * performance enhancement to avoid re-reading the jar file manifest. - * - * A NOTE TO DEVELOPERS: For performance reasons it is important that - * the program image remain relatively small until after SelectVersion - * CreateExecutionEnvironment have finished their possibly recursive - * processing. Watch everything, but resist all temptations to use Java - * interfaces. - */ -#define ENV_ENTRY "_JAVA_VERSION_SET" - -#define SPLASH_FILE_ENV_ENTRY "_JAVA_SPLASH_FILE" -#define SPLASH_JAR_ENV_ENTRY "_JAVA_SPLASH_JAR" - -static jboolean printVersion = JNI_FALSE; /* print and exit */ -static jboolean showVersion = JNI_FALSE; /* print but continue */ -static jboolean printUsage = JNI_FALSE; /* print and exit*/ -static jboolean printXUsage = JNI_FALSE; /* print and exit*/ -static char *progname; -static char *launchername; -jboolean _launcher_debug = JNI_FALSE; - -/* - * Entries for splash screen environment variables. - * putenv is performed in SelectVersion. We need - * them in memory until UnsetEnv, so they are made static - * global instead of auto local. - */ -static char* splash_file_entry = NULL; -static char* splash_jar_entry = NULL; - -/* - * List of VM options to be specified when the VM is created. - */ -static JavaVMOption *options; -static int numOptions, maxOptions; - -/* - * Prototypes for functions internal to launcher. - */ -static void SetClassPath(const char *s); -static void SelectVersion(int argc, char **argv, char **main_class); -static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile, - char **pclassname, int *pret, const char *jvmpath); -static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv, - InvocationFunctions *ifn); -static jstring NewPlatformString(JNIEnv *env, char *s); -static jobjectArray NewPlatformStringArray(JNIEnv *env, char **strv, int strc); -static jclass LoadClass(JNIEnv *env, char *name); -static jstring GetMainClassName(JNIEnv *env, char *jarname); -static void SetJavaCommandLineProp(char* classname, char* jarfile, int argc, char** argv); -static void SetJavaLauncherProp(void); - -#ifdef JAVA_ARGS -static void TranslateApplicationArgs(int *pargc, char ***pargv); -static jboolean AddApplicationOptions(void); -#endif - -static void PrintJavaVersion(JNIEnv *env); -static void PrintUsage(JNIEnv* env, jboolean doXUsage); - -static void SetPaths(int argc, char **argv); - - -/* Maximum supported entries from jvm.cfg. */ -#define INIT_MAX_KNOWN_VMS 10 -/* Values for vmdesc.flag */ -#define VM_UNKNOWN -1 -#define VM_KNOWN 0 -#define VM_ALIASED_TO 1 -#define VM_WARN 2 -#define VM_ERROR 3 -#define VM_IF_SERVER_CLASS 4 -#define VM_IGNORE 5 -struct vmdesc { - char *name; - int flag; - char *alias; - char *server_class; -}; -static struct vmdesc *knownVMs = NULL; -static int knownVMsCount = 0; -static int knownVMsLimit = 0; - -static void GrowKnownVMs(); -static int KnownVMIndex(const char* name); -static void FreeKnownVMs(); -static void ShowSplashScreen(); - -jboolean ServerClassMachine(); - -/* flag which if set suppresses error messages from the launcher */ -static int noExitErrorMessage = 0; - -/* - * Running Java code in primordial thread caused many problems. We will - * create a new thread to invoke JVM. See 6316197 for more information. - */ -static jlong threadStackSize = 0; /* stack size of the new thread */ - -int JNICALL JavaMain(void * args); /* entry point */ - -struct JavaMainArgs { - int argc; - char ** argv; - char * jarfile; - char * classname; - InvocationFunctions ifn; -}; - -/* - * Entry point. - */ -int -main(int argc, char ** argv) -{ - char *jarfile = 0; - char *classname = 0; - char *s = 0; - char *main_class = NULL; - int ret; - InvocationFunctions ifn; - jlong start, end; - char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN]; - char ** original_argv = argv; - - if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) { - int i; - _launcher_debug = JNI_TRUE; - printf("----_JAVA_LAUNCHER_DEBUG----\n"); - printf("Command line Args:\n"); - for(i = 0; i < argc+1; i++) { - if (argv[i] != NULL){ - printf("\targv[%d] = '%s'\n",i,argv[i]); - } - } - } - - - - /* - * Make sure the specified version of the JRE is running. - * - * There are three things to note about the SelectVersion() routine: - * 1) If the version running isn't correct, this routine doesn't - * return (either the correct version has been exec'd or an error - * was issued). - * 2) Argc and Argv in this scope are *not* altered by this routine. - * It is the responsibility of subsequent code to ignore the - * arguments handled by this routine. - * 3) As a side-effect, the variable "main_class" is guaranteed to - * be set (if it should ever be set). This isn't exactly the - * poster child for structured programming, but it is a small - * price to pay for not processing a jar file operand twice. - * (Note: This side effect has been disabled. See comment on - * bugid 5030265 below.) - */ - SelectVersion(argc, argv, &main_class); - - /* copy original argv */ - { - int i; - original_argv = (char**)JLI_MemAlloc(sizeof(char*)*(argc+1)); - for(i = 0; i < argc+1; i++) { - original_argv[i] = argv[i]; - } - } - - CreateExecutionEnvironment(&argc, &argv, - jrepath, sizeof(jrepath), - jvmpath, sizeof(jvmpath), - original_argv); - - ifn.CreateJavaVM = 0; - ifn.GetDefaultJavaVMInitArgs = 0; - - if (_launcher_debug) - start = CounterGet(); - if (!LoadJavaVM(jvmpath, &ifn)) { - exit(6); - } - if (_launcher_debug) { - end = CounterGet(); - printf("%ld micro seconds to LoadJavaVM\n", - (long)(jint)Counter2Micros(end-start)); - } - -#ifdef JAVA_ARGS /* javac, jar and friends. */ - progname = "java"; -#else /* java, oldjava, javaw and friends */ -#ifdef PROGNAME - progname = PROGNAME; -#else - progname = *argv; - if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) { - progname = s + 1; - } -#endif /* PROGNAME */ -#endif /* JAVA_ARGS */ - -#ifdef LAUNCHER_NAME - launchername = LAUNCHER_NAME; -#else - launchername = progname; -#endif /* LAUNCHER_NAME */ - - ++argv; - --argc; - -#ifdef JAVA_ARGS - /* Preprocess wrapper arguments */ - TranslateApplicationArgs(&argc, &argv); - if (!AddApplicationOptions()) { - exit(1); - } -#endif - - /* Set default CLASSPATH */ - if ((s = getenv("CLASSPATH")) == 0) { - s = "."; - } -#ifndef JAVA_ARGS - SetClassPath(s); -#endif - - /* - * Parse command line options; if the return value of - * ParseArguments is false, the program should exit. - */ - if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret, jvmpath)) { - exit(ret); - } - - /* Override class path if -jar flag was specified */ - if (jarfile != 0) { - SetClassPath(jarfile); - } - - /* set the -Dsun.java.command pseudo property */ - SetJavaCommandLineProp(classname, jarfile, argc, argv); - - /* Set the -Dsun.java.launcher pseudo property */ - SetJavaLauncherProp(); - - /* set the -Dsun.java.launcher.* platform properties */ - SetJavaLauncherPlatformProps(); - - /* Show the splash screen if needed */ - ShowSplashScreen(); - - /* - * Done with all command line processing and potential re-execs so - * clean up the environment. - */ - (void)UnsetEnv(ENV_ENTRY); - (void)UnsetEnv(SPLASH_FILE_ENV_ENTRY); - (void)UnsetEnv(SPLASH_JAR_ENV_ENTRY); - - JLI_MemFree(splash_jar_entry); - JLI_MemFree(splash_file_entry); - - /* - * If user doesn't specify stack size, check if VM has a preference. - * Note that HotSpot no longer supports JNI_VERSION_1_1 but it will - * return its default stack size through the init args structure. - */ - if (threadStackSize == 0) { - struct JDK1_1InitArgs args1_1; - memset((void*)&args1_1, 0, sizeof(args1_1)); - args1_1.version = JNI_VERSION_1_1; - ifn.GetDefaultJavaVMInitArgs(&args1_1); /* ignore return value */ - if (args1_1.javaStackSize > 0) { - threadStackSize = args1_1.javaStackSize; - } - } - - { /* Create a new thread to create JVM and invoke main method */ - struct JavaMainArgs args; - - args.argc = argc; - args.argv = argv; - args.jarfile = jarfile; - args.classname = classname; - args.ifn = ifn; - - return ContinueInNewThread(JavaMain, threadStackSize, (void*)&args, ret); - } -} - -int JNICALL -JavaMain(void * _args) -{ - struct JavaMainArgs *args = (struct JavaMainArgs *)_args; - int argc = args->argc; - char **argv = args->argv; - char *jarfile = args->jarfile; - char *classname = args->classname; - InvocationFunctions ifn = args->ifn; - - JavaVM *vm = 0; - JNIEnv *env = 0; - jstring mainClassName; - jclass mainClass; - jmethodID mainID; - jobjectArray mainArgs; - int ret = 0; - jlong start, end; - - /* - * Error message to print or display; by default the message will - * only be displayed in a window. - */ - char * message = "Fatal exception occurred. Program will exit."; - jboolean messageDest = JNI_FALSE; - - /* Initialize the virtual machine */ - - if (_launcher_debug) - start = CounterGet(); - if (!InitializeJVM(&vm, &env, &ifn)) { - ReportErrorMessage("Could not create the Java virtual machine.", - JNI_TRUE); - exit(1); - } - - if (printVersion || showVersion) { - PrintJavaVersion(env); - if ((*env)->ExceptionOccurred(env)) { - ReportExceptionDescription(env); - goto leave; - } - if (printVersion) { - ret = 0; - message = NULL; - goto leave; - } - if (showVersion) { - fprintf(stderr, "\n"); - } - } - - /* If the user specified neither a class name nor a JAR file */ - if (printXUsage || printUsage || (jarfile == 0 && classname == 0)) { - PrintUsage(env, printXUsage); - if ((*env)->ExceptionOccurred(env)) { - ReportExceptionDescription(env); - ret=1; - } - message = NULL; - goto leave; - } - - - - FreeKnownVMs(); /* after last possible PrintUsage() */ - - if (_launcher_debug) { - end = CounterGet(); - printf("%ld micro seconds to InitializeJVM\n", - (long)(jint)Counter2Micros(end-start)); - } - - /* At this stage, argc/argv have the applications' arguments */ - if (_launcher_debug) { - int i = 0; - printf("Main-Class is '%s'\n", classname ? classname : ""); - printf("Apps' argc is %d\n", argc); - for (; i < argc; i++) { - printf(" argv[%2d] = '%s'\n", i, argv[i]); - } - } - - ret = 1; - - /* - * Get the application's main class. - * - * See bugid 5030265. The Main-Class name has already been parsed - * from the manifest, but not parsed properly for UTF-8 support. - * Hence the code here ignores the value previously extracted and - * uses the pre-existing code to reextract the value. This is - * possibly an end of release cycle expedient. However, it has - * also been discovered that passing some character sets through - * the environment has "strange" behavior on some variants of - * Windows. Hence, maybe the manifest parsing code local to the - * launcher should never be enhanced. - * - * Hence, future work should either: - * 1) Correct the local parsing code and verify that the - * Main-Class attribute gets properly passed through - * all environments, - * 2) Remove the vestages of maintaining main_class through - * the environment (and remove these comments). - */ - if (jarfile != 0) { - mainClassName = GetMainClassName(env, jarfile); - if ((*env)->ExceptionOccurred(env)) { - ReportExceptionDescription(env); - goto leave; - } - if (mainClassName == NULL) { - const char * format = "Failed to load Main-Class manifest " - "attribute from\n%s"; - message = (char*)JLI_MemAlloc((strlen(format) + strlen(jarfile)) * - sizeof(char)); - sprintf(message, format, jarfile); - messageDest = JNI_TRUE; - goto leave; - } - classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0); - if (classname == NULL) { - ReportExceptionDescription(env); - goto leave; - } - mainClass = LoadClass(env, classname); - if(mainClass == NULL) { /* exception occured */ - const char * format = "Could not find the main class: %s. Program will exit."; - ReportExceptionDescription(env); - message = (char *)JLI_MemAlloc((strlen(format) + - strlen(classname)) * sizeof(char)); - messageDest = JNI_TRUE; - sprintf(message, format, classname); - goto leave; - } - (*env)->ReleaseStringUTFChars(env, mainClassName, classname); - } else { - mainClassName = NewPlatformString(env, classname); - if (mainClassName == NULL) { - const char * format = "Failed to load Main Class: %s"; - message = (char *)JLI_MemAlloc((strlen(format) + strlen(classname)) * - sizeof(char) ); - sprintf(message, format, classname); - messageDest = JNI_TRUE; - goto leave; - } - classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0); - if (classname == NULL) { - ReportExceptionDescription(env); - goto leave; - } - mainClass = LoadClass(env, classname); - if(mainClass == NULL) { /* exception occured */ - const char * format = "Could not find the main class: %s. Program will exit."; - ReportExceptionDescription(env); - message = (char *)JLI_MemAlloc((strlen(format) + - strlen(classname)) * sizeof(char)); - messageDest = JNI_TRUE; - sprintf(message, format, classname); - goto leave; - } - (*env)->ReleaseStringUTFChars(env, mainClassName, classname); - } - - /* Get the application's main method */ - mainID = (*env)->GetStaticMethodID(env, mainClass, "main", - "([Ljava/lang/String;)V"); - if (mainID == NULL) { - if ((*env)->ExceptionOccurred(env)) { - ReportExceptionDescription(env); - } else { - message = "No main method found in specified class."; - messageDest = JNI_TRUE; - } - goto leave; - } - - { /* Make sure the main method is public */ - jint mods; - jmethodID mid; - jobject obj = (*env)->ToReflectedMethod(env, mainClass, - mainID, JNI_TRUE); - - if( obj == NULL) { /* exception occurred */ - ReportExceptionDescription(env); - goto leave; - } - - mid = - (*env)->GetMethodID(env, - (*env)->GetObjectClass(env, obj), - "getModifiers", "()I"); - if ((*env)->ExceptionOccurred(env)) { - ReportExceptionDescription(env); - goto leave; - } - - mods = (*env)->CallIntMethod(env, obj, mid); - if ((mods & 1) == 0) { /* if (!Modifier.isPublic(mods)) ... */ - message = "Main method not public."; - messageDest = JNI_TRUE; - goto leave; - } - } - - /* Build argument array */ - mainArgs = NewPlatformStringArray(env, argv, argc); - if (mainArgs == NULL) { - ReportExceptionDescription(env); - goto leave; - } - - /* Invoke main method. */ - (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs); - - /* - * The launcher's exit code (in the absence of calls to - * System.exit) will be non-zero if main threw an exception. - */ - ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1; - - /* - * Detach the main thread so that it appears to have ended when - * the application's main method exits. This will invoke the - * uncaught exception handler machinery if main threw an - * exception. An uncaught exception handler cannot change the - * launcher's return code except by calling System.exit. - */ - if ((*vm)->DetachCurrentThread(vm) != 0) { - message = "Could not detach main thread."; - messageDest = JNI_TRUE; - ret = 1; - goto leave; - } - - message = NULL; - - leave: - /* - * Wait for all non-daemon threads to end, then destroy the VM. - * This will actually create a trivial new Java waiter thread - * named "DestroyJavaVM", but this will be seen as a different - * thread from the one that executed main, even though they are - * the same C thread. This allows mainThread.join() and - * mainThread.isAlive() to work as expected. - */ - (*vm)->DestroyJavaVM(vm); - - if(message != NULL && !noExitErrorMessage) - ReportErrorMessage(message, messageDest); - return ret; -} - - -/* - * Checks the command line options to find which JVM type was - * specified. If no command line option was given for the JVM type, - * the default type is used. The environment variable - * JDK_ALTERNATE_VM and the command line option -XXaltjvm= are also - * checked as ways of specifying which JVM type to invoke. - */ -char * -CheckJvmType(int *pargc, char ***argv, jboolean speculative) { - int i, argi; - int argc; - char **newArgv; - int newArgvIdx = 0; - int isVMType; - int jvmidx = -1; - char *jvmtype = getenv("JDK_ALTERNATE_VM"); - - argc = *pargc; - - /* To make things simpler we always copy the argv array */ - newArgv = JLI_MemAlloc((argc + 1) * sizeof(char *)); - - /* The program name is always present */ - newArgv[newArgvIdx++] = (*argv)[0]; - - for (argi = 1; argi < argc; argi++) { - char *arg = (*argv)[argi]; - isVMType = 0; - -#ifdef JAVA_ARGS - if (arg[0] != '-') { - newArgv[newArgvIdx++] = arg; - continue; - } -#else - if (strcmp(arg, "-classpath") == 0 || - strcmp(arg, "-cp") == 0) { - newArgv[newArgvIdx++] = arg; - argi++; - if (argi < argc) { - newArgv[newArgvIdx++] = (*argv)[argi]; - } - continue; - } - if (arg[0] != '-') break; -#endif - - /* Did the user pass an explicit VM type? */ - i = KnownVMIndex(arg); - if (i >= 0) { - jvmtype = knownVMs[jvmidx = i].name + 1; /* skip the - */ - isVMType = 1; - *pargc = *pargc - 1; - } - - /* Did the user specify an "alternate" VM? */ - else if (strncmp(arg, "-XXaltjvm=", 10) == 0 || strncmp(arg, "-J-XXaltjvm=", 12) == 0) { - isVMType = 1; - jvmtype = arg+((arg[1]=='X')? 10 : 12); - jvmidx = -1; - } - - if (!isVMType) { - newArgv[newArgvIdx++] = arg; - } - } - - /* - * Finish copying the arguments if we aborted the above loop. - * NOTE that if we aborted via "break" then we did NOT copy the - * last argument above, and in addition argi will be less than - * argc. - */ - while (argi < argc) { - newArgv[newArgvIdx++] = (*argv)[argi]; - argi++; - } - - /* argv is null-terminated */ - newArgv[newArgvIdx] = 0; - - /* Copy back argv */ - *argv = newArgv; - *pargc = newArgvIdx; - - /* use the default VM type if not specified (no alias processing) */ - if (jvmtype == NULL) { - char* result = knownVMs[0].name+1; - /* Use a different VM type if we are on a server class machine? */ - if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) && - (ServerClassMachine() == JNI_TRUE)) { - result = knownVMs[0].server_class+1; - } - if (_launcher_debug) { - printf("Default VM: %s\n", result); - } - return result; - } - - /* if using an alternate VM, no alias processing */ - if (jvmidx < 0) - return jvmtype; - - /* Resolve aliases first */ - { - int loopCount = 0; - while (knownVMs[jvmidx].flag == VM_ALIASED_TO) { - int nextIdx = KnownVMIndex(knownVMs[jvmidx].alias); - - if (loopCount > knownVMsCount) { - if (!speculative) { - ReportErrorMessage("Error: Corrupt jvm.cfg file; cycle in alias list.", - JNI_TRUE); - exit(1); - } else { - return "ERROR"; - /* break; */ - } - } - - if (nextIdx < 0) { - if (!speculative) { - ReportErrorMessage2("Error: Unable to resolve VM alias %s", - knownVMs[jvmidx].alias, JNI_TRUE); - exit(1); - } else { - return "ERROR"; - } - } - jvmidx = nextIdx; - jvmtype = knownVMs[jvmidx].name+1; - loopCount++; - } - } - - switch (knownVMs[jvmidx].flag) { - case VM_WARN: - if (!speculative) { - fprintf(stderr, "Warning: %s VM not supported; %s VM will be used\n", - jvmtype, knownVMs[0].name + 1); - } - /* fall through */ - case VM_IGNORE: - jvmtype = knownVMs[jvmidx=0].name + 1; - /* fall through */ - case VM_KNOWN: - break; - case VM_ERROR: - if (!speculative) { - ReportErrorMessage2("Error: %s VM not supported", jvmtype, JNI_TRUE); - exit(1); - } else { - return "ERROR"; - } - } - - return jvmtype; -} - -# define KB (1024UL) -# define MB (1024UL * KB) -# define GB (1024UL * MB) - -/* copied from HotSpot function "atomll()" */ -static int -parse_stack_size(const char *s, jlong *result) { - jlong n = 0; - int args_read = sscanf(s, jlong_format_specifier(), &n); - if (args_read != 1) { - return 0; - } - while (*s != '\0' && *s >= '0' && *s <= '9') { - s++; - } - // 4705540: illegal if more characters are found after the first non-digit - if (strlen(s) > 1) { - return 0; - } - switch (*s) { - case 'T': case 't': - *result = n * GB * KB; - return 1; - case 'G': case 'g': - *result = n * GB; - return 1; - case 'M': case 'm': - *result = n * MB; - return 1; - case 'K': case 'k': - *result = n * KB; - return 1; - case '\0': - *result = n; - return 1; - default: - /* Create JVM with default stack and let VM handle malformed -Xss string*/ - return 0; - } -} - -/* - * Adds a new VM option with the given given name and value. - */ -void -AddOption(char *str, void *info) -{ - /* - * Expand options array if needed to accommodate at least one more - * VM option. - */ - if (numOptions >= maxOptions) { - if (options == 0) { - maxOptions = 4; - options = JLI_MemAlloc(maxOptions * sizeof(JavaVMOption)); - } else { - JavaVMOption *tmp; - maxOptions *= 2; - tmp = JLI_MemAlloc(maxOptions * sizeof(JavaVMOption)); - memcpy(tmp, options, numOptions * sizeof(JavaVMOption)); - JLI_MemFree(options); - options = tmp; - } - } - options[numOptions].optionString = str; - options[numOptions++].extraInfo = info; - - if (strncmp(str, "-Xss", 4) == 0) { - jlong tmp; - if (parse_stack_size(str + 4, &tmp)) { - threadStackSize = tmp; - } - } -} - -static void -SetClassPath(const char *s) -{ - char *def; - s = JLI_WildcardExpandClasspath(s); - def = JLI_MemAlloc(strlen(s) + 40); - sprintf(def, "-Djava.class.path=%s", s); - AddOption(def, NULL); -} - -/* - * The SelectVersion() routine ensures that an appropriate version of - * the JRE is running. The specification for the appropriate version - * is obtained from either the manifest of a jar file (preferred) or - * from command line options. - * The routine also parses splash screen command line options and - * passes on their values in private environment variables. - */ -static void -SelectVersion(int argc, char **argv, char **main_class) -{ - char *arg; - char **new_argv; - char **new_argp; - char *operand; - char *version = NULL; - char *jre = NULL; - int jarflag = 0; - int headlessflag = 0; - int restrict_search = -1; /* -1 implies not known */ - manifest_info info; - char env_entry[MAXNAMELEN + 24] = ENV_ENTRY "="; - char *splash_file_name = NULL; - char *splash_jar_name = NULL; - char *env_in; - int res; - - /* - * If the version has already been selected, set *main_class - * with the value passed through the environment (if any) and - * simply return. - */ - if ((env_in = getenv(ENV_ENTRY)) != NULL) { - if (*env_in != '\0') - *main_class = JLI_StringDup(env_in); - return; - } - - /* - * Scan through the arguments for options relevant to multiple JRE - * support. For reference, the command line syntax is defined as: - * - * SYNOPSIS - * java [options] class [argument...] - * - * java [options] -jar file.jar [argument...] - * - * As the scan is performed, make a copy of the argument list with - * the version specification options (new to 1.5) removed, so that - * a version less than 1.5 can be exec'd. - * - * Note that due to the syntax of the native Windows interface - * CreateProcess(), processing similar to the following exists in - * the Windows platform specific routine ExecJRE (in java_md.c). - * Changes here should be reproduced there. - */ - new_argv = JLI_MemAlloc((argc + 1) * sizeof(char*)); - new_argv[0] = argv[0]; - new_argp = &new_argv[1]; - argc--; - argv++; - while ((arg = *argv) != 0 && *arg == '-') { - if (strncmp(arg, "-version:", 9) == 0) { - version = arg + 9; - } else if (strcmp(arg, "-jre-restrict-search") == 0) { - restrict_search = 1; - } else if (strcmp(arg, "-no-jre-restrict-search") == 0) { - restrict_search = 0; - } else { - if (strcmp(arg, "-jar") == 0) - jarflag = 1; - /* deal with "unfortunate" classpath syntax */ - if ((strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) && - (argc >= 2)) { - *new_argp++ = arg; - argc--; - argv++; - arg = *argv; - } - - /* - * Checking for headless toolkit option in the some way as AWT does: - * "true" means true and any other value means false - */ - if (strcmp(arg, "-Djava.awt.headless=true") == 0) { - headlessflag = 1; - } else if (strncmp(arg, "-Djava.awt.headless=", 20) == 0) { - headlessflag = 0; - } else if (strncmp(arg, "-splash:", 8) == 0) { - splash_file_name = arg+8; - } - *new_argp++ = arg; - } - argc--; - argv++; - } - if (argc <= 0) { /* No operand? Possibly legit with -[full]version */ - operand = NULL; - } else { - argc--; - *new_argp++ = operand = *argv++; - } - while (argc-- > 0) /* Copy over [argument...] */ - *new_argp++ = *argv++; - *new_argp = NULL; - - /* - * If there is a jar file, read the manifest. If the jarfile can't be - * read, the manifest can't be read from the jar file, or the manifest - * is corrupt, issue the appropriate error messages and exit. - * - * Even if there isn't a jar file, construct a manifest_info structure - * containing the command line information. It's a convenient way to carry - * this data around. - */ - if (jarflag && operand) { - if ((res = JLI_ParseManifest(operand, &info)) != 0) { - if (res == -1) - ReportErrorMessage2("Unable to access jarfile %s", - operand, JNI_TRUE); - else - ReportErrorMessage2("Invalid or corrupt jarfile %s", - operand, JNI_TRUE); - exit(1); - } - - /* - * Command line splash screen option should have precedence - * over the manifest, so the manifest data is used only if - * splash_file_name has not been initialized above during command - * line parsing - */ - if (!headlessflag && !splash_file_name && info.splashscreen_image_file_name) { - splash_file_name = info.splashscreen_image_file_name; - splash_jar_name = operand; - } - } else { - info.manifest_version = NULL; - info.main_class = NULL; - info.jre_version = NULL; - info.jre_restrict_search = 0; - } - - /* - * Passing on splash screen info in environment variables - */ - if (splash_file_name && !headlessflag) { - char* splash_file_entry = JLI_MemAlloc(strlen(SPLASH_FILE_ENV_ENTRY "=")+strlen(splash_file_name)+1); - strcpy(splash_file_entry, SPLASH_FILE_ENV_ENTRY "="); - strcat(splash_file_entry, splash_file_name); - putenv(splash_file_entry); - } - if (splash_jar_name && !headlessflag) { - char* splash_jar_entry = JLI_MemAlloc(strlen(SPLASH_JAR_ENV_ENTRY "=")+strlen(splash_jar_name)+1); - strcpy(splash_jar_entry, SPLASH_JAR_ENV_ENTRY "="); - strcat(splash_jar_entry, splash_jar_name); - putenv(splash_jar_entry); - } - - /* - * The JRE-Version and JRE-Restrict-Search values (if any) from the - * manifest are overwritten by any specified on the command line. - */ - if (version != NULL) - info.jre_version = version; - if (restrict_search != -1) - info.jre_restrict_search = restrict_search; - - /* - * "Valid" returns (other than unrecoverable errors) follow. Set - * main_class as a side-effect of this routine. - */ - if (info.main_class != NULL) - *main_class = JLI_StringDup(info.main_class); - - /* - * If no version selection information is found either on the command - * line or in the manifest, simply return. - */ - if (info.jre_version == NULL) { - JLI_FreeManifest(); - JLI_MemFree(new_argv); - return; - } - - /* - * Check for correct syntax of the version specification (JSR 56). - */ - if (!JLI_ValidVersionString(info.jre_version)) { - ReportErrorMessage2("Syntax error in version specification \"%s\"", - info.jre_version, JNI_TRUE); - exit(1); - } - - /* - * Find the appropriate JVM on the system. Just to be as forgiving as - * possible, if the standard algorithms don't locate an appropriate - * jre, check to see if the one running will satisfy the requirements. - * This can happen on systems which haven't been set-up for multiple - * JRE support. - */ - jre = LocateJRE(&info); - if (_launcher_debug) - printf("JRE-Version = %s, JRE-Restrict-Search = %s Selected = %s\n", - (info.jre_version?info.jre_version:"null"), - (info.jre_restrict_search?"true":"false"), (jre?jre:"null")); - if (jre == NULL) { - if (JLI_AcceptableRelease(FULL_VERSION, info.jre_version)) { - JLI_FreeManifest(); - JLI_MemFree(new_argv); - return; - } else { - ReportErrorMessage2( - "Unable to locate JRE meeting specification \"%s\"", - info.jre_version, JNI_TRUE); - exit(1); - } - } - - /* - * If I'm not the chosen one, exec the chosen one. Returning from - * ExecJRE indicates that I am indeed the chosen one. - * - * The private environment variable _JAVA_VERSION_SET is used to - * prevent the chosen one from re-reading the manifest file and - * using the values found within to override the (potential) command - * line flags stripped from argv (because the target may not - * understand them). Passing the MainClass value is an optimization - * to avoid locating, expanding and parsing the manifest extra - * times. - */ - if (info.main_class != NULL) { - if (strlen(info.main_class) <= MAXNAMELEN) { - (void)strcat(env_entry, info.main_class); - } else { - ReportErrorMessage("Error: main-class: attribute exceeds system limits\n", JNI_TRUE); - exit(1); - } - } - (void)putenv(env_entry); - ExecJRE(jre, new_argv); - JLI_FreeManifest(); - JLI_MemFree(new_argv); - return; -} - -/* - * Parses command line arguments. Returns JNI_FALSE if launcher - * should exit without starting vm, returns JNI_TRUE if vm needs - * to be started to process given options. *pret (the launcher - * process return value) is set to 0 for a normal exit. - */ -static jboolean -ParseArguments(int *pargc, char ***pargv, char **pjarfile, - char **pclassname, int *pret, const char *jvmpath) -{ - int argc = *pargc; - char **argv = *pargv; - jboolean jarflag = JNI_FALSE; - char *arg; - - *pret = 0; - - while ((arg = *argv) != 0 && *arg == '-') { - argv++; --argc; - if (strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) { - if (argc < 1) { - ReportErrorMessage2("%s requires class path specification", - arg, JNI_TRUE); - printUsage = JNI_TRUE; - *pret = 1; - return JNI_TRUE; - } - SetClassPath(*argv); - argv++; --argc; - } else if (strcmp(arg, "-jar") == 0) { - jarflag = JNI_TRUE; - } else if (strcmp(arg, "-help") == 0 || - strcmp(arg, "-h") == 0 || - strcmp(arg, "-?") == 0) { - printUsage = JNI_TRUE; - return JNI_TRUE; - } else if (strcmp(arg, "-version") == 0) { - printVersion = JNI_TRUE; - return JNI_TRUE; - } else if (strcmp(arg, "-showversion") == 0) { - showVersion = JNI_TRUE; - } else if (strcmp(arg, "-X") == 0) { - printXUsage = JNI_TRUE; - return JNI_TRUE; -/* - * The following case provide backward compatibility with old-style - * command line options. - */ - } else if (strcmp(arg, "-fullversion") == 0) { - fprintf(stderr, "%s full version \"%s\"\n", launchername, - FULL_VERSION); - return JNI_FALSE; - } else if (strcmp(arg, "-verbosegc") == 0) { - AddOption("-verbose:gc", NULL); - } else if (strcmp(arg, "-t") == 0) { - AddOption("-Xt", NULL); - } else if (strcmp(arg, "-tm") == 0) { - AddOption("-Xtm", NULL); - } else if (strcmp(arg, "-debug") == 0) { - AddOption("-Xdebug", NULL); - } else if (strcmp(arg, "-noclassgc") == 0) { - AddOption("-Xnoclassgc", NULL); - } else if (strcmp(arg, "-Xfuture") == 0) { - AddOption("-Xverify:all", NULL); - } else if (strcmp(arg, "-verify") == 0) { - AddOption("-Xverify:all", NULL); - } else if (strcmp(arg, "-verifyremote") == 0) { - AddOption("-Xverify:remote", NULL); - } else if (strcmp(arg, "-noverify") == 0) { - AddOption("-Xverify:none", NULL); - } else if (strcmp(arg, "-XXsuppressExitMessage") == 0) { - noExitErrorMessage = 1; - } else if (strncmp(arg, "-prof", 5) == 0) { - char *p = arg + 5; - char *tmp = JLI_MemAlloc(strlen(arg) + 50); - if (*p) { - sprintf(tmp, "-Xrunhprof:cpu=old,file=%s", p + 1); - } else { - sprintf(tmp, "-Xrunhprof:cpu=old,file=java.prof"); - } - AddOption(tmp, NULL); - } else if (strncmp(arg, "-ss", 3) == 0 || - strncmp(arg, "-oss", 4) == 0 || - strncmp(arg, "-ms", 3) == 0 || - strncmp(arg, "-mx", 3) == 0) { - char *tmp = JLI_MemAlloc(strlen(arg) + 6); - sprintf(tmp, "-X%s", arg + 1); /* skip '-' */ - AddOption(tmp, NULL); - } else if (strcmp(arg, "-checksource") == 0 || - strcmp(arg, "-cs") == 0 || - strcmp(arg, "-noasyncgc") == 0) { - /* No longer supported */ - fprintf(stderr, - "Warning: %s option is no longer supported.\n", - arg); - } else if (strncmp(arg, "-version:", 9) == 0 || - strcmp(arg, "-no-jre-restrict-search") == 0 || - strcmp(arg, "-jre-restrict-search") == 0 || - strncmp(arg, "-splash:", 8) == 0) { - ; /* Ignore machine independent options already handled */ - } else if (RemovableMachineDependentOption(arg) ) { - ; /* Do not pass option to vm. */ - } - else { - AddOption(arg, NULL); - } - } - - if (--argc >= 0) { - if (jarflag) { - *pjarfile = *argv++; - *pclassname = 0; - } else { - *pjarfile = 0; - *pclassname = *argv++; - } - *pargc = argc; - *pargv = argv; - } - - return JNI_TRUE; -} - -/* - * Initializes the Java Virtual Machine. Also frees options array when - * finished. - */ -static jboolean -InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn) -{ - JavaVMInitArgs args; - jint r; - - memset(&args, 0, sizeof(args)); - args.version = JNI_VERSION_1_2; - args.nOptions = numOptions; - args.options = options; - args.ignoreUnrecognized = JNI_FALSE; - - if (_launcher_debug) { - int i = 0; - printf("JavaVM args:\n "); - printf("version 0x%08lx, ", (long)args.version); - printf("ignoreUnrecognized is %s, ", - args.ignoreUnrecognized ? "JNI_TRUE" : "JNI_FALSE"); - printf("nOptions is %ld\n", (long)args.nOptions); - for (i = 0; i < numOptions; i++) - printf(" option[%2d] = '%s'\n", - i, args.options[i].optionString); - } - - r = ifn->CreateJavaVM(pvm, (void **)penv, &args); - JLI_MemFree(options); - return r == JNI_OK; -} - -#define JNI_ERROR "Error: A JNI error has occurred, please check your installation and try again" - -#define NULL_CHECK0(e) if ((e) == 0) { \ - ReportErrorMessage(JNI_ERROR, JNI_TRUE); \ - return 0; \ - } - -#define NULL_CHECK(e) if ((e) == 0) { \ - ReportErrorMessage(JNI_ERROR, JNI_TRUE); \ - return; \ - } - -static jstring platformEncoding = NULL; -static jstring getPlatformEncoding(JNIEnv *env) { - if (platformEncoding == NULL) { - jstring propname = (*env)->NewStringUTF(env, "sun.jnu.encoding"); - if (propname) { - jclass cls; - jmethodID mid; - NULL_CHECK0 (cls = (*env)->FindClass(env, "java/lang/System")); - NULL_CHECK0 (mid = (*env)->GetStaticMethodID( - env, cls, - "getProperty", - "(Ljava/lang/String;)Ljava/lang/String;")); - platformEncoding = (*env)->CallStaticObjectMethod ( - env, cls, mid, propname); - } - } - return platformEncoding; -} - -static jboolean isEncodingSupported(JNIEnv *env, jstring enc) { - jclass cls; - jmethodID mid; - NULL_CHECK0 (cls = (*env)->FindClass(env, "java/nio/charset/Charset")); - NULL_CHECK0 (mid = (*env)->GetStaticMethodID( - env, cls, - "isSupported", - "(Ljava/lang/String;)Z")); - return (*env)->CallStaticBooleanMethod(env, cls, mid, enc); -} - -/* - * Returns a new Java string object for the specified platform string. - */ -static jstring -NewPlatformString(JNIEnv *env, char *s) -{ - int len = (int)strlen(s); - jclass cls; - jmethodID mid; - jbyteArray ary; - jstring enc; - - if (s == NULL) - return 0; - enc = getPlatformEncoding(env); - - ary = (*env)->NewByteArray(env, len); - if (ary != 0) { - jstring str = 0; - (*env)->SetByteArrayRegion(env, ary, 0, len, (jbyte *)s); - if (!(*env)->ExceptionOccurred(env)) { - if (isEncodingSupported(env, enc) == JNI_TRUE) { - NULL_CHECK0(cls = (*env)->FindClass(env, "java/lang/String")); - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "", - "([BLjava/lang/String;)V")); - str = (*env)->NewObject(env, cls, mid, ary, enc); - } else { - /*If the encoding specified in sun.jnu.encoding is not - endorsed by "Charset.isSupported" we have to fall back - to use String(byte[]) explicitly here without specifying - the encoding name, in which the StringCoding class will - pickup the iso-8859-1 as the fallback converter for us. - */ - NULL_CHECK0(cls = (*env)->FindClass(env, "java/lang/String")); - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "", - "([B)V")); - str = (*env)->NewObject(env, cls, mid, ary); - } - (*env)->DeleteLocalRef(env, ary); - return str; - } - } - return 0; -} - -/* - * Returns a new array of Java string objects for the specified - * array of platform strings. - */ -static jobjectArray -NewPlatformStringArray(JNIEnv *env, char **strv, int strc) -{ - jarray cls; - jarray ary; - int i; - - NULL_CHECK0(cls = (*env)->FindClass(env, "java/lang/String")); - NULL_CHECK0(ary = (*env)->NewObjectArray(env, strc, cls, 0)); - for (i = 0; i < strc; i++) { - jstring str = NewPlatformString(env, *strv++); - NULL_CHECK0(str); - (*env)->SetObjectArrayElement(env, ary, i, str); - (*env)->DeleteLocalRef(env, str); - } - return ary; -} - -/* - * Loads a class, convert the '.' to '/'. - */ -static jclass -LoadClass(JNIEnv *env, char *name) -{ - char *buf = JLI_MemAlloc(strlen(name) + 1); - char *s = buf, *t = name, c; - jclass cls; - jlong start, end; - - if (_launcher_debug) - start = CounterGet(); - - do { - c = *t++; - *s++ = (c == '.') ? '/' : c; - } while (c != '\0'); - cls = (*env)->FindClass(env, buf); - JLI_MemFree(buf); - - if (_launcher_debug) { - end = CounterGet(); - printf("%ld micro seconds to load main class\n", - (long)(jint)Counter2Micros(end-start)); - printf("----_JAVA_LAUNCHER_DEBUG----\n"); - } - - return cls; -} - - -/* - * Returns the main class name for the specified jar file. - */ -static jstring -GetMainClassName(JNIEnv *env, char *jarname) -{ -#define MAIN_CLASS "Main-Class" - jclass cls; - jmethodID mid; - jobject jar, man, attr; - jstring str, result = 0; - - NULL_CHECK0(cls = (*env)->FindClass(env, "java/util/jar/JarFile")); - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "", - "(Ljava/lang/String;)V")); - NULL_CHECK0(str = NewPlatformString(env, jarname)); - NULL_CHECK0(jar = (*env)->NewObject(env, cls, mid, str)); - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "getManifest", - "()Ljava/util/jar/Manifest;")); - man = (*env)->CallObjectMethod(env, jar, mid); - if (man != 0) { - NULL_CHECK0(mid = (*env)->GetMethodID(env, - (*env)->GetObjectClass(env, man), - "getMainAttributes", - "()Ljava/util/jar/Attributes;")); - attr = (*env)->CallObjectMethod(env, man, mid); - if (attr != 0) { - NULL_CHECK0(mid = (*env)->GetMethodID(env, - (*env)->GetObjectClass(env, attr), - "getValue", - "(Ljava/lang/String;)Ljava/lang/String;")); - NULL_CHECK0(str = NewPlatformString(env, MAIN_CLASS)); - result = (*env)->CallObjectMethod(env, attr, mid, str); - } - } - return result; -} - -#ifdef JAVA_ARGS -static char *java_args[] = JAVA_ARGS; -static char *app_classpath[] = APP_CLASSPATH; - -/* - * For tools, convert command line args thus: - * javac -cp foo:foo/"*" -J-ms32m ... - * java -ms32m -cp JLI_WildcardExpandClasspath(foo:foo/"*") ... - */ -static void -TranslateApplicationArgs(int *pargc, char ***pargv) -{ - const int NUM_ARGS = (sizeof(java_args) / sizeof(char *)); - int argc = *pargc; - char **argv = *pargv; - int nargc = argc + NUM_ARGS; - char **nargv = JLI_MemAlloc((nargc + 1) * sizeof(char *)); - int i; - - *pargc = nargc; - *pargv = nargv; - - /* Copy the VM arguments (i.e. prefixed with -J) */ - for (i = 0; i < NUM_ARGS; i++) { - char *arg = java_args[i]; - if (arg[0] == '-' && arg[1] == 'J') { - *nargv++ = arg + 2; - } - } - - for (i = 0; i < argc; i++) { - char *arg = argv[i]; - if (arg[0] == '-' && arg[1] == 'J') { - if (arg[2] == '\0') { - ReportErrorMessage("Error: the -J option should not be " - "followed by a space.", JNI_TRUE); - exit(1); - } - *nargv++ = arg + 2; - } - } - - /* Copy the rest of the arguments */ - for (i = 0; i < NUM_ARGS; i++) { - char *arg = java_args[i]; - if (arg[0] != '-' || arg[1] != 'J') { - *nargv++ = arg; - } - } - for (i = 0; i < argc; i++) { - char *arg = argv[i]; - if (arg[0] == '-') { - if (arg[1] == 'J') - continue; -#ifdef EXPAND_CLASSPATH_WILDCARDS - if (arg[1] == 'c' - && (strcmp(arg, "-cp") == 0 || - strcmp(arg, "-classpath") == 0) - && i < argc - 1) { - *nargv++ = arg; - *nargv++ = (char *) JLI_WildcardExpandClasspath(argv[i+1]); - i++; - continue; - } -#endif - } - *nargv++ = arg; - } - *nargv = 0; -} - -/* - * For our tools, we try to add 3 VM options: - * -Denv.class.path= - * -Dapplication.home= - * -Djava.class.path= - * is the user's setting of CLASSPATH -- for instance the user - * tells javac where to find binary classes through this environment - * variable. Notice that users will be able to compile against our - * tools classes (sun.tools.javac.Main) only if they explicitly add - * tools.jar to CLASSPATH. - * is the directory where the application is installed. - * is the classpath to where our apps' classfiles are. - */ -static jboolean -AddApplicationOptions() -{ - const int NUM_APP_CLASSPATH = (sizeof(app_classpath) / sizeof(char *)); - char *envcp, *appcp, *apphome; - char home[MAXPATHLEN]; /* application home */ - char separator[] = { PATH_SEPARATOR, '\0' }; - int size, i; - int strlenHome; - - { - const char *s = getenv("CLASSPATH"); - if (s) { - s = (char *) JLI_WildcardExpandClasspath(s); - /* 40 for -Denv.class.path= */ - envcp = (char *)JLI_MemAlloc(strlen(s) + 40); - sprintf(envcp, "-Denv.class.path=%s", s); - AddOption(envcp, NULL); - } - } - - if (!GetApplicationHome(home, sizeof(home))) { - ReportErrorMessage("Can't determine application home", JNI_TRUE); - return JNI_FALSE; - } - - /* 40 for '-Dapplication.home=' */ - apphome = (char *)JLI_MemAlloc(strlen(home) + 40); - sprintf(apphome, "-Dapplication.home=%s", home); - AddOption(apphome, NULL); - - /* How big is the application's classpath? */ - size = 40; /* 40: "-Djava.class.path=" */ - strlenHome = (int)strlen(home); - for (i = 0; i < NUM_APP_CLASSPATH; i++) { - size += strlenHome + (int)strlen(app_classpath[i]) + 1; /* 1: separator */ - } - appcp = (char *)JLI_MemAlloc(size + 1); - strcpy(appcp, "-Djava.class.path="); - for (i = 0; i < NUM_APP_CLASSPATH; i++) { - strcat(appcp, home); /* c:\program files\myapp */ - strcat(appcp, app_classpath[i]); /* \lib\myapp.jar */ - strcat(appcp, separator); /* ; */ - } - appcp[strlen(appcp)-1] = '\0'; /* remove trailing path separator */ - AddOption(appcp, NULL); - return JNI_TRUE; -} -#endif /* JAVA_ARGS */ - -/* - * inject the -Dsun.java.command pseudo property into the args structure - * this pseudo property is used in the HotSpot VM to expose the - * Java class name and arguments to the main method to the VM. The - * HotSpot VM uses this pseudo property to store the Java class name - * (or jar file name) and the arguments to the class's main method - * to the instrumentation memory region. The sun.java.command pseudo - * property is not exported by HotSpot to the Java layer. - */ -void -SetJavaCommandLineProp(char *classname, char *jarfile, - int argc, char **argv) -{ - - int i = 0; - size_t len = 0; - char* javaCommand = NULL; - char* dashDstr = "-Dsun.java.command="; - - if (classname == NULL && jarfile == NULL) { - /* unexpected, one of these should be set. just return without - * setting the property - */ - return; - } - - /* if the class name is not set, then use the jarfile name */ - if (classname == NULL) { - classname = jarfile; - } - - /* determine the amount of memory to allocate assuming - * the individual components will be space separated - */ - len = strlen(classname); - for (i = 0; i < argc; i++) { - len += strlen(argv[i]) + 1; - } - - /* allocate the memory */ - javaCommand = (char*) JLI_MemAlloc(len + strlen(dashDstr) + 1); - - /* build the -D string */ - *javaCommand = '\0'; - strcat(javaCommand, dashDstr); - strcat(javaCommand, classname); - - for (i = 0; i < argc; i++) { - /* the components of the string are space separated. In - * the case of embedded white space, the relationship of - * the white space separated components to their true - * positional arguments will be ambiguous. This issue may - * be addressed in a future release. - */ - strcat(javaCommand, " "); - strcat(javaCommand, argv[i]); - } - - AddOption(javaCommand, NULL); -} - -/* - * JVM would like to know if it's created by a standard Sun launcher, or by - * user native application, the following property indicates the former. - */ -void SetJavaLauncherProp() { - AddOption("-Dsun.java.launcher=SUN_STANDARD", NULL); -} - -/* - * Prints the version information from the java.version and other properties. - */ -static void -PrintJavaVersion(JNIEnv *env) -{ - jclass ver; - jmethodID print; - - NULL_CHECK(ver = (*env)->FindClass(env, "sun/misc/Version")); - NULL_CHECK(print = (*env)->GetStaticMethodID(env, ver, "print", "()V")); - - (*env)->CallStaticVoidMethod(env, ver, print); -} - -/* - * Prints default usage or the Xusage message, see sun.launcher.LauncherHelp.java - */ -static void -PrintUsage(JNIEnv* env, jboolean doXUsage) -{ - jclass cls; - jmethodID initHelp, vmSelect, vmSynonym, vmErgo, printHelp, printXUsageMessage; - jstring jprogname, vm1, vm2; - int i; - - NULL_CHECK(cls = (*env)->FindClass(env, "sun/launcher/LauncherHelp")); - - - if (doXUsage) { - NULL_CHECK(printXUsageMessage = (*env)->GetStaticMethodID(env, cls, - "printXUsageMessage", "(Z)V")); - (*env)->CallStaticVoidMethod(env, cls, printXUsageMessage, JNI_TRUE); - } else { - NULL_CHECK(initHelp = (*env)->GetStaticMethodID(env, cls, - "initHelpMessage", "(Ljava/lang/String;)V")); - - NULL_CHECK(vmSelect = (*env)->GetStaticMethodID(env, cls, "appendVmSelectMessage", - "(Ljava/lang/String;Ljava/lang/String;)V")); - - NULL_CHECK(vmSynonym = (*env)->GetStaticMethodID(env, cls, - "appendVmSynonymMessage", - "(Ljava/lang/String;Ljava/lang/String;)V")); - NULL_CHECK(vmErgo = (*env)->GetStaticMethodID(env, cls, - "appendVmErgoMessage", "(ZLjava/lang/String;)V")); - - NULL_CHECK(printHelp = (*env)->GetStaticMethodID(env, cls, - "printHelpMessage", "(Z)V")); - - jprogname = (*env)->NewStringUTF(env, progname); - - /* Initialize the usage message with the usual preamble */ - (*env)->CallStaticVoidMethod(env, cls, initHelp, jprogname); - - - /* Assemble the other variant part of the usage */ - if ((knownVMs[0].flag == VM_KNOWN) || - (knownVMs[0].flag == VM_IF_SERVER_CLASS)) { - vm1 = (*env)->NewStringUTF(env, knownVMs[0].name); - vm2 = (*env)->NewStringUTF(env, knownVMs[0].name+1); - (*env)->CallStaticVoidMethod(env, cls, vmSelect, vm1, vm2); - } - for (i=1; iNewStringUTF(env, knownVMs[i].name); - vm2 = (*env)->NewStringUTF(env, knownVMs[i].name+1); - (*env)->CallStaticVoidMethod(env, cls, vmSelect, vm1, vm2); - } - } - for (i=1; iNewStringUTF(env, knownVMs[i].name); - vm2 = (*env)->NewStringUTF(env, knownVMs[i].alias+1); - (*env)->CallStaticVoidMethod(env, cls, vmSynonym, vm1, vm2); - } - } - - /* The first known VM is the default */ - { - jboolean isServerClassMachine = ServerClassMachine(); - - const char* defaultVM = knownVMs[0].name+1; - if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) && isServerClassMachine) { - defaultVM = knownVMs[0].server_class+1; - } - - vm1 = (*env)->NewStringUTF(env, defaultVM); - (*env)->CallStaticVoidMethod(env, cls, vmErgo, isServerClassMachine, vm1); - } - - /* Complete the usage message and print to stderr*/ - (*env)->CallStaticVoidMethod(env, cls, printHelp, JNI_TRUE); - } - return; -} - -/* - * Read the jvm.cfg file and fill the knownJVMs[] array. - * - * The functionality of the jvm.cfg file is subject to change without - * notice and the mechanism will be removed in the future. - * - * The lexical structure of the jvm.cfg file is as follows: - * - * jvmcfg := { vmLine } - * vmLine := knownLine - * | aliasLine - * | warnLine - * | ignoreLine - * | errorLine - * | predicateLine - * | commentLine - * knownLine := flag "KNOWN" EOL - * warnLine := flag "WARN" EOL - * ignoreLine := flag "IGNORE" EOL - * errorLine := flag "ERROR" EOL - * aliasLine := flag "ALIASED_TO" flag EOL - * predicateLine := flag "IF_SERVER_CLASS" flag EOL - * commentLine := "#" text EOL - * flag := "-" identifier - * - * The semantics are that when someone specifies a flag on the command line: - * - if the flag appears on a knownLine, then the identifier is used as - * the name of the directory holding the JVM library (the name of the JVM). - * - if the flag appears as the first flag on an aliasLine, the identifier - * of the second flag is used as the name of the JVM. - * - if the flag appears on a warnLine, the identifier is used as the - * name of the JVM, but a warning is generated. - * - if the flag appears on an ignoreLine, the identifier is recognized as the - * name of a JVM, but the identifier is ignored and the default vm used - * - if the flag appears on an errorLine, an error is generated. - * - if the flag appears as the first flag on a predicateLine, and - * the machine on which you are running passes the predicate indicated, - * then the identifier of the second flag is used as the name of the JVM, - * otherwise the identifier of the first flag is used as the name of the JVM. - * If no flag is given on the command line, the first vmLine of the jvm.cfg - * file determines the name of the JVM. - * PredicateLines are only interpreted on first vmLine of a jvm.cfg file, - * since they only make sense if someone hasn't specified the name of the - * JVM on the command line. - * - * The intent of the jvm.cfg file is to allow several JVM libraries to - * be installed in different subdirectories of a single JRE installation, - * for space-savings and convenience in testing. - * The intent is explicitly not to provide a full aliasing or predicate - * mechanism. - */ -jint -ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative) -{ - FILE *jvmCfg; - char jvmCfgName[MAXPATHLEN+20]; - char line[MAXPATHLEN+20]; - int cnt = 0; - int lineno = 0; - jlong start, end; - int vmType; - char *tmpPtr; - char *altVMName = NULL; - char *serverClassVMName = NULL; - static char *whiteSpace = " \t"; - if (_launcher_debug) { - start = CounterGet(); - } - - strcpy(jvmCfgName, jrepath); - strcat(jvmCfgName, FILESEP "lib" FILESEP); - strcat(jvmCfgName, arch); - strcat(jvmCfgName, FILESEP "jvm.cfg"); - - jvmCfg = fopen(jvmCfgName, "r"); - if (jvmCfg == NULL) { - if (!speculative) { - ReportErrorMessage2("Error: could not open `%s'", jvmCfgName, - JNI_TRUE); - exit(1); - } else { - return -1; - } - } - while (fgets(line, sizeof(line), jvmCfg) != NULL) { - vmType = VM_UNKNOWN; - lineno++; - if (line[0] == '#') - continue; - if (line[0] != '-') { - fprintf(stderr, "Warning: no leading - on line %d of `%s'\n", - lineno, jvmCfgName); - } - if (cnt >= knownVMsLimit) { - GrowKnownVMs(cnt); - } - line[strlen(line)-1] = '\0'; /* remove trailing newline */ - tmpPtr = line + strcspn(line, whiteSpace); - if (*tmpPtr == 0) { - fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n", - lineno, jvmCfgName); - } else { - /* Null-terminate this string for JLI_StringDup below */ - *tmpPtr++ = 0; - tmpPtr += strspn(tmpPtr, whiteSpace); - if (*tmpPtr == 0) { - fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n", - lineno, jvmCfgName); - } else { - if (!strncmp(tmpPtr, "KNOWN", strlen("KNOWN"))) { - vmType = VM_KNOWN; - } else if (!strncmp(tmpPtr, "ALIASED_TO", strlen("ALIASED_TO"))) { - tmpPtr += strcspn(tmpPtr, whiteSpace); - if (*tmpPtr != 0) { - tmpPtr += strspn(tmpPtr, whiteSpace); - } - if (*tmpPtr == 0) { - fprintf(stderr, "Warning: missing VM alias on line %d of `%s'\n", - lineno, jvmCfgName); - } else { - /* Null terminate altVMName */ - altVMName = tmpPtr; - tmpPtr += strcspn(tmpPtr, whiteSpace); - *tmpPtr = 0; - vmType = VM_ALIASED_TO; - } - } else if (!strncmp(tmpPtr, "WARN", strlen("WARN"))) { - vmType = VM_WARN; - } else if (!strncmp(tmpPtr, "IGNORE", strlen("IGNORE"))) { - vmType = VM_IGNORE; - } else if (!strncmp(tmpPtr, "ERROR", strlen("ERROR"))) { - vmType = VM_ERROR; - } else if (!strncmp(tmpPtr, - "IF_SERVER_CLASS", - strlen("IF_SERVER_CLASS"))) { - tmpPtr += strcspn(tmpPtr, whiteSpace); - if (*tmpPtr != 0) { - tmpPtr += strspn(tmpPtr, whiteSpace); - } - if (*tmpPtr == 0) { - fprintf(stderr, "Warning: missing server class VM on line %d of `%s'\n", - lineno, jvmCfgName); - } else { - /* Null terminate server class VM name */ - serverClassVMName = tmpPtr; - tmpPtr += strcspn(tmpPtr, whiteSpace); - *tmpPtr = 0; - vmType = VM_IF_SERVER_CLASS; - } - } else { - fprintf(stderr, "Warning: unknown VM type on line %d of `%s'\n", - lineno, &jvmCfgName[0]); - vmType = VM_KNOWN; - } - } - } - - if (_launcher_debug) - printf("jvm.cfg[%d] = ->%s<-\n", cnt, line); - if (vmType != VM_UNKNOWN) { - knownVMs[cnt].name = JLI_StringDup(line); - knownVMs[cnt].flag = vmType; - switch (vmType) { - default: - break; - case VM_ALIASED_TO: - knownVMs[cnt].alias = JLI_StringDup(altVMName); - if (_launcher_debug) { - printf(" name: %s vmType: %s alias: %s\n", - knownVMs[cnt].name, "VM_ALIASED_TO", knownVMs[cnt].alias); - } - break; - case VM_IF_SERVER_CLASS: - knownVMs[cnt].server_class = JLI_StringDup(serverClassVMName); - if (_launcher_debug) { - printf(" name: %s vmType: %s server_class: %s\n", - knownVMs[cnt].name, "VM_IF_SERVER_CLASS", knownVMs[cnt].server_class); - } - break; - } - cnt++; - } - } - fclose(jvmCfg); - knownVMsCount = cnt; - - if (_launcher_debug) { - end = CounterGet(); - printf("%ld micro seconds to parse jvm.cfg\n", - (long)(jint)Counter2Micros(end-start)); - } - - return cnt; -} - - -static void -GrowKnownVMs(int minimum) -{ - struct vmdesc* newKnownVMs; - int newMax; - - newMax = (knownVMsLimit == 0 ? INIT_MAX_KNOWN_VMS : (2 * knownVMsLimit)); - if (newMax <= minimum) { - newMax = minimum; - } - newKnownVMs = (struct vmdesc*) JLI_MemAlloc(newMax * sizeof(struct vmdesc)); - if (knownVMs != NULL) { - memcpy(newKnownVMs, knownVMs, knownVMsLimit * sizeof(struct vmdesc)); - } - JLI_MemFree(knownVMs); - knownVMs = newKnownVMs; - knownVMsLimit = newMax; -} - - -/* Returns index of VM or -1 if not found */ -static int -KnownVMIndex(const char* name) -{ - int i; - if (strncmp(name, "-J", 2) == 0) name += 2; - for (i = 0; i < knownVMsCount; i++) { - if (!strcmp(name, knownVMs[i].name)) { - return i; - } - } - return -1; -} - -static void -FreeKnownVMs() -{ - int i; - for (i = 0; i < knownVMsCount; i++) { - JLI_MemFree(knownVMs[i].name); - knownVMs[i].name = NULL; - } - JLI_MemFree(knownVMs); -} - - -/* - * Displays the splash screen according to the jar file name - * and image file names stored in environment variables - */ -static void -ShowSplashScreen() -{ - const char *jar_name = getenv(SPLASH_JAR_ENV_ENTRY); - const char *file_name = getenv(SPLASH_FILE_ENV_ENTRY); - int data_size; - void *image_data; - if (jar_name) { - image_data = JLI_JarUnpackFile(jar_name, file_name, &data_size); - if (image_data) { - DoSplashInit(); - DoSplashLoadMemory(image_data, data_size); - JLI_MemFree(image_data); - } - } else if (file_name) { - DoSplashInit(); - DoSplashLoadFile(file_name); - } else { - return; - } - DoSplashSetFileJarName(file_name, jar_name); -} diff -Nru icedtea-web-1.3.2/launcher/java.h icedtea-web-1.4/launcher/java.h --- icedtea-web-1.3.2/launcher/java.h 2013-04-10 11:40:23.836668000 +0000 +++ icedtea-web-1.4/launcher/java.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -/* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#ifndef _JAVA_H_ -#define _JAVA_H_ - -/* - * Get system specific defines. - */ -#include "jni.h" -#include "java_md.h" -#include "jli_util.h" - -#include - -#define CURRENT_DATA_MODEL (CHAR_BIT * sizeof(void*)) - -/* - * Pointers to the needed JNI invocation API, initialized by LoadJavaVM. - */ -typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args); -typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args); - -typedef struct { - CreateJavaVM_t CreateJavaVM; - GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs; -} InvocationFunctions; - -/* - * Prototypes for launcher functions in the system specific java_md.c. - */ - -jboolean -LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn); - -void -GetXUsagePath(char *buf, jint bufsize); - -jboolean -GetApplicationHome(char *buf, jint bufsize); - -const char * -GetArch(); - -void CreateExecutionEnvironment(int *_argc, - char ***_argv, - char jrepath[], - jint so_jrepath, - char jvmpath[], - jint so_jvmpath, - char **original_argv); - -/* - * Report an error message to stderr or a window as appropriate. The - * flag always is set to JNI_TRUE if message is to be reported to both - * strerr and windows and set to JNI_FALSE if the message should only - * be sent to a window. - */ -void ReportErrorMessage(char * message, jboolean always); -void ReportErrorMessage2(char * format, char * string, jboolean always); - -/* - * Report an exception which terminates the vm to stderr or a window - * as appropriate. - */ -void ReportExceptionDescription(JNIEnv * env); - -jboolean RemovableMachineDependentOption(char * option); -void PrintMachineDependentOptions(); - -const char *jlong_format_specifier(); -/* - * Block current thread and continue execution in new thread - */ -int ContinueInNewThread(int (JNICALL *continuation)(void *), - jlong stack_size, void * args, int ret); - -/* sun.java.launcher.* platform properties. */ -void SetJavaLauncherPlatformProps(void); - -/* - * Functions defined in java.c and used in java_md.c. - */ -jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative); -char *CheckJvmType(int *argc, char ***argv, jboolean speculative); -void AddOption(char *str, void *info); - -/* - * Make launcher spit debug output. - */ -extern jboolean _launcher_debug; - -#endif /* _JAVA_H_ */ diff -Nru icedtea-web-1.3.2/launcher/java_md.c icedtea-web-1.4/launcher/java_md.c --- icedtea-web-1.3.2/launcher/java_md.c 2013-04-10 11:40:23.837668000 +0000 +++ icedtea-web-1.4/launcher/java_md.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1814 +0,0 @@ -/* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#include "java.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "manifest_info.h" -#include "version_comp.h" - -#ifdef __linux__ -#include -#else -#include -#endif - -#define JVM_DLL "libjvm.so" -#define JAVA_DLL "libjava.so" - -/* - * If a processor / os combination has the ability to run binaries of - * two data models and cohabitation of jre/jdk bits with both data - * models is supported, then DUAL_MODE is defined. When DUAL_MODE is - * defined, the architecture names for the narrow and wide version of - * the architecture are defined in LIBARCH64NAME and LIBARCH32NAME. Currently - * only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux - * i586/amd64 could be defined as DUAL_MODE but that is not the - * current policy. - */ - -#ifndef LIBARCHNAME -# error "The macro LIBARCHNAME was not defined on the compile line" -#endif - -#ifdef __sun -# define DUAL_MODE -# ifndef LIBARCH32NAME -# error "The macro LIBARCH32NAME was not defined on the compile line" -# endif -# ifndef LIBARCH64NAME -# error "The macro LIBARCH64NAME was not defined on the compile line" -# endif -# include -# include -# include -#endif - -/* pointer to environment */ -extern char **environ; - -/* - * A collection of useful strings. One should think of these as #define - * entries, but actual strings can be more efficient (with many compilers). - */ -#ifdef __linux__ -static const char *system_dir = "/usr/java"; -static const char *user_dir = "/java"; -#else /* Solaris */ -static const char *system_dir = "/usr/jdk"; -static const char *user_dir = "/jdk"; -#endif - -/* - * Flowchart of launcher execs and options processing on unix - * - * The selection of the proper vm shared library to open depends on - * several classes of command line options, including vm "flavor" - * options (-client, -server) and the data model options, -d32 and - * -d64, as well as a version specification which may have come from - * the command line or from the manifest of an executable jar file. - * The vm selection options are not passed to the running - * virtual machine; they must be screened out by the launcher. - * - * The version specification (if any) is processed first by the - * platform independent routine SelectVersion. This may result in - * the exec of the specified launcher version. - * - * Typically, the launcher execs at least once to ensure a suitable - * LD_LIBRARY_PATH is in effect for the process. The first exec - * screens out all the data model options; leaving the choice of data - * model implicit in the binary selected to run. However, in case no - * exec is done, the data model options are screened out before the vm - * is invoked. - * - * incoming argv ------------------------------ - * | | - * \|/ | - * CheckJVMType | - * (removes -client, -server, etc.) | - * \|/ - * CreateExecutionEnvironment - * (removes -d32 and -d64, - * determines desired data model, - * sets up LD_LIBRARY_PATH, - * and exec's) - * | - * -------------------------------------------- - * | - * \|/ - * exec child 1 incoming argv ----------------- - * | | - * \|/ | - * CheckJVMType | - * (removes -client, -server, etc.) | - * | \|/ - * | CreateExecutionEnvironment - * | (verifies desired data model - * | is running and acceptable - * | LD_LIBRARY_PATH; - * | no-op in child) - * | - * \|/ - * TranslateDashJArgs... - * (Prepare to pass args to vm) - * | - * | - * | - * \|/ - * ParseArguments - * (ignores -d32 and -d64, - * processes version options, - * creates argument list for vm, - * etc.) - * - */ - -static char *SetExecname(char **argv); -static char * GetExecname(); -static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize, char * arch); -static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative); -static jboolean GetIcedTeaWebJREPath(char *path, jint pathsize, char * arch, jboolean speculative); - -const char * -GetArch() -{ - return LIBARCHNAME; -} - -void -CreateExecutionEnvironment(int *_argcp, - char ***_argvp, - char jrepath[], - jint so_jrepath, - char jvmpath[], - jint so_jvmpath, - char **original_argv) { - /* - * First, determine if we are running the desired data model. If we - * are running the desired data model, all the error messages - * associated with calling GetJREPath, ReadKnownVMs, etc. should be - * output. However, if we are not running the desired data model, - * some of the errors should be suppressed since it is more - * informative to issue an error message based on whether or not the - * os/processor combination has dual mode capabilities. - */ - - char *execname = NULL; - int original_argc = *_argcp; - jboolean jvmpathExists; - - /* Compute the name of the executable */ - execname = SetExecname(*_argvp); - - /* Set the LD_LIBRARY_PATH environment variable, check data model - flags, and exec process, if needed */ - { - char *arch = (char *)GetArch(); /* like sparc or sparcv9 */ - char * jvmtype = NULL; - int argc = *_argcp; - char **argv = original_argv; - - char *runpath = NULL; /* existing effective LD_LIBRARY_PATH - setting */ - - int running = CURRENT_DATA_MODEL; - - int wanted = running; /* What data mode is being - asked for? Current model is - fine unless another model - is asked for */ - - char* new_runpath = NULL; /* desired new LD_LIBRARY_PATH string */ - char* newpath = NULL; /* path on new LD_LIBRARY_PATH */ - char* lastslash = NULL; - - char** newenvp = NULL; /* current environment */ - - char** newargv = NULL; - int newargc = 0; -#ifdef __sun - char* dmpath = NULL; /* data model specific LD_LIBRARY_PATH, - Solaris only */ -#endif - - /* - * Starting in 1.5, all unix platforms accept the -d32 and -d64 - * options. On platforms where only one data-model is supported - * (e.g. ia-64 Linux), using the flag for the other data model is - * an error and will terminate the program. - */ - - { /* open new scope to declare local variables */ - int i; - - newargv = (char **)JLI_MemAlloc((argc+1) * sizeof(*newargv)); - newargv[newargc++] = argv[0]; - - /* scan for data model arguments and remove from argument list; - last occurrence determines desired data model */ - for (i=1; i < argc; i++) { - - if (strcmp(argv[i], "-J-d64") == 0 || strcmp(argv[i], "-d64") == 0) { - wanted = 64; - continue; - } - if (strcmp(argv[i], "-J-d32") == 0 || strcmp(argv[i], "-d32") == 0) { - wanted = 32; - continue; - } - newargv[newargc++] = argv[i]; - -#ifdef JAVA_ARGS - if (argv[i][0] != '-') - continue; -#else - if (strcmp(argv[i], "-classpath") == 0 || strcmp(argv[i], "-cp") == 0) { - i++; - if (i >= argc) break; - newargv[newargc++] = argv[i]; - continue; - } - if (argv[i][0] != '-') { i++; break; } -#endif - } - - /* copy rest of args [i .. argc) */ - while (i < argc) { - newargv[newargc++] = argv[i++]; - } - newargv[newargc] = NULL; - - /* - * newargv has all proper arguments here - */ - - argc = newargc; - argv = newargv; - } - - /* If the data model is not changing, it is an error if the - jvmpath does not exist */ - if (wanted == running) { - /* Find out where the JRE is that we will be using. */ - if (!GetIcedTeaWebJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) { - fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n"); - exit(2); - } - - /* Find the specified JVM type */ - if (ReadKnownVMs(jrepath, arch, JNI_FALSE) < 1) { - fprintf(stderr, "Error: no known VMs. (check for corrupt jvm.cfg file)\n"); - exit(1); - } - - jvmpath[0] = '\0'; - jvmtype = CheckJvmType(_argcp, _argvp, JNI_FALSE); - - if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch )) { - fprintf(stderr, "Error: no `%s' JVM at `%s'.\n", jvmtype, jvmpath); - exit(4); - } - } else { /* do the same speculatively or exit */ -#ifdef DUAL_MODE - if (running != wanted) { - /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE)) { - goto EndDataModelSpeculate; - } - - /* - * Read in jvm.cfg for target data model and process vm - * selection options. - */ - if (ReadKnownVMs(jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE) < 1) { - goto EndDataModelSpeculate; - } - jvmpath[0] = '\0'; - jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE); - /* exec child can do error checking on the existence of the path */ - jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, - ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME)); - - } - EndDataModelSpeculate: /* give up and let other code report error message */ - ; -#else - fprintf(stderr, "This Java instance does not support a %d-bit JVM.\nPlease install the desired version.\n", wanted); - exit(1); -#endif - } - - /* - * We will set the LD_LIBRARY_PATH as follows: - * - * o $JVMPATH (directory portion only) - * o $JRE/lib/$LIBARCHNAME - * o $JRE/../lib/$LIBARCHNAME - * - * followed by the user's previous effective LD_LIBRARY_PATH, if - * any. - */ - -#ifdef __sun - /* - * Starting in Solaris 7, ld.so.1 supports three LD_LIBRARY_PATH - * variables: - * - * 1. LD_LIBRARY_PATH -- used for 32 and 64 bit searches if - * data-model specific variables are not set. - * - * 2. LD_LIBRARY_PATH_64 -- overrides and replaces LD_LIBRARY_PATH - * for 64-bit binaries. - * - * 3. LD_LIBRARY_PATH_32 -- overrides and replaces LD_LIBRARY_PATH - * for 32-bit binaries. - * - * The vm uses LD_LIBRARY_PATH to set the java.library.path system - * property. To shield the vm from the complication of multiple - * LD_LIBRARY_PATH variables, if the appropriate data model - * specific variable is set, we will act as if LD_LIBRARY_PATH had - * the value of the data model specific variant and the data model - * specific variant will be unset. Note that the variable for the - * *wanted* data model must be used (if it is set), not simply the - * current running data model. - */ - - switch(wanted) { - case 0: - if(running == 32) { - dmpath = getenv("LD_LIBRARY_PATH_32"); - wanted = 32; - } - else { - dmpath = getenv("LD_LIBRARY_PATH_64"); - wanted = 64; - } - break; - - case 32: - dmpath = getenv("LD_LIBRARY_PATH_32"); - break; - - case 64: - dmpath = getenv("LD_LIBRARY_PATH_64"); - break; - - default: - fprintf(stderr, "Improper value at line %d.", __LINE__); - exit(1); /* unknown value in wanted */ - break; - } - - /* - * If dmpath is NULL, the relevant data model specific variable is - * not set and normal LD_LIBRARY_PATH should be used. - */ - if( dmpath == NULL) { - runpath = getenv("LD_LIBRARY_PATH"); - } - else { - runpath = dmpath; - } -#else - /* - * If not on Solaris, assume only a single LD_LIBRARY_PATH - * variable. - */ - runpath = getenv("LD_LIBRARY_PATH"); -#endif /* __sun */ - -#ifdef __linux - /* - * On linux, if a binary is running as sgid or suid, glibc sets - * LD_LIBRARY_PATH to the empty string for security purposes. (In - * contrast, on Solaris the LD_LIBRARY_PATH variable for a - * privileged binary does not lose its settings; but the dynamic - * linker does apply more scrutiny to the path.) The launcher uses - * the value of LD_LIBRARY_PATH to prevent an exec loop. - * Therefore, if we are running sgid or suid, this function's - * setting of LD_LIBRARY_PATH will be ineffective and we should - * return from the function now. Getting the right libraries to - * be found must be handled through other mechanisms. - */ - if((getgid() != getegid()) || (getuid() != geteuid()) ) { - return; - } -#endif - - /* runpath contains current effective LD_LIBRARY_PATH setting */ - - jvmpath = JLI_StringDup(jvmpath); - new_runpath = JLI_MemAlloc( ((runpath!=NULL)?strlen(runpath):0) + - 2*strlen(jrepath) + 2*strlen(arch) + - strlen(jvmpath) + 52); - newpath = new_runpath + strlen("LD_LIBRARY_PATH="); - - - /* - * Create desired LD_LIBRARY_PATH value for target data model. - */ - { - /* remove the name of the .so from the JVM path */ - lastslash = strrchr(jvmpath, '/'); - if (lastslash) - *lastslash = '\0'; - - - /* jvmpath, ((running != wanted)?((wanted==64)?"/"LIBARCH64NAME:"/.."):""), */ - - sprintf(new_runpath, "LD_LIBRARY_PATH=" - "%s:" - "%s/lib/%s:" - "%s/../lib/%s", - jvmpath, -#ifdef DUAL_MODE - jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), - jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME) -#else - jrepath, arch, - jrepath, arch -#endif - ); - - - /* - * Check to make sure that the prefix of the current path is the - * desired environment variable setting. - */ - if (runpath != NULL && - strncmp(newpath, runpath, strlen(newpath))==0 && - (runpath[strlen(newpath)] == 0 || runpath[strlen(newpath)] == ':') && - (running == wanted) /* data model does not have to be changed */ -#ifdef __sun - && (dmpath == NULL) /* data model specific variables not set */ -#endif - ) { - - return; - - } - } - - /* - * Place the desired environment setting onto the prefix of - * LD_LIBRARY_PATH. Note that this prevents any possible infinite - * loop of execv() because we test for the prefix, above. - */ - if (runpath != 0 && (runpath[0] != '\0')) { - strcat(new_runpath, ":"); - strcat(new_runpath, runpath); - } - - if( putenv(new_runpath) != 0) { - exit(1); /* problem allocating memory; LD_LIBRARY_PATH not set - properly */ - } - - /* - * Unix systems document that they look at LD_LIBRARY_PATH only - * once at startup, so we have to re-exec the current executable - * to get the changed environment variable to have an effect. - */ - -#ifdef __sun - /* - * If dmpath is not NULL, remove the data model specific string - * in the environment for the exec'ed child. - */ - - if( dmpath != NULL) - (void)UnsetEnv((wanted==32)?"LD_LIBRARY_PATH_32":"LD_LIBRARY_PATH_64"); -#endif - - newenvp = environ; - - { - char *newexec = execname; -#ifdef DUAL_MODE - /* - * If the data model is being changed, the path to the - * executable must be updated accordingly; the executable name - * and directory the executable resides in are separate. In the - * case of 32 => 64, the new bits are assumed to reside in, e.g. - * "olddir/LIBARCH64NAME/execname"; in the case of 64 => 32, - * the bits are assumed to be in "olddir/../execname". For example, - * - * olddir/sparcv9/execname - * olddir/amd64/execname - * - * for Solaris SPARC and Linux amd64, respectively. - */ - - if (running != wanted) { - char *oldexec = strcpy(JLI_MemAlloc(strlen(execname) + 1), execname); - char *olddir = oldexec; - char *oldbase = strrchr(oldexec, '/'); - - - newexec = JLI_MemAlloc(strlen(execname) + 20); - *oldbase++ = 0; - sprintf(newexec, "%s/%s/%s", olddir, - ((wanted==64) ? LIBARCH64NAME : ".."), oldbase); - argv[0] = newexec; - } -#endif - - (void)fflush(stdout); - (void)fflush(stderr); - execve(newexec, argv, newenvp); - perror("execve()"); - - fprintf(stderr, "Error trying to exec %s.\n", newexec); - fprintf(stderr, "Check if file exists and permissions are set correctly.\n"); - -#ifdef DUAL_MODE - if (running != wanted) { - fprintf(stderr, "Failed to start a %d-bit JVM process from a %d-bit JVM.\n", - wanted, running); -# ifdef __sun - -# ifdef __sparc - fprintf(stderr, "Verify all necessary J2SE components have been installed.\n" ); - fprintf(stderr, - "(Solaris SPARC 64-bit components must be installed after 32-bit components.)\n" ); -# else - fprintf(stderr, "Either 64-bit processes are not supported by this platform\n"); - fprintf(stderr, "or the 64-bit components have not been installed.\n"); -# endif - } -# endif -#endif - - } - - exit(1); - } - -} - - -/* - * On Solaris VM choosing is done by the launcher (java.c). - */ -static jboolean -GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize, char * arch) -{ - struct stat s; - - if (strchr(jvmtype, '/')) { - sprintf(jvmpath, "%s/" JVM_DLL, jvmtype); - } else { - sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype); - } - if (_launcher_debug) - printf("Does `%s' exist ... ", jvmpath); - - if (stat(jvmpath, &s) == 0) { - if (_launcher_debug) - printf("yes.\n"); - return JNI_TRUE; - } else { - if (_launcher_debug) - printf("no.\n"); - return JNI_FALSE; - } -} - -/* - * Find path to the JRE based on the the compile flag ICEDTEA_WEB_JRE - */ -static jboolean -GetIcedTeaWebJREPath(char* path, jint pathsize, char* arch, jboolean speculative) -{ - char libjava[MAXPATHLEN]; - snprintf(libjava, MAXPATHLEN, ICEDTEA_WEB_JRE "/lib/%s/" JAVA_DLL, arch); - - if (_launcher_debug) { - printf(ICEDTEA_WEB_JRE "/lib/%s/" JAVA_DLL "\n", arch); - printf("libjava is %s\n", libjava); - } - - if (access(libjava, F_OK) == 0) { - strncpy(path, ICEDTEA_WEB_JRE, pathsize); - goto found; - } - - return JNI_FALSE; - - found: - if (_launcher_debug) - printf("JRE path is %s\n", path); - return JNI_TRUE; -} - -/* - * Find path to JRE based on .exe's location or registry settings. - */ -static jboolean -GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative) -{ - char libjava[MAXPATHLEN]; - - if (GetApplicationHome(path, pathsize)) { - /* Is JRE co-located with the application? */ - sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch); - if (access(libjava, F_OK) == 0) { - goto found; - } - - /* Does the app ship a private JRE in /jre directory? */ - sprintf(libjava, "%s/jre/lib/%s/" JAVA_DLL, path, arch); - if (access(libjava, F_OK) == 0) { - strcat(path, "/jre"); - goto found; - } - } - - if (!speculative) - fprintf(stderr, "Error: could not find " JAVA_DLL "\n"); - return JNI_FALSE; - - found: - if (_launcher_debug) - printf("JRE path is %s\n", path); - return JNI_TRUE; -} - -jboolean -LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) -{ - Dl_info dlinfo; - void *libjvm; - - if (_launcher_debug) { - printf("JVM path is %s\n", jvmpath); - } - - libjvm = dlopen(jvmpath, RTLD_NOW + RTLD_GLOBAL); - if (libjvm == NULL) { -#if defined(__solaris__) && defined(__sparc) && !defined(_LP64) /* i.e. 32-bit sparc */ - FILE * fp; - Elf32_Ehdr elf_head; - int count; - int location; - - fp = fopen(jvmpath, "r"); - if(fp == NULL) - goto error; - - /* read in elf header */ - count = fread((void*)(&elf_head), sizeof(Elf32_Ehdr), 1, fp); - fclose(fp); - if(count < 1) - goto error; - - /* - * Check for running a server vm (compiled with -xarch=v8plus) - * on a stock v8 processor. In this case, the machine type in - * the elf header would not be included the architecture list - * provided by the isalist command, which is turn is gotten from - * sysinfo. This case cannot occur on 64-bit hardware and thus - * does not have to be checked for in binaries with an LP64 data - * model. - */ - if(elf_head.e_machine == EM_SPARC32PLUS) { - char buf[257]; /* recommended buffer size from sysinfo man - page */ - long length; - char* location; - - length = sysinfo(SI_ISALIST, buf, 257); - if(length > 0) { - location = strstr(buf, "sparcv8plus "); - if(location == NULL) { - fprintf(stderr, "SPARC V8 processor detected; Server compiler requires V9 or better.\n"); - fprintf(stderr, "Use Client compiler on V8 processors.\n"); - fprintf(stderr, "Could not create the Java virtual machine.\n"); - return JNI_FALSE; - } - } - } -#endif - fprintf(stderr, "dl failure on line %d", __LINE__); - goto error; - } - - ifn->CreateJavaVM = (CreateJavaVM_t) - dlsym(libjvm, "JNI_CreateJavaVM"); - if (ifn->CreateJavaVM == NULL) - goto error; - - ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t) - dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs"); - if (ifn->GetDefaultJavaVMInitArgs == NULL) - goto error; - - return JNI_TRUE; - -error: - fprintf(stderr, "Error: failed %s, because %s\n", jvmpath, dlerror()); - return JNI_FALSE; -} - -/* - * If app is "/foo/bin/javac", or "/foo/bin/sparcv9/javac" then put - * "/foo" into buf. - */ -jboolean -GetApplicationHome(char *buf, jint bufsize) -{ -#ifdef __linux__ - char *execname = GetExecname(); - if (execname) { - strncpy(buf, execname, bufsize-1); - buf[bufsize-1] = '\0'; - } else { - return JNI_FALSE; - } -#else - Dl_info dlinfo; - - dladdr((void *)GetApplicationHome, &dlinfo); - if (realpath(dlinfo.dli_fname, buf) == NULL) { - fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname); - return JNI_FALSE; - } -#endif - - if (strrchr(buf, '/') == 0) { - buf[0] = '\0'; - return JNI_FALSE; - } - *(strrchr(buf, '/')) = '\0'; /* executable file */ - if (strlen(buf) < 4 || strrchr(buf, '/') == 0) { - buf[0] = '\0'; - return JNI_FALSE; - } - if (strcmp("/bin", buf + strlen(buf) - 4) != 0) - *(strrchr(buf, '/')) = '\0'; /* sparcv9 or amd64 */ - if (strlen(buf) < 4 || strcmp("/bin", buf + strlen(buf) - 4) != 0) { - buf[0] = '\0'; - return JNI_FALSE; - } - *(strrchr(buf, '/')) = '\0'; /* bin */ - - return JNI_TRUE; -} - - -/* - * Return true if the named program exists - */ -static int -ProgramExists(char *name) -{ - struct stat sb; - if (stat(name, &sb) != 0) return 0; - if (S_ISDIR(sb.st_mode)) return 0; - return (sb.st_mode & S_IEXEC) != 0; -} - - -/* - * Find a command in a directory, returning the path. - */ -static char * -Resolve(char *indir, char *cmd) -{ - char name[PATH_MAX + 2], *real; - - if ((strlen(indir) + strlen(cmd) + 1) > PATH_MAX) return 0; - sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd); - if (!ProgramExists(name)) return 0; - real = JLI_MemAlloc(PATH_MAX + 2); - if (!realpath(name, real)) - strcpy(real, name); - return real; -} - - -/* - * Find a path for the executable - */ -static char * -FindExecName(char *program) -{ - char cwdbuf[PATH_MAX+2]; - char *path; - char *tmp_path; - char *f; - char *result = NULL; - - /* absolute path? */ - if (*program == FILE_SEPARATOR || - (FILE_SEPARATOR=='\\' && strrchr(program, ':'))) - return Resolve("", program+1); - - /* relative path? */ - if (strrchr(program, FILE_SEPARATOR) != 0) { - char buf[PATH_MAX+2]; - return Resolve(getcwd(cwdbuf, sizeof(cwdbuf)), program); - } - - /* from search path? */ - path = getenv("PATH"); - if (!path || !*path) path = "."; - tmp_path = JLI_MemAlloc(strlen(path) + 2); - strcpy(tmp_path, path); - - for (f=tmp_path; *f && result==0; ) { - char *s = f; - while (*f && (*f != PATH_SEPARATOR)) ++f; - if (*f) *f++ = 0; - if (*s == FILE_SEPARATOR) - result = Resolve(s, program); - else { - /* relative path element */ - char dir[2*PATH_MAX]; - sprintf(dir, "%s%c%s", getcwd(cwdbuf, sizeof(cwdbuf)), - FILE_SEPARATOR, s); - result = Resolve(dir, program); - } - if (result != 0) break; - } - - JLI_MemFree(tmp_path); - return result; -} - - -/* Store the name of the executable once computed */ -static char *execname = NULL; - -/* - * Compute the name of the executable - * - * In order to re-exec securely we need the absolute path of the - * executable. On Solaris getexecname(3c) may not return an absolute - * path so we use dladdr to get the filename of the executable and - * then use realpath to derive an absolute path. From Solaris 9 - * onwards the filename returned in DL_info structure from dladdr is - * an absolute pathname so technically realpath isn't required. - * On Linux we read the executable name from /proc/self/exe. - * As a fallback, and for platforms other than Solaris and Linux, - * we use FindExecName to compute the executable name. - */ -static char * -SetExecname(char **argv) -{ - char* exec_path = NULL; - - if (execname != NULL) /* Already determined */ - return (execname); - -#if defined(__sun) - { - Dl_info dlinfo; - if (dladdr((void*)&SetExecname, &dlinfo)) { - char *resolved = (char*)JLI_MemAlloc(PATH_MAX+1); - if (resolved != NULL) { - exec_path = realpath(dlinfo.dli_fname, resolved); - if (exec_path == NULL) { - JLI_MemFree(resolved); - } - } - } - } -#elif defined(__linux__) - { - const char* self = "/proc/self/exe"; - char buf[PATH_MAX+1]; - int len = readlink(self, buf, PATH_MAX); - if (len >= 0) { - buf[len] = '\0'; /* readlink doesn't nul terminate */ - exec_path = JLI_StringDup(buf); - } - } -#else /* !__sun && !__linux */ - { - /* Not implemented */ - } -#endif - - if (exec_path == NULL) { - exec_path = FindExecName(argv[0]); - } - execname = exec_path; - return exec_path; -} - -/* - * Return the name of the executable. Used in java_md.c to find the JRE area. - */ -static char * -GetExecname() { - return execname; -} - -void ReportErrorMessage(char * message, jboolean always) { - if (always) { - fprintf(stderr, "%s\n", message); - } -} - -void ReportErrorMessage2(char * format, char * string, jboolean always) { - if (always) { - fprintf(stderr, format, string); - fprintf(stderr, "\n"); - } -} - -void ReportExceptionDescription(JNIEnv * env) { - (*env)->ExceptionDescribe(env); -} - -/* - * Return JNI_TRUE for an option string that has no effect but should - * _not_ be passed on to the vm; return JNI_FALSE otherwise. On - * Solaris SPARC, this screening needs to be done if: - * 1) LD_LIBRARY_PATH does _not_ need to be reset and - * 2) -d32 or -d64 is passed to a binary with a matching data model - * (the exec in SetLibraryPath removes -d options and points the - * exec to the proper binary). When this exec is not done, these options - * would end up getting passed onto the vm. - */ -jboolean RemovableMachineDependentOption(char * option) { - /* - * Unconditionally remove both -d32 and -d64 options since only - * the last such options has an effect; e.g. - * java -d32 -d64 -d32 -version - * is equivalent to - * java -d32 -version - */ - - if( (strcmp(option, "-d32") == 0 ) || - (strcmp(option, "-d64") == 0 ) ) - return JNI_TRUE; - else - return JNI_FALSE; -} - -/* - * The following methods (down to ServerClassMachine()) answer - * the question about whether a machine is a "server-class" - * machine. A server-class machine is loosely defined as one - * with 2 or more processors and 2 gigabytes or more physical - * memory. The definition of a processor is a physical package, - * not a hyperthreaded chip masquerading as a multi-processor. - * The definition of memory is also somewhat fuzzy, since x86 - * machines seem not to report all the memory in their DIMMs, we - * think because of memory mapping of graphics cards, etc. - * - * This code is somewhat more confused with #ifdef's than we'd - * like because this file is used by both Solaris and Linux - * platforms, and so needs to be parameterized for SPARC and - * i586 hardware. The other Linux platforms (amd64 and ia64) - * don't even ask this question, because they only come with - * server JVMs. */ - -# define KB (1024UL) -# define MB (1024UL * KB) -# define GB (1024UL * MB) - -/* Compute physical memory by asking the OS */ -uint64_t -physical_memory(void) { - const uint64_t pages = (uint64_t) sysconf(_SC_PHYS_PAGES); - const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE); - const uint64_t result = pages * page_size; -# define UINT64_FORMAT "%" PRIu64 - - if (_launcher_debug) { - printf("pages: " UINT64_FORMAT - " page_size: " UINT64_FORMAT - " physical memory: " UINT64_FORMAT " (%.3fGB)\n", - pages, page_size, result, result / (double) GB); - } - return result; -} - -#if defined(__sparc) - -/* Methods for solaris-sparc and linux-sparc: these are easy. */ - -/* Ask the OS how many processors there are. */ -unsigned long -physical_processors(void) { - const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF); - - if (_launcher_debug) { - printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors); - } - return sys_processors; -} - -/* The sparc version of the "server-class" predicate. */ -jboolean -unix_sparc_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= server_memory) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("unix_" LIBARCHNAME "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE")); - } - return result; -} - -#endif /* __sparc */ - -#if defined(__sun) && defined(i586) - -/* - * A utility method for asking the CPU about itself. - * There's a corresponding version of linux-i586 - * because the compilers are different. - */ -void -get_cpuid(uint32_t arg, - uint32_t* eaxp, - uint32_t* ebxp, - uint32_t* ecxp, - uint32_t* edxp) { -#ifdef _LP64 - asm( - /* rbx is a callee-saved register */ - " movq %rbx, %r11 \n" - /* rdx and rcx are 3rd and 4th argument registers */ - " movq %rdx, %r10 \n" - " movq %rcx, %r9 \n" - " movl %edi, %eax \n" - " cpuid \n" - " movl %eax, (%rsi)\n" - " movl %ebx, (%r10)\n" - " movl %ecx, (%r9) \n" - " movl %edx, (%r8) \n" - /* Restore rbx */ - " movq %r11, %rbx"); -#else - /* EBX is a callee-saved register */ - asm(" pushl %ebx"); - /* Need ESI for storing through arguments */ - asm(" pushl %esi"); - asm(" movl 8(%ebp), %eax \n" - " cpuid \n" - " movl 12(%ebp), %esi \n" - " movl %eax, (%esi) \n" - " movl 16(%ebp), %esi \n" - " movl %ebx, (%esi) \n" - " movl 20(%ebp), %esi \n" - " movl %ecx, (%esi) \n" - " movl 24(%ebp), %esi \n" - " movl %edx, (%esi) "); - /* Restore ESI and EBX */ - asm(" popl %esi"); - /* Restore EBX */ - asm(" popl %ebx"); -#endif -} - -#endif /* __sun && i586 */ - -#if defined(__linux__) && defined(i586) - -/* - * A utility method for asking the CPU about itself. - * There's a corresponding version of solaris-i586 - * because the compilers are different. - */ -void -get_cpuid(uint32_t arg, - uint32_t* eaxp, - uint32_t* ebxp, - uint32_t* ecxp, - uint32_t* edxp) { -#ifdef _LP64 - __asm__ volatile (/* Instructions */ - " movl %4, %%eax \n" - " cpuid \n" - " movl %%eax, (%0)\n" - " movl %%ebx, (%1)\n" - " movl %%ecx, (%2)\n" - " movl %%edx, (%3)\n" - : /* Outputs */ - : /* Inputs */ - "r" (eaxp), - "r" (ebxp), - "r" (ecxp), - "r" (edxp), - "r" (arg) - : /* Clobbers */ - "%rax", "%rbx", "%rcx", "%rdx", "memory" - ); -#else - uint32_t value_of_eax = 0; - uint32_t value_of_ebx = 0; - uint32_t value_of_ecx = 0; - uint32_t value_of_edx = 0; - __asm__ volatile (/* Instructions */ - /* ebx is callee-save, so push it */ - " pushl %%ebx \n" - " movl %4, %%eax \n" - " cpuid \n" - " movl %%eax, %0 \n" - " movl %%ebx, %1 \n" - " movl %%ecx, %2 \n" - " movl %%edx, %3 \n" - /* restore ebx */ - " popl %%ebx \n" - - : /* Outputs */ - "=m" (value_of_eax), - "=m" (value_of_ebx), - "=m" (value_of_ecx), - "=m" (value_of_edx) - : /* Inputs */ - "m" (arg) - : /* Clobbers */ - "%eax", "%ecx", "%edx" - ); - *eaxp = value_of_eax; - *ebxp = value_of_ebx; - *ecxp = value_of_ecx; - *edxp = value_of_edx; -#endif -} - -#endif /* __linux__ && i586 */ - -#ifdef i586 -/* - * Routines shared by solaris-i586 and linux-i586. - */ - -enum HyperThreadingSupport_enum { - hts_supported = 1, - hts_too_soon_to_tell = 0, - hts_not_supported = -1, - hts_not_pentium4 = -2, - hts_not_intel = -3 -}; -typedef enum HyperThreadingSupport_enum HyperThreadingSupport; - -/* Determine if hyperthreading is supported */ -HyperThreadingSupport -hyperthreading_support(void) { - HyperThreadingSupport result = hts_too_soon_to_tell; - /* Bits 11 through 8 is family processor id */ -# define FAMILY_ID_SHIFT 8 -# define FAMILY_ID_MASK 0xf - /* Bits 23 through 20 is extended family processor id */ -# define EXT_FAMILY_ID_SHIFT 20 -# define EXT_FAMILY_ID_MASK 0xf - /* Pentium 4 family processor id */ -# define PENTIUM4_FAMILY_ID 0xf - /* Bit 28 indicates Hyper-Threading Technology support */ -# define HT_BIT_SHIFT 28 -# define HT_BIT_MASK 1 - uint32_t vendor_id[3] = { 0U, 0U, 0U }; - uint32_t value_of_eax = 0U; - uint32_t value_of_edx = 0U; - uint32_t dummy = 0U; - - /* Yes, this is supposed to be [0], [2], [1] */ - get_cpuid(0, &dummy, &vendor_id[0], &vendor_id[2], &vendor_id[1]); - if (_launcher_debug) { - printf("vendor: %c %c %c %c %c %c %c %c %c %c %c %c \n", - ((vendor_id[0] >> 0) & 0xff), - ((vendor_id[0] >> 8) & 0xff), - ((vendor_id[0] >> 16) & 0xff), - ((vendor_id[0] >> 24) & 0xff), - ((vendor_id[1] >> 0) & 0xff), - ((vendor_id[1] >> 8) & 0xff), - ((vendor_id[1] >> 16) & 0xff), - ((vendor_id[1] >> 24) & 0xff), - ((vendor_id[2] >> 0) & 0xff), - ((vendor_id[2] >> 8) & 0xff), - ((vendor_id[2] >> 16) & 0xff), - ((vendor_id[2] >> 24) & 0xff)); - } - get_cpuid(1, &value_of_eax, &dummy, &dummy, &value_of_edx); - if (_launcher_debug) { - printf("value_of_eax: 0x%x value_of_edx: 0x%x\n", - value_of_eax, value_of_edx); - } - if ((((value_of_eax >> FAMILY_ID_SHIFT) & FAMILY_ID_MASK) == PENTIUM4_FAMILY_ID) || - (((value_of_eax >> EXT_FAMILY_ID_SHIFT) & EXT_FAMILY_ID_MASK) != 0)) { - if ((((vendor_id[0] >> 0) & 0xff) == 'G') && - (((vendor_id[0] >> 8) & 0xff) == 'e') && - (((vendor_id[0] >> 16) & 0xff) == 'n') && - (((vendor_id[0] >> 24) & 0xff) == 'u') && - (((vendor_id[1] >> 0) & 0xff) == 'i') && - (((vendor_id[1] >> 8) & 0xff) == 'n') && - (((vendor_id[1] >> 16) & 0xff) == 'e') && - (((vendor_id[1] >> 24) & 0xff) == 'I') && - (((vendor_id[2] >> 0) & 0xff) == 'n') && - (((vendor_id[2] >> 8) & 0xff) == 't') && - (((vendor_id[2] >> 16) & 0xff) == 'e') && - (((vendor_id[2] >> 24) & 0xff) == 'l')) { - if (((value_of_edx >> HT_BIT_SHIFT) & HT_BIT_MASK) == HT_BIT_MASK) { - if (_launcher_debug) { - printf("Hyperthreading supported\n"); - } - result = hts_supported; - } else { - if (_launcher_debug) { - printf("Hyperthreading not supported\n"); - } - result = hts_not_supported; - } - } else { - if (_launcher_debug) { - printf("Not GenuineIntel\n"); - } - result = hts_not_intel; - } - } else { - if (_launcher_debug) { - printf("not Pentium 4 or extended\n"); - } - result = hts_not_pentium4; - } - return result; -} - -/* Determine how many logical processors there are per CPU */ -unsigned int -logical_processors_per_package(void) { - /* - * After CPUID with EAX==1, register EBX bits 23 through 16 - * indicate the number of logical processors per package - */ -# define NUM_LOGICAL_SHIFT 16 -# define NUM_LOGICAL_MASK 0xff - unsigned int result = 1U; - const HyperThreadingSupport hyperthreading = hyperthreading_support(); - - if (hyperthreading == hts_supported) { - uint32_t value_of_ebx = 0U; - uint32_t dummy = 0U; - - get_cpuid(1, &dummy, &value_of_ebx, &dummy, &dummy); - result = (value_of_ebx >> NUM_LOGICAL_SHIFT) & NUM_LOGICAL_MASK; - if (_launcher_debug) { - printf("logical processors per package: %u\n", result); - } - } - return result; -} - -/* Compute the number of physical processors, not logical processors */ -unsigned long -physical_processors(void) { - const long sys_processors = sysconf(_SC_NPROCESSORS_CONF); - unsigned long result = sys_processors; - - if (_launcher_debug) { - printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors); - } - if (sys_processors > 1) { - unsigned int logical_processors = logical_processors_per_package(); - if (logical_processors > 1) { - result = (unsigned long) sys_processors / logical_processors; - } - } - if (_launcher_debug) { - printf("physical processors: %lu\n", result); - } - return result; -} - -#endif /* i586 */ - -#if defined(__sun) && defined(i586) - -/* The definition of a server-class machine for solaris-i586/amd64 */ -jboolean -solaris_i586_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - /* - * We seem not to get our full complement of memory. - * We allow some part (1/8?) of the memory to be "missing", - * based on the sizes of DIMMs, and maybe graphics cards. - */ - const uint64_t missing_memory = 256UL * MB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= (server_memory - missing_memory)) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "true" : "false")); - } - return result; -} - -#endif /* __sun && i586 */ - -#if defined(__linux__) && defined(i586) - -/* The definition of a server-class machine for linux-i586 */ -jboolean -linux_i586_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - /* - * We seem not to get our full complement of memory. - * We allow some part (1/8?) of the memory to be "missing", - * based on the sizes of DIMMs, and maybe graphics cards. - */ - const uint64_t missing_memory = 256UL * MB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= (server_memory - missing_memory)) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("linux_" LIBARCHNAME "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "true" : "false")); - } - return result; -} - -#endif /* __linux__ && i586 */ - -/* Dispatch to the platform-specific definition of "server-class" */ -jboolean -ServerClassMachine(void) { - jboolean result = JNI_FALSE; -#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE) - result = JNI_FALSE; -#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE) - result = JNI_TRUE; -#elif defined(__sun) && defined(__sparc) - result = unix_sparc_ServerClassMachine(); -#elif defined(__sun) && defined(i586) - result = solaris_i586_ServerClassMachine(); -#elif defined(__linux__) && defined(i586) - result = linux_i586_ServerClassMachine(); -#else - if (_launcher_debug) { - printf("ServerClassMachine: returns default value of %s\n", - (result == JNI_TRUE ? "true" : "false")); - } -#endif - return result; -} - -/* - * Since using the file system as a registry is a bit risky, perform - * additional sanity checks on the identified directory to validate - * it as a valid jre/sdk. - * - * Return 0 if the tests fail; otherwise return non-zero (true). - * - * Note that checking for anything more than the existence of an - * executable object at bin/java relative to the path being checked - * will break the regression tests. - */ -static int -CheckSanity(char *path, char *dir) -{ - char buffer[PATH_MAX]; - - if (strlen(path) + strlen(dir) + 11 > PATH_MAX) - return (0); /* Silently reject "impossibly" long paths */ - - (void)strcat(strcat(strcat(strcpy(buffer, path), "/"), dir), "/bin/java"); - return ((access(buffer, X_OK) == 0) ? 1 : 0); -} - -/* - * Determine if there is an acceptable JRE in the directory dirname. - * Upon locating the "best" one, return a fully qualified path to - * it. "Best" is defined as the most advanced JRE meeting the - * constraints contained in the manifest_info. If no JRE in this - * directory meets the constraints, return NULL. - * - * Note that we don't check for errors in reading the directory - * (which would be done by checking errno). This is because it - * doesn't matter if we get an error reading the directory, or - * we just don't find anything interesting in the directory. We - * just return NULL in either case. - * - * The historical names of j2sdk and j2re were changed to jdk and - * jre respecively as part of the 1.5 rebranding effort. Since the - * former names are legacy on Linux, they must be recognized for - * all time. Fortunately, this is a minor cost. - */ -static char -*ProcessDir(manifest_info *info, char *dirname) -{ - DIR *dirp; - struct dirent *dp; - char *best = NULL; - int offset; - int best_offset = 0; - char *ret_str = NULL; - char buffer[PATH_MAX]; - - if ((dirp = opendir(dirname)) == NULL) - return (NULL); - - do { - if ((dp = readdir(dirp)) != NULL) { - offset = 0; - if ((strncmp(dp->d_name, "jre", 3) == 0) || - (strncmp(dp->d_name, "jdk", 3) == 0)) - offset = 3; - else if (strncmp(dp->d_name, "j2re", 4) == 0) - offset = 4; - else if (strncmp(dp->d_name, "j2sdk", 5) == 0) - offset = 5; - if (offset > 0) { - if ((JLI_AcceptableRelease(dp->d_name + offset, - info->jre_version)) && CheckSanity(dirname, dp->d_name)) - if ((best == NULL) || (JLI_ExactVersionId( - dp->d_name + offset, best + best_offset) > 0)) { - if (best != NULL) - JLI_MemFree(best); - best = JLI_StringDup(dp->d_name); - best_offset = offset; - } - } - } - } while (dp != NULL); - (void) closedir(dirp); - if (best == NULL) - return (NULL); - else { - ret_str = JLI_MemAlloc(strlen(dirname) + strlen(best) + 2); - ret_str = strcat(strcat(strcpy(ret_str, dirname), "/"), best); - JLI_MemFree(best); - return (ret_str); - } -} - -/* - * This is the global entry point. It examines the host for the optimal - * JRE to be used by scanning a set of directories. The set of directories - * is platform dependent and can be overridden by the environment - * variable JAVA_VERSION_PATH. - * - * This routine itself simply determines the set of appropriate - * directories before passing control onto ProcessDir(). - */ -char* -LocateJRE(manifest_info* info) -{ - char *path; - char *home; - char *target = NULL; - char *dp; - char *cp; - - /* - * Start by getting JAVA_VERSION_PATH - */ - if (info->jre_restrict_search) - path = JLI_StringDup(system_dir); - else if ((path = getenv("JAVA_VERSION_PATH")) != NULL) - path = JLI_StringDup(path); - else - if ((home = getenv("HOME")) != NULL) { - path = (char *)JLI_MemAlloc(strlen(home) + strlen(system_dir) + - strlen(user_dir) + 2); - path = strcat(strcat(strcat(strcpy(path, home), - user_dir), ":"), system_dir); - } else - path = JLI_StringDup(system_dir); - - /* - * Step through each directory on the path. Terminate the scan with - * the first directory with an acceptable JRE. - */ - cp = dp = path; - while (dp != NULL) { - cp = strchr(dp, (int)':'); - if (cp != NULL) - *cp = (char)NULL; - if ((target = ProcessDir(info, dp)) != NULL) - break; - dp = cp; - if (dp != NULL) - dp++; - } - JLI_MemFree(path); - return (target); -} - -/* - * Given a path to a jre to execute, this routine checks if this process - * is indeed that jre. If not, it exec's that jre. - * - * We want to actually check the paths rather than just the version string - * built into the executable, so that given version specification (and - * JAVA_VERSION_PATH) will yield the exact same Java environment, regardless - * of the version of the arbitrary launcher we start with. - */ -void -ExecJRE(char *jre, char **argv) -{ - char wanted[PATH_MAX]; - char *execname; - char *progname; - - /* - * Resolve the real path to the directory containing the selected JRE. - */ - if (realpath(jre, wanted) == NULL) { - fprintf(stderr, "Unable to resolve %s\n", jre); - exit(1); - } - - /* - * Resolve the real path to the currently running launcher. - */ - execname = SetExecname(argv); - if (execname == NULL) { - fprintf(stderr, "Unable to resolve current executable\n"); - exit(1); - } - - /* - * If the path to the selected JRE directory is a match to the initial - * portion of the path to the currently executing JRE, we have a winner! - * If so, just return. - */ - if (strncmp(wanted, execname, strlen(wanted)) == 0) - return; /* I am the droid you were looking for */ - - /* - * If this isn't the selected version, exec the selected version. - */ -#ifdef JAVA_ARGS /* javac, jar and friends. */ - progname = "java"; -#else /* java, oldjava, javaw and friends */ -#ifdef PROGNAME - progname = PROGNAME; -#else - progname = *argv; - if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) { - progname = s + 1; - } -#endif /* PROGNAME */ -#endif /* JAVA_ARGS */ - - /* - * This should never happen (because of the selection code in SelectJRE), - * but check for "impossibly" long path names just because buffer overruns - * can be so deadly. - */ - if (strlen(wanted) + strlen(progname) + 6 > PATH_MAX) { - fprintf(stderr, "Path length exceeds maximum length (PATH_MAX)\n"); - exit(1); - } - - /* - * Construct the path and exec it. - */ - (void)strcat(strcat(wanted, "/bin/"), progname); - argv[0] = progname; - if (_launcher_debug) { - int i; - printf("ReExec Command: %s (%s)\n", wanted, argv[0]); - printf("ReExec Args:"); - for (i = 1; argv[i] != NULL; i++) - printf(" %s", argv[i]); - printf("\n"); - } - (void)fflush(stdout); - (void)fflush(stderr); - execv(wanted, argv); - perror("execv()"); - fprintf(stderr, "Exec of %s failed\n", wanted); - exit(1); -} - -/* - * "Borrowed" from Solaris 10 where the unsetenv() function is being added - * to libc thanks to SUSv3 (Standard Unix Specification, version 3). As - * such, in the fullness of time this will appear in libc on all relevant - * Solaris/Linux platforms and maybe even the Windows platform. At that - * time, this stub can be removed. - * - * This implementation removes the environment locking for multithreaded - * applications. (We don't have access to these mutexes within libc and - * the launcher isn't multithreaded.) Note that what remains is platform - * independent, because it only relies on attributes that a POSIX environment - * defines. - * - * Returns 0 on success, -1 on failure. - * - * Also removed was the setting of errno. The only value of errno set - * was EINVAL ("Invalid Argument"). - */ - -/* - * s1(environ) is name=value - * s2(name) is name(not the form of name=value). - * if names match, return value of 1, else return 0 - */ -static int -match_noeq(const char *s1, const char *s2) -{ - while (*s1 == *s2++) { - if (*s1++ == '=') - return (1); - } - if (*s1 == '=' && s2[-1] == '\0') - return (1); - return (0); -} - -/* - * added for SUSv3 standard - * - * Delete entry from environ. - * Do not free() memory! Other threads may be using it. - * Keep it around forever. - */ -static int -borrowed_unsetenv(const char *name) -{ - long idx; /* index into environ */ - - if (name == NULL || *name == '\0' || - strchr(name, '=') != NULL) { - return (-1); - } - - for (idx = 0; environ[idx] != NULL; idx++) { - if (match_noeq(environ[idx], name)) - break; - } - if (environ[idx] == NULL) { - /* name not found but still a success */ - return (0); - } - /* squeeze up one entry */ - do { - environ[idx] = environ[idx+1]; - } while (environ[++idx] != NULL); - - return (0); -} -/* --- End of "borrowed" code --- */ - -/* - * Wrapper for unsetenv() function. - */ -int -UnsetEnv(char *name) -{ - return(borrowed_unsetenv(name)); -} - -/* --- Splash Screen shared library support --- */ - -static const char* SPLASHSCREEN_SO = "libsplashscreen.so"; - -static void* hSplashLib = NULL; - -void* SplashProcAddress(const char* name) { - if (!hSplashLib) { - hSplashLib = dlopen(SPLASHSCREEN_SO, RTLD_LAZY | RTLD_GLOBAL); - } - if (hSplashLib) { - void* sym = dlsym(hSplashLib, name); - return sym; - } else { - return NULL; - } -} - -void SplashFreeLibrary() { - if (hSplashLib) { - dlclose(hSplashLib); - hSplashLib = NULL; - } -} - -const char * -jlong_format_specifier() { - return "%lld"; -} - -/* - * Block current thread and continue execution in a new thread - */ -int -ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args, int ret) { - int rslt; -#ifdef __linux__ - pthread_t tid; - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - - if (stack_size > 0) { - pthread_attr_setstacksize(&attr, stack_size); - } - - if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { - void * tmp; - pthread_join(tid, &tmp); - rslt = (int)tmp; - } else { - /* - * Continue execution in current thread if for some reason (e.g. out of - * memory/LWP) a new thread can't be created. This will likely fail - * later in continuation as JNI_CreateJavaVM needs to create quite a - * few new threads, anyway, just give it a try.. - */ - rslt = continuation(args); - } - - pthread_attr_destroy(&attr); -#else - thread_t tid; - long flags = 0; - if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { - void * tmp; - thr_join(tid, NULL, &tmp); - rslt = (int)tmp; - } else { - /* See above. Continue in current thread if thr_create() failed */ - rslt = continuation(args); - } -#endif - /* If the caller has deemed there is an error we - * simply return that, otherwise we return the value of - * the callee - */ - return (ret != 0) ? ret : rslt; -} - -/* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */ -#define MAX_PID_STR_SZ 20 - -void SetJavaLauncherPlatformProps() { - /* Linux only */ -#ifdef __linux__ - const char *substr = "-Dsun.java.launcher.pid="; - char *pid_prop_str = (char *)JLI_MemAlloc(strlen(substr) + MAX_PID_STR_SZ + 1); - sprintf(pid_prop_str, "%s%d", substr, getpid()); - AddOption(pid_prop_str, NULL); -#endif -} diff -Nru icedtea-web-1.3.2/launcher/java_md.h icedtea-web-1.4/launcher/java_md.h --- icedtea-web-1.3.2/launcher/java_md.h 2013-04-10 11:40:23.837668000 +0000 +++ icedtea-web-1.4/launcher/java_md.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#ifndef JAVA_MD_H -#define JAVA_MD_H - -#include -#include -#include -#include "manifest_info.h" -#include "jli_util.h" - -#define PATH_SEPARATOR ':' -#define FILESEP "/" -#define FILE_SEPARATOR '/' -#define IS_FILE_SEPARATOR(c) ((c) == '/') -#ifndef MAXNAMELEN -#define MAXNAMELEN PATH_MAX -#endif - -#ifdef JAVA_ARGS -/* - * ApplicationHome is prepended to each of these entries; the resulting - * strings are concatenated (separated by PATH_SEPARATOR) and used as the - * value of -cp option to the launcher. - */ -#ifndef APP_CLASSPATH -#define APP_CLASSPATH { "/lib/tools.jar", "/classes" } -#endif -#endif - -#ifdef HAVE_GETHRTIME -/* - * Support for doing cheap, accurate interval timing. - */ -#include -#define CounterGet() (gethrtime()/1000) -#define Counter2Micros(counts) (counts) -#else -#define CounterGet() (0) -#define Counter2Micros(counts) (1) -#endif /* HAVE_GETHRTIME */ - -/* - * Function prototypes. - */ -char *LocateJRE(manifest_info *info); -void ExecJRE(char *jre, char **argv); -int UnsetEnv(char *name); - -#endif diff -Nru icedtea-web-1.3.2/launcher/javaws.in icedtea-web-1.4/launcher/javaws.in --- icedtea-web-1.3.2/launcher/javaws.in 2013-04-10 11:40:23.837668000 +0000 +++ icedtea-web-1.4/launcher/javaws.in 2013-05-03 19:08:24.149521391 +0000 @@ -1,13 +1,29 @@ -#!/bin/bash +#!/bin/sh JAVA=@JAVA@ LAUNCHER_BOOTCLASSPATH=@LAUNCHER_BOOTCLASSPATH@ LAUNCHER_FLAGS=-Xms8m CLASSNAME=net.sourceforge.jnlp.runtime.Boot BINARY_LOCATION=@JAVAWS_BIN_LOCATION@ +SPLASH_LOCATION=@JAVAWS_SPLASH_LOCATION@ PROGRAM_NAME=javaws CP=@JRE@/lib/rt.jar +PROPERTY_NAME=deployment.jre.dir +CUSTOM_JRE_REGEX="^$PROPERTY_NAME *= *" +CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" ~/.icedtea/deployment.properties 2>/dev/null | sed "s/$CUSTOM_JRE_REGEX//g"` +if [ "x$CUSTOM_JRE" = "x" ] ; then + CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" /etc/.java/.deploy/deployment.properties 2>/dev/null | sed "s/$CUSTOM_JRE_REGEX//g"` +fi; +if [ "x$CUSTOM_JRE" != "x" ] ; then + if [ -e "$CUSTOM_JRE" -a -e "$CUSTOM_JRE/bin/java" -a -e "$CUSTOM_JRE/lib/rt.jar" ] ; then + JAVA=$CUSTOM_JRE/bin/java + CP=$CUSTOM_JRE/lib/rt.jar + else + echo "Your custom JRE $CUSTOM_JRE read from deployment.properties under key $PROPERTY_NAME as $CUSTOM_JRE is not valid. Using default ($JAVA, $CP) in attempt to start. Please fix this." + fi +fi; + JAVA_ARGS=( ) ARGS=( ) COMMAND=() @@ -15,6 +31,10 @@ i=0 j=0 +SPLASH="false" +if [ "x$ICEDTEA_WEB_SPLASH" = "x" ] ; then +SPLASH="true" +fi; while [ "$#" -gt "0" ]; do case "$1" in -J*) @@ -24,6 +44,9 @@ *) ARGS[$j]="$1" j=$((j+1)) + if [ "$1" = "-headless" ] ; then + SPLASH="false" + fi ;; esac shift @@ -32,6 +55,10 @@ k=0 COMMAND[k]="${JAVA}" k=$((k+1)) +if [ "$SPLASH" = "true" ] ; then +COMMAND[k]="-splash:${SPLASH_LOCATION}" +k=$((k+1)) +fi; COMMAND[k]="${LAUNCHER_BOOTCLASSPATH}" k=$((k+1)) COMMAND[k]="${LAUNCHER_FLAGS}" diff -Nru icedtea-web-1.3.2/launcher/jli_util.c icedtea-web-1.4/launcher/jli_util.c --- icedtea-web-1.3.2/launcher/jli_util.c 2013-04-10 11:40:23.838668000 +0000 +++ icedtea-web-1.4/launcher/jli_util.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#include -#include -#include "jli_util.h" - -/* - * Returns a pointer to a block of at least 'size' bytes of memory. - * Prints error message and exits if the memory could not be allocated. - */ -void * -JLI_MemAlloc(size_t size) -{ - void *p = malloc(size); - if (p == 0) { - perror("malloc"); - exit(1); - } - return p; -} - -/* - * Equivalent to realloc(size). - * Prints error message and exits if the memory could not be reallocated. - */ -void * -JLI_MemRealloc(void *ptr, size_t size) -{ - void *p = realloc(ptr, size); - if (p == 0) { - perror("realloc"); - exit(1); - } - return p; -} - -/* - * Wrapper over strdup(3C) which prints an error message and exits if memory - * could not be allocated. - */ -char * -JLI_StringDup(const char *s1) -{ - char *s = strdup(s1); - if (s == NULL) { - perror("strdup"); - exit(1); - } - return s; -} - -/* - * Very equivalent to free(ptr). - * Here to maintain pairing with the above routines. - */ -void -JLI_MemFree(void *ptr) -{ - free(ptr); -} diff -Nru icedtea-web-1.3.2/launcher/jli_util.h icedtea-web-1.4/launcher/jli_util.h --- icedtea-web-1.3.2/launcher/jli_util.h 2013-04-10 11:40:23.838668000 +0000 +++ icedtea-web-1.4/launcher/jli_util.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#ifndef _JLI_UTIL_H -#define _JLI_UTIL_H - -#include - -void *JLI_MemAlloc(size_t size); -void *JLI_MemRealloc(void *ptr, size_t size); -char *JLI_StringDup(const char *s1); -void JLI_MemFree(void *ptr); - -#endif /* _JLI_UTIL_H */ diff -Nru icedtea-web-1.3.2/launcher/jni.h icedtea-web-1.4/launcher/jni.h --- icedtea-web-1.3.2/launcher/jni.h 2013-04-10 11:40:23.838668000 +0000 +++ icedtea-web-1.4/launcher/jni.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1959 +0,0 @@ -/* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -/* - * We used part of Netscape's Java Runtime Interface (JRI) as the starting - * point of our design and implementation. - */ - -/****************************************************************************** - * Java Runtime Interface - * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved. - *****************************************************************************/ - -#ifndef _JAVASOFT_JNI_H_ -#define _JAVASOFT_JNI_H_ - -#include -#include - -/* jni_md.h contains the machine-dependent typedefs for jbyte, jint - and jlong */ - -#include "jni_md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * JNI Types - */ - -#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H - -typedef unsigned char jboolean; -typedef unsigned short jchar; -typedef short jshort; -typedef float jfloat; -typedef double jdouble; - -typedef jint jsize; - -#ifdef __cplusplus - -class _jobject {}; -class _jclass : public _jobject {}; -class _jthrowable : public _jobject {}; -class _jstring : public _jobject {}; -class _jarray : public _jobject {}; -class _jbooleanArray : public _jarray {}; -class _jbyteArray : public _jarray {}; -class _jcharArray : public _jarray {}; -class _jshortArray : public _jarray {}; -class _jintArray : public _jarray {}; -class _jlongArray : public _jarray {}; -class _jfloatArray : public _jarray {}; -class _jdoubleArray : public _jarray {}; -class _jobjectArray : public _jarray {}; - -typedef _jobject *jobject; -typedef _jclass *jclass; -typedef _jthrowable *jthrowable; -typedef _jstring *jstring; -typedef _jarray *jarray; -typedef _jbooleanArray *jbooleanArray; -typedef _jbyteArray *jbyteArray; -typedef _jcharArray *jcharArray; -typedef _jshortArray *jshortArray; -typedef _jintArray *jintArray; -typedef _jlongArray *jlongArray; -typedef _jfloatArray *jfloatArray; -typedef _jdoubleArray *jdoubleArray; -typedef _jobjectArray *jobjectArray; - -#else - -struct _jobject; - -typedef struct _jobject *jobject; -typedef jobject jclass; -typedef jobject jthrowable; -typedef jobject jstring; -typedef jobject jarray; -typedef jarray jbooleanArray; -typedef jarray jbyteArray; -typedef jarray jcharArray; -typedef jarray jshortArray; -typedef jarray jintArray; -typedef jarray jlongArray; -typedef jarray jfloatArray; -typedef jarray jdoubleArray; -typedef jarray jobjectArray; - -#endif - -typedef jobject jweak; - -typedef union jvalue { - jboolean z; - jbyte b; - jchar c; - jshort s; - jint i; - jlong j; - jfloat f; - jdouble d; - jobject l; -} jvalue; - -struct _jfieldID; -typedef struct _jfieldID *jfieldID; - -struct _jmethodID; -typedef struct _jmethodID *jmethodID; - -/* Return values from jobjectRefType */ -typedef enum _jobjectType { - JNIInvalidRefType = 0, - JNILocalRefType = 1, - JNIGlobalRefType = 2, - JNIWeakGlobalRefType = 3 -} jobjectRefType; - - -#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */ - -/* - * jboolean constants - */ - -#define JNI_FALSE 0 -#define JNI_TRUE 1 - -/* - * possible return values for JNI functions. - */ - -#define JNI_OK 0 /* success */ -#define JNI_ERR (-1) /* unknown error */ -#define JNI_EDETACHED (-2) /* thread detached from the VM */ -#define JNI_EVERSION (-3) /* JNI version error */ -#define JNI_ENOMEM (-4) /* not enough memory */ -#define JNI_EEXIST (-5) /* VM already created */ -#define JNI_EINVAL (-6) /* invalid arguments */ - -/* - * used in ReleaseScalarArrayElements - */ - -#define JNI_COMMIT 1 -#define JNI_ABORT 2 - -/* - * used in RegisterNatives to describe native method name, signature, - * and function pointer. - */ - -typedef struct { - char *name; - char *signature; - void *fnPtr; -} JNINativeMethod; - -/* - * JNI Native Method Interface. - */ - -struct JNINativeInterface_; - -struct JNIEnv_; - -#ifdef __cplusplus -typedef JNIEnv_ JNIEnv; -#else -typedef const struct JNINativeInterface_ *JNIEnv; -#endif - -/* - * JNI Invocation Interface. - */ - -struct JNIInvokeInterface_; - -struct JavaVM_; - -#ifdef __cplusplus -typedef JavaVM_ JavaVM; -#else -typedef const struct JNIInvokeInterface_ *JavaVM; -#endif - -struct JNINativeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - - void *reserved3; - jint (JNICALL *GetVersion)(JNIEnv *env); - - jclass (JNICALL *DefineClass) - (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, - jsize len); - jclass (JNICALL *FindClass) - (JNIEnv *env, const char *name); - - jmethodID (JNICALL *FromReflectedMethod) - (JNIEnv *env, jobject method); - jfieldID (JNICALL *FromReflectedField) - (JNIEnv *env, jobject field); - - jobject (JNICALL *ToReflectedMethod) - (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); - - jclass (JNICALL *GetSuperclass) - (JNIEnv *env, jclass sub); - jboolean (JNICALL *IsAssignableFrom) - (JNIEnv *env, jclass sub, jclass sup); - - jobject (JNICALL *ToReflectedField) - (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); - - jint (JNICALL *Throw) - (JNIEnv *env, jthrowable obj); - jint (JNICALL *ThrowNew) - (JNIEnv *env, jclass clazz, const char *msg); - jthrowable (JNICALL *ExceptionOccurred) - (JNIEnv *env); - void (JNICALL *ExceptionDescribe) - (JNIEnv *env); - void (JNICALL *ExceptionClear) - (JNIEnv *env); - void (JNICALL *FatalError) - (JNIEnv *env, const char *msg); - - jint (JNICALL *PushLocalFrame) - (JNIEnv *env, jint capacity); - jobject (JNICALL *PopLocalFrame) - (JNIEnv *env, jobject result); - - jobject (JNICALL *NewGlobalRef) - (JNIEnv *env, jobject lobj); - void (JNICALL *DeleteGlobalRef) - (JNIEnv *env, jobject gref); - void (JNICALL *DeleteLocalRef) - (JNIEnv *env, jobject obj); - jboolean (JNICALL *IsSameObject) - (JNIEnv *env, jobject obj1, jobject obj2); - jobject (JNICALL *NewLocalRef) - (JNIEnv *env, jobject ref); - jint (JNICALL *EnsureLocalCapacity) - (JNIEnv *env, jint capacity); - - jobject (JNICALL *AllocObject) - (JNIEnv *env, jclass clazz); - jobject (JNICALL *NewObject) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *NewObjectV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (JNICALL *NewObjectA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jclass (JNICALL *GetObjectClass) - (JNIEnv *env, jobject obj); - jboolean (JNICALL *IsInstanceOf) - (JNIEnv *env, jobject obj, jclass clazz); - - jmethodID (JNICALL *GetMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *CallObjectMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jobject (JNICALL *CallObjectMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jobject (JNICALL *CallObjectMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); - - jboolean (JNICALL *CallBooleanMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jboolean (JNICALL *CallBooleanMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jboolean (JNICALL *CallBooleanMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); - - jbyte (JNICALL *CallByteMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jbyte (JNICALL *CallByteMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jbyte (JNICALL *CallByteMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jchar (JNICALL *CallCharMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jchar (JNICALL *CallCharMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jchar (JNICALL *CallCharMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jshort (JNICALL *CallShortMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jshort (JNICALL *CallShortMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jshort (JNICALL *CallShortMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jint (JNICALL *CallIntMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jint (JNICALL *CallIntMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jint (JNICALL *CallIntMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jlong (JNICALL *CallLongMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jlong (JNICALL *CallLongMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jlong (JNICALL *CallLongMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jfloat (JNICALL *CallFloatMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jfloat (JNICALL *CallFloatMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jfloat (JNICALL *CallFloatMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jdouble (JNICALL *CallDoubleMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jdouble (JNICALL *CallDoubleMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jdouble (JNICALL *CallDoubleMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - void (JNICALL *CallVoidMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - void (JNICALL *CallVoidMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - void (JNICALL *CallVoidMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); - - jobject (JNICALL *CallNonvirtualObjectMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *CallNonvirtualObjectMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jobject (JNICALL *CallNonvirtualObjectMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue * args); - - jboolean (JNICALL *CallNonvirtualBooleanMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jboolean (JNICALL *CallNonvirtualBooleanMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jboolean (JNICALL *CallNonvirtualBooleanMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue * args); - - jbyte (JNICALL *CallNonvirtualByteMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jbyte (JNICALL *CallNonvirtualByteMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jbyte (JNICALL *CallNonvirtualByteMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jchar (JNICALL *CallNonvirtualCharMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jchar (JNICALL *CallNonvirtualCharMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jchar (JNICALL *CallNonvirtualCharMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jshort (JNICALL *CallNonvirtualShortMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jshort (JNICALL *CallNonvirtualShortMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jshort (JNICALL *CallNonvirtualShortMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jint (JNICALL *CallNonvirtualIntMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jint (JNICALL *CallNonvirtualIntMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jint (JNICALL *CallNonvirtualIntMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jlong (JNICALL *CallNonvirtualLongMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jlong (JNICALL *CallNonvirtualLongMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jlong (JNICALL *CallNonvirtualLongMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jfloat (JNICALL *CallNonvirtualFloatMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jfloat (JNICALL *CallNonvirtualFloatMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jfloat (JNICALL *CallNonvirtualFloatMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jdouble (JNICALL *CallNonvirtualDoubleMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jdouble (JNICALL *CallNonvirtualDoubleMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jdouble (JNICALL *CallNonvirtualDoubleMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - void (JNICALL *CallNonvirtualVoidMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - void (JNICALL *CallNonvirtualVoidMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - void (JNICALL *CallNonvirtualVoidMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue * args); - - jfieldID (JNICALL *GetFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *GetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jboolean (JNICALL *GetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jbyte (JNICALL *GetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jchar (JNICALL *GetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jshort (JNICALL *GetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jint (JNICALL *GetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jlong (JNICALL *GetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jfloat (JNICALL *GetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jdouble (JNICALL *GetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - - void (JNICALL *SetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); - void (JNICALL *SetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); - void (JNICALL *SetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); - void (JNICALL *SetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); - void (JNICALL *SetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); - void (JNICALL *SetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); - void (JNICALL *SetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); - void (JNICALL *SetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); - void (JNICALL *SetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); - - jmethodID (JNICALL *GetStaticMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *CallStaticObjectMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *CallStaticObjectMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (JNICALL *CallStaticObjectMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jboolean (JNICALL *CallStaticBooleanMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jboolean (JNICALL *CallStaticBooleanMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jboolean (JNICALL *CallStaticBooleanMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jbyte (JNICALL *CallStaticByteMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jbyte (JNICALL *CallStaticByteMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jbyte (JNICALL *CallStaticByteMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jchar (JNICALL *CallStaticCharMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jchar (JNICALL *CallStaticCharMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jchar (JNICALL *CallStaticCharMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jshort (JNICALL *CallStaticShortMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jshort (JNICALL *CallStaticShortMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jshort (JNICALL *CallStaticShortMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jint (JNICALL *CallStaticIntMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jint (JNICALL *CallStaticIntMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jint (JNICALL *CallStaticIntMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jlong (JNICALL *CallStaticLongMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jlong (JNICALL *CallStaticLongMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jlong (JNICALL *CallStaticLongMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jfloat (JNICALL *CallStaticFloatMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jfloat (JNICALL *CallStaticFloatMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jfloat (JNICALL *CallStaticFloatMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jdouble (JNICALL *CallStaticDoubleMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jdouble (JNICALL *CallStaticDoubleMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jdouble (JNICALL *CallStaticDoubleMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - void (JNICALL *CallStaticVoidMethod) - (JNIEnv *env, jclass cls, jmethodID methodID, ...); - void (JNICALL *CallStaticVoidMethodV) - (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); - void (JNICALL *CallStaticVoidMethodA) - (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args); - - jfieldID (JNICALL *GetStaticFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - jobject (JNICALL *GetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jboolean (JNICALL *GetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jbyte (JNICALL *GetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jchar (JNICALL *GetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jshort (JNICALL *GetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jint (JNICALL *GetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jlong (JNICALL *GetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jfloat (JNICALL *GetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jdouble (JNICALL *GetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - - void (JNICALL *SetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); - void (JNICALL *SetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); - void (JNICALL *SetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); - void (JNICALL *SetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); - void (JNICALL *SetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); - void (JNICALL *SetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); - void (JNICALL *SetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); - void (JNICALL *SetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); - void (JNICALL *SetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); - - jstring (JNICALL *NewString) - (JNIEnv *env, const jchar *unicode, jsize len); - jsize (JNICALL *GetStringLength) - (JNIEnv *env, jstring str); - const jchar *(JNICALL *GetStringChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (JNICALL *ReleaseStringChars) - (JNIEnv *env, jstring str, const jchar *chars); - - jstring (JNICALL *NewStringUTF) - (JNIEnv *env, const char *utf); - jsize (JNICALL *GetStringUTFLength) - (JNIEnv *env, jstring str); - const char* (JNICALL *GetStringUTFChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (JNICALL *ReleaseStringUTFChars) - (JNIEnv *env, jstring str, const char* chars); - - - jsize (JNICALL *GetArrayLength) - (JNIEnv *env, jarray array); - - jobjectArray (JNICALL *NewObjectArray) - (JNIEnv *env, jsize len, jclass clazz, jobject init); - jobject (JNICALL *GetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index); - void (JNICALL *SetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index, jobject val); - - jbooleanArray (JNICALL *NewBooleanArray) - (JNIEnv *env, jsize len); - jbyteArray (JNICALL *NewByteArray) - (JNIEnv *env, jsize len); - jcharArray (JNICALL *NewCharArray) - (JNIEnv *env, jsize len); - jshortArray (JNICALL *NewShortArray) - (JNIEnv *env, jsize len); - jintArray (JNICALL *NewIntArray) - (JNIEnv *env, jsize len); - jlongArray (JNICALL *NewLongArray) - (JNIEnv *env, jsize len); - jfloatArray (JNICALL *NewFloatArray) - (JNIEnv *env, jsize len); - jdoubleArray (JNICALL *NewDoubleArray) - (JNIEnv *env, jsize len); - - jboolean * (JNICALL *GetBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *isCopy); - jbyte * (JNICALL *GetByteArrayElements) - (JNIEnv *env, jbyteArray array, jboolean *isCopy); - jchar * (JNICALL *GetCharArrayElements) - (JNIEnv *env, jcharArray array, jboolean *isCopy); - jshort * (JNICALL *GetShortArrayElements) - (JNIEnv *env, jshortArray array, jboolean *isCopy); - jint * (JNICALL *GetIntArrayElements) - (JNIEnv *env, jintArray array, jboolean *isCopy); - jlong * (JNICALL *GetLongArrayElements) - (JNIEnv *env, jlongArray array, jboolean *isCopy); - jfloat * (JNICALL *GetFloatArrayElements) - (JNIEnv *env, jfloatArray array, jboolean *isCopy); - jdouble * (JNICALL *GetDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jboolean *isCopy); - - void (JNICALL *ReleaseBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); - void (JNICALL *ReleaseByteArrayElements) - (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); - void (JNICALL *ReleaseCharArrayElements) - (JNIEnv *env, jcharArray array, jchar *elems, jint mode); - void (JNICALL *ReleaseShortArrayElements) - (JNIEnv *env, jshortArray array, jshort *elems, jint mode); - void (JNICALL *ReleaseIntArrayElements) - (JNIEnv *env, jintArray array, jint *elems, jint mode); - void (JNICALL *ReleaseLongArrayElements) - (JNIEnv *env, jlongArray array, jlong *elems, jint mode); - void (JNICALL *ReleaseFloatArrayElements) - (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); - void (JNICALL *ReleaseDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); - - void (JNICALL *GetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); - void (JNICALL *GetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); - void (JNICALL *GetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); - void (JNICALL *GetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); - void (JNICALL *GetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); - void (JNICALL *GetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); - void (JNICALL *GetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); - void (JNICALL *GetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); - - void (JNICALL *SetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf); - void (JNICALL *SetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf); - void (JNICALL *SetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf); - void (JNICALL *SetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf); - void (JNICALL *SetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf); - void (JNICALL *SetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf); - void (JNICALL *SetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf); - void (JNICALL *SetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf); - - jint (JNICALL *RegisterNatives) - (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, - jint nMethods); - jint (JNICALL *UnregisterNatives) - (JNIEnv *env, jclass clazz); - - jint (JNICALL *MonitorEnter) - (JNIEnv *env, jobject obj); - jint (JNICALL *MonitorExit) - (JNIEnv *env, jobject obj); - - jint (JNICALL *GetJavaVM) - (JNIEnv *env, JavaVM **vm); - - void (JNICALL *GetStringRegion) - (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); - void (JNICALL *GetStringUTFRegion) - (JNIEnv *env, jstring str, jsize start, jsize len, char *buf); - - void * (JNICALL *GetPrimitiveArrayCritical) - (JNIEnv *env, jarray array, jboolean *isCopy); - void (JNICALL *ReleasePrimitiveArrayCritical) - (JNIEnv *env, jarray array, void *carray, jint mode); - - const jchar * (JNICALL *GetStringCritical) - (JNIEnv *env, jstring string, jboolean *isCopy); - void (JNICALL *ReleaseStringCritical) - (JNIEnv *env, jstring string, const jchar *cstring); - - jweak (JNICALL *NewWeakGlobalRef) - (JNIEnv *env, jobject obj); - void (JNICALL *DeleteWeakGlobalRef) - (JNIEnv *env, jweak ref); - - jboolean (JNICALL *ExceptionCheck) - (JNIEnv *env); - - jobject (JNICALL *NewDirectByteBuffer) - (JNIEnv* env, void* address, jlong capacity); - void* (JNICALL *GetDirectBufferAddress) - (JNIEnv* env, jobject buf); - jlong (JNICALL *GetDirectBufferCapacity) - (JNIEnv* env, jobject buf); - - /* New JNI 1.6 Features */ - - jobjectRefType (JNICALL *GetObjectRefType) - (JNIEnv* env, jobject obj); -}; - -/* - * We use inlined functions for C++ so that programmers can write: - * - * env->FindClass("java/lang/String") - * - * in C++ rather than: - * - * (*env)->FindClass(env, "java/lang/String") - * - * in C. - */ - -struct JNIEnv_ { - const struct JNINativeInterface_ *functions; -#ifdef __cplusplus - - jint GetVersion() { - return functions->GetVersion(this); - } - jclass DefineClass(const char *name, jobject loader, const jbyte *buf, - jsize len) { - return functions->DefineClass(this, name, loader, buf, len); - } - jclass FindClass(const char *name) { - return functions->FindClass(this, name); - } - jmethodID FromReflectedMethod(jobject method) { - return functions->FromReflectedMethod(this,method); - } - jfieldID FromReflectedField(jobject field) { - return functions->FromReflectedField(this,field); - } - - jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) { - return functions->ToReflectedMethod(this, cls, methodID, isStatic); - } - - jclass GetSuperclass(jclass sub) { - return functions->GetSuperclass(this, sub); - } - jboolean IsAssignableFrom(jclass sub, jclass sup) { - return functions->IsAssignableFrom(this, sub, sup); - } - - jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) { - return functions->ToReflectedField(this,cls,fieldID,isStatic); - } - - jint Throw(jthrowable obj) { - return functions->Throw(this, obj); - } - jint ThrowNew(jclass clazz, const char *msg) { - return functions->ThrowNew(this, clazz, msg); - } - jthrowable ExceptionOccurred() { - return functions->ExceptionOccurred(this); - } - void ExceptionDescribe() { - functions->ExceptionDescribe(this); - } - void ExceptionClear() { - functions->ExceptionClear(this); - } - void FatalError(const char *msg) { - functions->FatalError(this, msg); - } - - jint PushLocalFrame(jint capacity) { - return functions->PushLocalFrame(this,capacity); - } - jobject PopLocalFrame(jobject result) { - return functions->PopLocalFrame(this,result); - } - - jobject NewGlobalRef(jobject lobj) { - return functions->NewGlobalRef(this,lobj); - } - void DeleteGlobalRef(jobject gref) { - functions->DeleteGlobalRef(this,gref); - } - void DeleteLocalRef(jobject obj) { - functions->DeleteLocalRef(this, obj); - } - - jboolean IsSameObject(jobject obj1, jobject obj2) { - return functions->IsSameObject(this,obj1,obj2); - } - - jobject NewLocalRef(jobject ref) { - return functions->NewLocalRef(this,ref); - } - jint EnsureLocalCapacity(jint capacity) { - return functions->EnsureLocalCapacity(this,capacity); - } - - jobject AllocObject(jclass clazz) { - return functions->AllocObject(this,clazz); - } - jobject NewObject(jclass clazz, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args, methodID); - result = functions->NewObjectV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject NewObjectV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->NewObjectV(this,clazz,methodID,args); - } - jobject NewObjectA(jclass clazz, jmethodID methodID, - const jvalue *args) { - return functions->NewObjectA(this,clazz,methodID,args); - } - - jclass GetObjectClass(jobject obj) { - return functions->GetObjectClass(this,obj); - } - jboolean IsInstanceOf(jobject obj, jclass clazz) { - return functions->IsInstanceOf(this,obj,clazz); - } - - jmethodID GetMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetMethodID(this,clazz,name,sig); - } - - jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallObjectMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jobject CallObjectMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallObjectMethodV(this,obj,methodID,args); - } - jobject CallObjectMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallObjectMethodA(this,obj,methodID,args); - } - - jboolean CallBooleanMethod(jobject obj, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallBooleanMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallBooleanMethodV(this,obj,methodID,args); - } - jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallBooleanMethodA(this,obj,methodID, args); - } - - jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallByteMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jbyte CallByteMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallByteMethodV(this,obj,methodID,args); - } - jbyte CallByteMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallByteMethodA(this,obj,methodID,args); - } - - jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallCharMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jchar CallCharMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallCharMethodV(this,obj,methodID,args); - } - jchar CallCharMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallCharMethodA(this,obj,methodID,args); - } - - jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallShortMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jshort CallShortMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallShortMethodV(this,obj,methodID,args); - } - jshort CallShortMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallShortMethodA(this,obj,methodID,args); - } - - jint CallIntMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallIntMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jint CallIntMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallIntMethodV(this,obj,methodID,args); - } - jint CallIntMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallIntMethodA(this,obj,methodID,args); - } - - jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallLongMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jlong CallLongMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallLongMethodV(this,obj,methodID,args); - } - jlong CallLongMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallLongMethodA(this,obj,methodID,args); - } - - jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallFloatMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jfloat CallFloatMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallFloatMethodV(this,obj,methodID,args); - } - jfloat CallFloatMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallFloatMethodA(this,obj,methodID,args); - } - - jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallDoubleMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallDoubleMethodV(this,obj,methodID,args); - } - jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallDoubleMethodA(this,obj,methodID,args); - } - - void CallVoidMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallVoidMethodV(this,obj,methodID,args); - va_end(args); - } - void CallVoidMethodV(jobject obj, jmethodID methodID, - va_list args) { - functions->CallVoidMethodV(this,obj,methodID,args); - } - void CallVoidMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - functions->CallVoidMethodA(this,obj,methodID,args); - } - - jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - } - jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualObjectMethodA(this,obj,clazz, - methodID,args); - } - - jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - } - jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, - methodID, args); - } - - jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - } - jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualByteMethodA(this,obj,clazz, - methodID,args); - } - - jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - } - jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualCharMethodA(this,obj,clazz, - methodID,args); - } - - jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - } - jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualShortMethodA(this,obj,clazz, - methodID,args); - } - - jint CallNonvirtualIntMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - } - jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualIntMethodA(this,obj,clazz, - methodID,args); - } - - jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - } - jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualLongMethodA(this,obj,clazz, - methodID,args); - } - - jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - } - jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, - jmethodID methodID, - const jvalue * args) { - return functions->CallNonvirtualFloatMethodA(this,obj,clazz, - methodID,args); - } - - jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - } - jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, - jmethodID methodID, - const jvalue * args) { - return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, - methodID,args); - } - - void CallNonvirtualVoidMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - va_end(args); - } - void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - } - void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, - jmethodID methodID, - const jvalue * args) { - functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); - } - - jfieldID GetFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetFieldID(this,clazz,name,sig); - } - - jobject GetObjectField(jobject obj, jfieldID fieldID) { - return functions->GetObjectField(this,obj,fieldID); - } - jboolean GetBooleanField(jobject obj, jfieldID fieldID) { - return functions->GetBooleanField(this,obj,fieldID); - } - jbyte GetByteField(jobject obj, jfieldID fieldID) { - return functions->GetByteField(this,obj,fieldID); - } - jchar GetCharField(jobject obj, jfieldID fieldID) { - return functions->GetCharField(this,obj,fieldID); - } - jshort GetShortField(jobject obj, jfieldID fieldID) { - return functions->GetShortField(this,obj,fieldID); - } - jint GetIntField(jobject obj, jfieldID fieldID) { - return functions->GetIntField(this,obj,fieldID); - } - jlong GetLongField(jobject obj, jfieldID fieldID) { - return functions->GetLongField(this,obj,fieldID); - } - jfloat GetFloatField(jobject obj, jfieldID fieldID) { - return functions->GetFloatField(this,obj,fieldID); - } - jdouble GetDoubleField(jobject obj, jfieldID fieldID) { - return functions->GetDoubleField(this,obj,fieldID); - } - - void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { - functions->SetObjectField(this,obj,fieldID,val); - } - void SetBooleanField(jobject obj, jfieldID fieldID, - jboolean val) { - functions->SetBooleanField(this,obj,fieldID,val); - } - void SetByteField(jobject obj, jfieldID fieldID, - jbyte val) { - functions->SetByteField(this,obj,fieldID,val); - } - void SetCharField(jobject obj, jfieldID fieldID, - jchar val) { - functions->SetCharField(this,obj,fieldID,val); - } - void SetShortField(jobject obj, jfieldID fieldID, - jshort val) { - functions->SetShortField(this,obj,fieldID,val); - } - void SetIntField(jobject obj, jfieldID fieldID, - jint val) { - functions->SetIntField(this,obj,fieldID,val); - } - void SetLongField(jobject obj, jfieldID fieldID, - jlong val) { - functions->SetLongField(this,obj,fieldID,val); - } - void SetFloatField(jobject obj, jfieldID fieldID, - jfloat val) { - functions->SetFloatField(this,obj,fieldID,val); - } - void SetDoubleField(jobject obj, jfieldID fieldID, - jdouble val) { - functions->SetDoubleField(this,obj,fieldID,val); - } - - jmethodID GetStaticMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticMethodID(this,clazz,name,sig); - } - - jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, - ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->CallStaticObjectMethodV(this,clazz,methodID,args); - } - jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, - const jvalue *args) { - return functions->CallStaticObjectMethodA(this,clazz,methodID,args); - } - - jboolean CallStaticBooleanMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jboolean CallStaticBooleanMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - } - jboolean CallStaticBooleanMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); - } - - jbyte CallStaticByteMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallStaticByteMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jbyte CallStaticByteMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticByteMethodV(this,clazz,methodID,args); - } - jbyte CallStaticByteMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticByteMethodA(this,clazz,methodID,args); - } - - jchar CallStaticCharMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallStaticCharMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jchar CallStaticCharMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticCharMethodV(this,clazz,methodID,args); - } - jchar CallStaticCharMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticCharMethodA(this,clazz,methodID,args); - } - - jshort CallStaticShortMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallStaticShortMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jshort CallStaticShortMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticShortMethodV(this,clazz,methodID,args); - } - jshort CallStaticShortMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticShortMethodA(this,clazz,methodID,args); - } - - jint CallStaticIntMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallStaticIntMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jint CallStaticIntMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticIntMethodV(this,clazz,methodID,args); - } - jint CallStaticIntMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticIntMethodA(this,clazz,methodID,args); - } - - jlong CallStaticLongMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallStaticLongMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jlong CallStaticLongMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticLongMethodV(this,clazz,methodID,args); - } - jlong CallStaticLongMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticLongMethodA(this,clazz,methodID,args); - } - - jfloat CallStaticFloatMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jfloat CallStaticFloatMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticFloatMethodV(this,clazz,methodID,args); - } - jfloat CallStaticFloatMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticFloatMethodA(this,clazz,methodID,args); - } - - jdouble CallStaticDoubleMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jdouble CallStaticDoubleMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - } - jdouble CallStaticDoubleMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); - } - - void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallStaticVoidMethodV(this,cls,methodID,args); - va_end(args); - } - void CallStaticVoidMethodV(jclass cls, jmethodID methodID, - va_list args) { - functions->CallStaticVoidMethodV(this,cls,methodID,args); - } - void CallStaticVoidMethodA(jclass cls, jmethodID methodID, - const jvalue * args) { - functions->CallStaticVoidMethodA(this,cls,methodID,args); - } - - jfieldID GetStaticFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticFieldID(this,clazz,name,sig); - } - jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticObjectField(this,clazz,fieldID); - } - jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticBooleanField(this,clazz,fieldID); - } - jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticByteField(this,clazz,fieldID); - } - jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticCharField(this,clazz,fieldID); - } - jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticShortField(this,clazz,fieldID); - } - jint GetStaticIntField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticIntField(this,clazz,fieldID); - } - jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticLongField(this,clazz,fieldID); - } - jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticFloatField(this,clazz,fieldID); - } - jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticDoubleField(this,clazz,fieldID); - } - - void SetStaticObjectField(jclass clazz, jfieldID fieldID, - jobject value) { - functions->SetStaticObjectField(this,clazz,fieldID,value); - } - void SetStaticBooleanField(jclass clazz, jfieldID fieldID, - jboolean value) { - functions->SetStaticBooleanField(this,clazz,fieldID,value); - } - void SetStaticByteField(jclass clazz, jfieldID fieldID, - jbyte value) { - functions->SetStaticByteField(this,clazz,fieldID,value); - } - void SetStaticCharField(jclass clazz, jfieldID fieldID, - jchar value) { - functions->SetStaticCharField(this,clazz,fieldID,value); - } - void SetStaticShortField(jclass clazz, jfieldID fieldID, - jshort value) { - functions->SetStaticShortField(this,clazz,fieldID,value); - } - void SetStaticIntField(jclass clazz, jfieldID fieldID, - jint value) { - functions->SetStaticIntField(this,clazz,fieldID,value); - } - void SetStaticLongField(jclass clazz, jfieldID fieldID, - jlong value) { - functions->SetStaticLongField(this,clazz,fieldID,value); - } - void SetStaticFloatField(jclass clazz, jfieldID fieldID, - jfloat value) { - functions->SetStaticFloatField(this,clazz,fieldID,value); - } - void SetStaticDoubleField(jclass clazz, jfieldID fieldID, - jdouble value) { - functions->SetStaticDoubleField(this,clazz,fieldID,value); - } - - jstring NewString(const jchar *unicode, jsize len) { - return functions->NewString(this,unicode,len); - } - jsize GetStringLength(jstring str) { - return functions->GetStringLength(this,str); - } - const jchar *GetStringChars(jstring str, jboolean *isCopy) { - return functions->GetStringChars(this,str,isCopy); - } - void ReleaseStringChars(jstring str, const jchar *chars) { - functions->ReleaseStringChars(this,str,chars); - } - - jstring NewStringUTF(const char *utf) { - return functions->NewStringUTF(this,utf); - } - jsize GetStringUTFLength(jstring str) { - return functions->GetStringUTFLength(this,str); - } - const char* GetStringUTFChars(jstring str, jboolean *isCopy) { - return functions->GetStringUTFChars(this,str,isCopy); - } - void ReleaseStringUTFChars(jstring str, const char* chars) { - functions->ReleaseStringUTFChars(this,str,chars); - } - - jsize GetArrayLength(jarray array) { - return functions->GetArrayLength(this,array); - } - - jobjectArray NewObjectArray(jsize len, jclass clazz, - jobject init) { - return functions->NewObjectArray(this,len,clazz,init); - } - jobject GetObjectArrayElement(jobjectArray array, jsize index) { - return functions->GetObjectArrayElement(this,array,index); - } - void SetObjectArrayElement(jobjectArray array, jsize index, - jobject val) { - functions->SetObjectArrayElement(this,array,index,val); - } - - jbooleanArray NewBooleanArray(jsize len) { - return functions->NewBooleanArray(this,len); - } - jbyteArray NewByteArray(jsize len) { - return functions->NewByteArray(this,len); - } - jcharArray NewCharArray(jsize len) { - return functions->NewCharArray(this,len); - } - jshortArray NewShortArray(jsize len) { - return functions->NewShortArray(this,len); - } - jintArray NewIntArray(jsize len) { - return functions->NewIntArray(this,len); - } - jlongArray NewLongArray(jsize len) { - return functions->NewLongArray(this,len); - } - jfloatArray NewFloatArray(jsize len) { - return functions->NewFloatArray(this,len); - } - jdoubleArray NewDoubleArray(jsize len) { - return functions->NewDoubleArray(this,len); - } - - jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { - return functions->GetBooleanArrayElements(this,array,isCopy); - } - jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { - return functions->GetByteArrayElements(this,array,isCopy); - } - jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { - return functions->GetCharArrayElements(this,array,isCopy); - } - jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { - return functions->GetShortArrayElements(this,array,isCopy); - } - jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { - return functions->GetIntArrayElements(this,array,isCopy); - } - jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { - return functions->GetLongArrayElements(this,array,isCopy); - } - jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { - return functions->GetFloatArrayElements(this,array,isCopy); - } - jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { - return functions->GetDoubleArrayElements(this,array,isCopy); - } - - void ReleaseBooleanArrayElements(jbooleanArray array, - jboolean *elems, - jint mode) { - functions->ReleaseBooleanArrayElements(this,array,elems,mode); - } - void ReleaseByteArrayElements(jbyteArray array, - jbyte *elems, - jint mode) { - functions->ReleaseByteArrayElements(this,array,elems,mode); - } - void ReleaseCharArrayElements(jcharArray array, - jchar *elems, - jint mode) { - functions->ReleaseCharArrayElements(this,array,elems,mode); - } - void ReleaseShortArrayElements(jshortArray array, - jshort *elems, - jint mode) { - functions->ReleaseShortArrayElements(this,array,elems,mode); - } - void ReleaseIntArrayElements(jintArray array, - jint *elems, - jint mode) { - functions->ReleaseIntArrayElements(this,array,elems,mode); - } - void ReleaseLongArrayElements(jlongArray array, - jlong *elems, - jint mode) { - functions->ReleaseLongArrayElements(this,array,elems,mode); - } - void ReleaseFloatArrayElements(jfloatArray array, - jfloat *elems, - jint mode) { - functions->ReleaseFloatArrayElements(this,array,elems,mode); - } - void ReleaseDoubleArrayElements(jdoubleArray array, - jdouble *elems, - jint mode) { - functions->ReleaseDoubleArrayElements(this,array,elems,mode); - } - - void GetBooleanArrayRegion(jbooleanArray array, - jsize start, jsize len, jboolean *buf) { - functions->GetBooleanArrayRegion(this,array,start,len,buf); - } - void GetByteArrayRegion(jbyteArray array, - jsize start, jsize len, jbyte *buf) { - functions->GetByteArrayRegion(this,array,start,len,buf); - } - void GetCharArrayRegion(jcharArray array, - jsize start, jsize len, jchar *buf) { - functions->GetCharArrayRegion(this,array,start,len,buf); - } - void GetShortArrayRegion(jshortArray array, - jsize start, jsize len, jshort *buf) { - functions->GetShortArrayRegion(this,array,start,len,buf); - } - void GetIntArrayRegion(jintArray array, - jsize start, jsize len, jint *buf) { - functions->GetIntArrayRegion(this,array,start,len,buf); - } - void GetLongArrayRegion(jlongArray array, - jsize start, jsize len, jlong *buf) { - functions->GetLongArrayRegion(this,array,start,len,buf); - } - void GetFloatArrayRegion(jfloatArray array, - jsize start, jsize len, jfloat *buf) { - functions->GetFloatArrayRegion(this,array,start,len,buf); - } - void GetDoubleArrayRegion(jdoubleArray array, - jsize start, jsize len, jdouble *buf) { - functions->GetDoubleArrayRegion(this,array,start,len,buf); - } - - void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, - const jboolean *buf) { - functions->SetBooleanArrayRegion(this,array,start,len,buf); - } - void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, - const jbyte *buf) { - functions->SetByteArrayRegion(this,array,start,len,buf); - } - void SetCharArrayRegion(jcharArray array, jsize start, jsize len, - const jchar *buf) { - functions->SetCharArrayRegion(this,array,start,len,buf); - } - void SetShortArrayRegion(jshortArray array, jsize start, jsize len, - const jshort *buf) { - functions->SetShortArrayRegion(this,array,start,len,buf); - } - void SetIntArrayRegion(jintArray array, jsize start, jsize len, - const jint *buf) { - functions->SetIntArrayRegion(this,array,start,len,buf); - } - void SetLongArrayRegion(jlongArray array, jsize start, jsize len, - const jlong *buf) { - functions->SetLongArrayRegion(this,array,start,len,buf); - } - void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, - const jfloat *buf) { - functions->SetFloatArrayRegion(this,array,start,len,buf); - } - void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, - const jdouble *buf) { - functions->SetDoubleArrayRegion(this,array,start,len,buf); - } - - jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, - jint nMethods) { - return functions->RegisterNatives(this,clazz,methods,nMethods); - } - jint UnregisterNatives(jclass clazz) { - return functions->UnregisterNatives(this,clazz); - } - - jint MonitorEnter(jobject obj) { - return functions->MonitorEnter(this,obj); - } - jint MonitorExit(jobject obj) { - return functions->MonitorExit(this,obj); - } - - jint GetJavaVM(JavaVM **vm) { - return functions->GetJavaVM(this,vm); - } - - void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) { - functions->GetStringRegion(this,str,start,len,buf); - } - void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) { - functions->GetStringUTFRegion(this,str,start,len,buf); - } - - void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) { - return functions->GetPrimitiveArrayCritical(this,array,isCopy); - } - void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) { - functions->ReleasePrimitiveArrayCritical(this,array,carray,mode); - } - - const jchar * GetStringCritical(jstring string, jboolean *isCopy) { - return functions->GetStringCritical(this,string,isCopy); - } - void ReleaseStringCritical(jstring string, const jchar *cstring) { - functions->ReleaseStringCritical(this,string,cstring); - } - - jweak NewWeakGlobalRef(jobject obj) { - return functions->NewWeakGlobalRef(this,obj); - } - void DeleteWeakGlobalRef(jweak ref) { - functions->DeleteWeakGlobalRef(this,ref); - } - - jboolean ExceptionCheck() { - return functions->ExceptionCheck(this); - } - - jobject NewDirectByteBuffer(void* address, jlong capacity) { - return functions->NewDirectByteBuffer(this, address, capacity); - } - void* GetDirectBufferAddress(jobject buf) { - return functions->GetDirectBufferAddress(this, buf); - } - jlong GetDirectBufferCapacity(jobject buf) { - return functions->GetDirectBufferCapacity(this, buf); - } - jobjectRefType GetObjectRefType(jobject obj) { - return functions->GetObjectRefType(this, obj); - } - -#endif /* __cplusplus */ -}; - -typedef struct JavaVMOption { - char *optionString; - void *extraInfo; -} JavaVMOption; - -typedef struct JavaVMInitArgs { - jint version; - - jint nOptions; - JavaVMOption *options; - jboolean ignoreUnrecognized; -} JavaVMInitArgs; - -typedef struct JavaVMAttachArgs { - jint version; - - char *name; - jobject group; -} JavaVMAttachArgs; - -/* These will be VM-specific. */ - -#define JDK1_2 -#define JDK1_4 - -/* End VM-specific. */ - -struct JNIInvokeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - - jint (JNICALL *DestroyJavaVM)(JavaVM *vm); - - jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args); - - jint (JNICALL *DetachCurrentThread)(JavaVM *vm); - - jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version); - - jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args); -}; - -struct JavaVM_ { - const struct JNIInvokeInterface_ *functions; -#ifdef __cplusplus - - jint DestroyJavaVM() { - return functions->DestroyJavaVM(this); - } - jint AttachCurrentThread(void **penv, void *args) { - return functions->AttachCurrentThread(this, penv, args); - } - jint DetachCurrentThread() { - return functions->DetachCurrentThread(this); - } - - jint GetEnv(void **penv, jint version) { - return functions->GetEnv(this, penv, version); - } - jint AttachCurrentThreadAsDaemon(void **penv, void *args) { - return functions->AttachCurrentThreadAsDaemon(this, penv, args); - } -#endif -}; - -#ifdef _JNI_IMPLEMENTATION_ -#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT -#else -#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT -#endif -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_GetDefaultJavaVMInitArgs(void *args); - -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args); - -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); - -/* Defined by native libraries. */ -JNIEXPORT jint JNICALL -JNI_OnLoad(JavaVM *vm, void *reserved); - -JNIEXPORT void JNICALL -JNI_OnUnload(JavaVM *vm, void *reserved); - -#define JNI_VERSION_1_1 0x00010001 -#define JNI_VERSION_1_2 0x00010002 -#define JNI_VERSION_1_4 0x00010004 -#define JNI_VERSION_1_6 0x00010006 - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* !_JAVASOFT_JNI_H_ */ diff -Nru icedtea-web-1.3.2/launcher/jni_md.h icedtea-web-1.4/launcher/jni_md.h --- icedtea-web-1.3.2/launcher/jni_md.h 2013-04-10 11:40:23.839668000 +0000 +++ icedtea-web-1.4/launcher/jni_md.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#ifndef _JAVASOFT_JNI_MD_H_ -#define _JAVASOFT_JNI_MD_H_ - -#define JNIEXPORT -#define JNIIMPORT -#define JNICALL - -typedef int jint; -#ifdef _LP64 /* 64-bit Solaris */ -typedef long jlong; -#else -typedef long long jlong; -#endif - -typedef signed char jbyte; - -#endif /* !_JAVASOFT_JNI_MD_H_ */ diff -Nru icedtea-web-1.3.2/launcher/jvm.h icedtea-web-1.4/launcher/jvm.h --- icedtea-web-1.3.2/launcher/jvm.h 2013-04-10 11:40:23.839668000 +0000 +++ icedtea-web-1.4/launcher/jvm.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1501 +0,0 @@ -/* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#ifndef _JAVASOFT_JVM_H_ -#define _JAVASOFT_JVM_H_ - -#include - -#include "jni.h" -#include "jvm_md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * This file contains additional functions exported from the VM. - * These functions are complementary to the standard JNI support. - * There are three parts to this file: - * - * First, this file contains the VM-related functions needed by native - * libraries in the standard Java API. For example, the java.lang.Object - * class needs VM-level functions that wait for and notify monitors. - * - * Second, this file contains the functions and constant definitions - * needed by the byte code verifier and class file format checker. - * These functions allow the verifier and format checker to be written - * in a VM-independent way. - * - * Third, this file contains various I/O and nerwork operations needed - * by the standard Java I/O and network APIs. - */ - -/* - * Bump the version number when either of the following happens: - * - * 1. There is a change in JVM_* functions. - * - * 2. There is a change in the contract between VM and Java classes. - * For example, if the VM relies on a new private field in Thread - * class. - */ - -#define JVM_INTERFACE_VERSION 4 - -JNIEXPORT jint JNICALL -JVM_GetInterfaceVersion(void); - -/************************************************************************* - PART 1: Functions for Native Libraries - ************************************************************************/ -/* - * java.lang.Object - */ -JNIEXPORT jint JNICALL -JVM_IHashCode(JNIEnv *env, jobject obj); - -JNIEXPORT void JNICALL -JVM_MonitorWait(JNIEnv *env, jobject obj, jlong ms); - -JNIEXPORT void JNICALL -JVM_MonitorNotify(JNIEnv *env, jobject obj); - -JNIEXPORT void JNICALL -JVM_MonitorNotifyAll(JNIEnv *env, jobject obj); - -JNIEXPORT jobject JNICALL -JVM_Clone(JNIEnv *env, jobject obj); - -/* - * java.lang.String - */ -JNIEXPORT jstring JNICALL -JVM_InternString(JNIEnv *env, jstring str); - -/* - * java.lang.System - */ -JNIEXPORT jlong JNICALL -JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored); - -JNIEXPORT jlong JNICALL -JVM_NanoTime(JNIEnv *env, jclass ignored); - -JNIEXPORT void JNICALL -JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos, - jobject dst, jint dst_pos, jint length); - -JNIEXPORT jobject JNICALL -JVM_InitProperties(JNIEnv *env, jobject p); - -/* - * java.io.File - */ -JNIEXPORT void JNICALL -JVM_OnExit(void (*func)(void)); - -/* - * java.lang.Runtime - */ -JNIEXPORT void JNICALL -JVM_Exit(jint code); - -JNIEXPORT void JNICALL -JVM_Halt(jint code); - -JNIEXPORT void JNICALL -JVM_GC(void); - -/* Returns the number of real-time milliseconds that have elapsed since the - * least-recently-inspected heap object was last inspected by the garbage - * collector. - * - * For simple stop-the-world collectors this value is just the time - * since the most recent collection. For generational collectors it is the - * time since the oldest generation was most recently collected. Other - * collectors are free to return a pessimistic estimate of the elapsed time, or - * simply the time since the last full collection was performed. - * - * Note that in the presence of reference objects, a given object that is no - * longer strongly reachable may have to be inspected multiple times before it - * can be reclaimed. - */ -JNIEXPORT jlong JNICALL -JVM_MaxObjectInspectionAge(void); - -JNIEXPORT void JNICALL -JVM_TraceInstructions(jboolean on); - -JNIEXPORT void JNICALL -JVM_TraceMethodCalls(jboolean on); - -JNIEXPORT jlong JNICALL -JVM_TotalMemory(void); - -JNIEXPORT jlong JNICALL -JVM_FreeMemory(void); - -JNIEXPORT jlong JNICALL -JVM_MaxMemory(void); - -JNIEXPORT jint JNICALL -JVM_ActiveProcessorCount(void); - -JNIEXPORT void * JNICALL -JVM_LoadLibrary(const char *name); - -JNIEXPORT void JNICALL -JVM_UnloadLibrary(void * handle); - -JNIEXPORT void * JNICALL -JVM_FindLibraryEntry(void *handle, const char *name); - -JNIEXPORT jboolean JNICALL -JVM_IsSupportedJNIVersion(jint version); - -/* - * java.lang.Float and java.lang.Double - */ -JNIEXPORT jboolean JNICALL -JVM_IsNaN(jdouble d); - -/* - * java.lang.Throwable - */ -JNIEXPORT void JNICALL -JVM_FillInStackTrace(JNIEnv *env, jobject throwable); - -JNIEXPORT void JNICALL -JVM_PrintStackTrace(JNIEnv *env, jobject throwable, jobject printable); - -JNIEXPORT jint JNICALL -JVM_GetStackTraceDepth(JNIEnv *env, jobject throwable); - -JNIEXPORT jobject JNICALL -JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index); - -/* - * java.lang.Compiler - */ -JNIEXPORT void JNICALL -JVM_InitializeCompiler (JNIEnv *env, jclass compCls); - -JNIEXPORT jboolean JNICALL -JVM_IsSilentCompiler(JNIEnv *env, jclass compCls); - -JNIEXPORT jboolean JNICALL -JVM_CompileClass(JNIEnv *env, jclass compCls, jclass cls); - -JNIEXPORT jboolean JNICALL -JVM_CompileClasses(JNIEnv *env, jclass cls, jstring jname); - -JNIEXPORT jobject JNICALL -JVM_CompilerCommand(JNIEnv *env, jclass compCls, jobject arg); - -JNIEXPORT void JNICALL -JVM_EnableCompiler(JNIEnv *env, jclass compCls); - -JNIEXPORT void JNICALL -JVM_DisableCompiler(JNIEnv *env, jclass compCls); - -/* - * java.lang.Thread - */ -JNIEXPORT void JNICALL -JVM_StartThread(JNIEnv *env, jobject thread); - -JNIEXPORT void JNICALL -JVM_StopThread(JNIEnv *env, jobject thread, jobject exception); - -JNIEXPORT jboolean JNICALL -JVM_IsThreadAlive(JNIEnv *env, jobject thread); - -JNIEXPORT void JNICALL -JVM_SuspendThread(JNIEnv *env, jobject thread); - -JNIEXPORT void JNICALL -JVM_ResumeThread(JNIEnv *env, jobject thread); - -JNIEXPORT void JNICALL -JVM_SetThreadPriority(JNIEnv *env, jobject thread, jint prio); - -JNIEXPORT void JNICALL -JVM_Yield(JNIEnv *env, jclass threadClass); - -JNIEXPORT void JNICALL -JVM_Sleep(JNIEnv *env, jclass threadClass, jlong millis); - -JNIEXPORT jobject JNICALL -JVM_CurrentThread(JNIEnv *env, jclass threadClass); - -JNIEXPORT jint JNICALL -JVM_CountStackFrames(JNIEnv *env, jobject thread); - -JNIEXPORT void JNICALL -JVM_Interrupt(JNIEnv *env, jobject thread); - -JNIEXPORT jboolean JNICALL -JVM_IsInterrupted(JNIEnv *env, jobject thread, jboolean clearInterrupted); - -JNIEXPORT jboolean JNICALL -JVM_HoldsLock(JNIEnv *env, jclass threadClass, jobject obj); - -JNIEXPORT void JNICALL -JVM_DumpAllStacks(JNIEnv *env, jclass unused); - -JNIEXPORT jobjectArray JNICALL -JVM_GetAllThreads(JNIEnv *env, jclass dummy); - -/* getStackTrace() and getAllStackTraces() method */ -JNIEXPORT jobjectArray JNICALL -JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads); - -/* - * java.lang.SecurityManager - */ -JNIEXPORT jclass JNICALL -JVM_CurrentLoadedClass(JNIEnv *env); - -JNIEXPORT jobject JNICALL -JVM_CurrentClassLoader(JNIEnv *env); - -JNIEXPORT jobjectArray JNICALL -JVM_GetClassContext(JNIEnv *env); - -JNIEXPORT jint JNICALL -JVM_ClassDepth(JNIEnv *env, jstring name); - -JNIEXPORT jint JNICALL -JVM_ClassLoaderDepth(JNIEnv *env); - -/* - * java.lang.Package - */ -JNIEXPORT jstring JNICALL -JVM_GetSystemPackage(JNIEnv *env, jstring name); - -JNIEXPORT jobjectArray JNICALL -JVM_GetSystemPackages(JNIEnv *env); - -/* - * java.io.ObjectInputStream - */ -JNIEXPORT jobject JNICALL -JVM_AllocateNewObject(JNIEnv *env, jobject obj, jclass currClass, - jclass initClass); - -JNIEXPORT jobject JNICALL -JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currClass, - jint length); - -JNIEXPORT jobject JNICALL -JVM_LatestUserDefinedLoader(JNIEnv *env); - -/* - * This function has been deprecated and should not be considered - * part of the specified JVM interface. - */ -JNIEXPORT jclass JNICALL -JVM_LoadClass0(JNIEnv *env, jobject obj, jclass currClass, - jstring currClassName); - -/* - * java.lang.reflect.Array - */ -JNIEXPORT jint JNICALL -JVM_GetArrayLength(JNIEnv *env, jobject arr); - -JNIEXPORT jobject JNICALL -JVM_GetArrayElement(JNIEnv *env, jobject arr, jint index); - -JNIEXPORT jvalue JNICALL -JVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode); - -JNIEXPORT void JNICALL -JVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val); - -JNIEXPORT void JNICALL -JVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v, - unsigned char vCode); - -JNIEXPORT jobject JNICALL -JVM_NewArray(JNIEnv *env, jclass eltClass, jint length); - -JNIEXPORT jobject JNICALL -JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim); - -/* - * java.lang.Class and java.lang.ClassLoader - */ -/* - * Returns the class in which the code invoking the native method - * belongs. - * - * Note that in JDK 1.1, native methods did not create a frame. - * In 1.2, they do. Therefore native methods like Class.forName - * can no longer look at the current frame for the caller class. - */ -JNIEXPORT jclass JNICALL -JVM_GetCallerClass(JNIEnv *env, int n); - -/* - * Find primitive classes - * utf: class name - */ -JNIEXPORT jclass JNICALL -JVM_FindPrimitiveClass(JNIEnv *env, const char *utf); - -/* - * Link the class - */ -JNIEXPORT void JNICALL -JVM_ResolveClass(JNIEnv *env, jclass cls); - -/* - * Find a class from a given class loader. Throw ClassNotFoundException - * or NoClassDefFoundError depending on the value of the last - * argument. - */ -JNIEXPORT jclass JNICALL -JVM_FindClassFromClassLoader(JNIEnv *env, const char *name, jboolean init, - jobject loader, jboolean throwError); - -/* - * Find a class from a given class. - */ -JNIEXPORT jclass JNICALL -JVM_FindClassFromClass(JNIEnv *env, const char *name, jboolean init, - jclass from); - -/* Find a loaded class cached by the VM */ -JNIEXPORT jclass JNICALL -JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name); - -/* Define a class */ -JNIEXPORT jclass JNICALL -JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, - jsize len, jobject pd); - -/* Define a class with a source (added in JDK1.5) */ -JNIEXPORT jclass JNICALL -JVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader, - const jbyte *buf, jsize len, jobject pd, - const char *source); - -/* - * Reflection support functions - */ - -JNIEXPORT jstring JNICALL -JVM_GetClassName(JNIEnv *env, jclass cls); - -JNIEXPORT jobjectArray JNICALL -JVM_GetClassInterfaces(JNIEnv *env, jclass cls); - -JNIEXPORT jobject JNICALL -JVM_GetClassLoader(JNIEnv *env, jclass cls); - -JNIEXPORT jboolean JNICALL -JVM_IsInterface(JNIEnv *env, jclass cls); - -JNIEXPORT jobjectArray JNICALL -JVM_GetClassSigners(JNIEnv *env, jclass cls); - -JNIEXPORT void JNICALL -JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signers); - -JNIEXPORT jobject JNICALL -JVM_GetProtectionDomain(JNIEnv *env, jclass cls); - -JNIEXPORT void JNICALL -JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protection_domain); - -JNIEXPORT jboolean JNICALL -JVM_IsArrayClass(JNIEnv *env, jclass cls); - -JNIEXPORT jboolean JNICALL -JVM_IsPrimitiveClass(JNIEnv *env, jclass cls); - -JNIEXPORT jclass JNICALL -JVM_GetComponentType(JNIEnv *env, jclass cls); - -JNIEXPORT jint JNICALL -JVM_GetClassModifiers(JNIEnv *env, jclass cls); - -JNIEXPORT jobjectArray JNICALL -JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass); - -JNIEXPORT jclass JNICALL -JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass); - -/* Generics support (JDK 1.5) */ -JNIEXPORT jstring JNICALL -JVM_GetClassSignature(JNIEnv *env, jclass cls); - -/* Annotations support (JDK 1.5) */ -JNIEXPORT jbyteArray JNICALL -JVM_GetClassAnnotations(JNIEnv *env, jclass cls); - -/* - * New (JDK 1.4) reflection implementation - */ - -JNIEXPORT jobjectArray JNICALL -JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly); - -JNIEXPORT jobjectArray JNICALL -JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, jboolean publicOnly); - -JNIEXPORT jobjectArray JNICALL -JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofClass, jboolean publicOnly); - -/* Differs from JVM_GetClassModifiers in treatment of inner classes. - This returns the access flags for the class as specified in the - class file rather than searching the InnerClasses attribute (if - present) to find the source-level access flags. Only the values of - the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be - valid. */ -JNIEXPORT jint JNICALL -JVM_GetClassAccessFlags(JNIEnv *env, jclass cls); - -/* The following two reflection routines are still needed due to startup time issues */ -/* - * java.lang.reflect.Method - */ -JNIEXPORT jobject JNICALL -JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0); - -/* - * java.lang.reflect.Constructor - */ -JNIEXPORT jobject JNICALL -JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0); - -/* - * Constant pool access; currently used to implement reflective access to annotations (JDK 1.5) - */ - -JNIEXPORT jobject JNICALL -JVM_GetClassConstantPool(JNIEnv *env, jclass cls); - -JNIEXPORT jint JNICALL JVM_ConstantPoolGetSize -(JNIEnv *env, jobject unused, jobject jcpool); - -JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAtIfLoaded -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAt -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jlong JNICALL JVM_ConstantPoolGetLongAt -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jfloat JNICALL JVM_ConstantPoolGetFloatAt -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jdouble JNICALL JVM_ConstantPoolGetDoubleAt -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At -(JNIEnv *env, jobject unused, jobject jcpool, jint index); - -/* - * java.security.* - */ - -JNIEXPORT jobject JNICALL -JVM_DoPrivileged(JNIEnv *env, jclass cls, - jobject action, jobject context, jboolean wrapException); - -JNIEXPORT jobject JNICALL -JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls); - -JNIEXPORT jobject JNICALL -JVM_GetStackAccessControlContext(JNIEnv *env, jclass cls); - -/* - * Signal support, used to implement the shutdown sequence. Every VM must - * support JVM_SIGINT and JVM_SIGTERM, raising the former for user interrupts - * (^C) and the latter for external termination (kill, system shutdown, etc.). - * Other platform-dependent signal values may also be supported. - */ - -JNIEXPORT void * JNICALL -JVM_RegisterSignal(jint sig, void *handler); - -JNIEXPORT jboolean JNICALL -JVM_RaiseSignal(jint sig); - -JNIEXPORT jint JNICALL -JVM_FindSignal(const char *name); - -/* - * Retrieve the assertion directives for the specified class. - */ -JNIEXPORT jboolean JNICALL -JVM_DesiredAssertionStatus(JNIEnv *env, jclass unused, jclass cls); - -/* - * Retrieve the assertion directives from the VM. - */ -JNIEXPORT jobject JNICALL -JVM_AssertionStatusDirectives(JNIEnv *env, jclass unused); - -/* - * java.util.concurrent.AtomicLong - */ -JNIEXPORT jboolean JNICALL -JVM_SupportsCX8(void); - -/************************************************************************* - PART 2: Support for the Verifier and Class File Format Checker - ************************************************************************/ -/* - * Return the class name in UTF format. The result is valid - * until JVM_ReleaseUTf is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetClassNameUTF(JNIEnv *env, jclass cb); - -/* - * Returns the constant pool types in the buffer provided by "types." - */ -JNIEXPORT void JNICALL -JVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types); - -/* - * Returns the number of Constant Pool entries. - */ -JNIEXPORT jint JNICALL -JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb); - -/* - * Returns the number of *declared* fields or methods. - */ -JNIEXPORT jint JNICALL -JVM_GetClassFieldsCount(JNIEnv *env, jclass cb); - -JNIEXPORT jint JNICALL -JVM_GetClassMethodsCount(JNIEnv *env, jclass cb); - -/* - * Returns the CP indexes of exceptions raised by a given method. - * Places the result in the given buffer. - * - * The method is identified by method_index. - */ -JNIEXPORT void JNICALL -JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index, - unsigned short *exceptions); -/* - * Returns the number of exceptions raised by a given method. - * The method is identified by method_index. - */ -JNIEXPORT jint JNICALL -JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index); - -/* - * Returns the byte code sequence of a given method. - * Places the result in the given buffer. - * - * The method is identified by method_index. - */ -JNIEXPORT void JNICALL -JVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index, - unsigned char *code); - -/* - * Returns the length of the byte code sequence of a given method. - * The method is identified by method_index. - */ -JNIEXPORT jint JNICALL -JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index); - -/* - * A structure used to a capture exception table entry in a Java method. - */ -typedef struct { - jint start_pc; - jint end_pc; - jint handler_pc; - jint catchType; -} JVM_ExceptionTableEntryType; - -/* - * Returns the exception table entry at entry_index of a given method. - * Places the result in the given buffer. - * - * The method is identified by method_index. - */ -JNIEXPORT void JNICALL -JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cb, jint method_index, - jint entry_index, - JVM_ExceptionTableEntryType *entry); - -/* - * Returns the length of the exception table of a given method. - * The method is identified by method_index. - */ -JNIEXPORT jint JNICALL -JVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cb, int index); - -/* - * Returns the modifiers of a given field. - * The field is identified by field_index. - */ -JNIEXPORT jint JNICALL -JVM_GetFieldIxModifiers(JNIEnv *env, jclass cb, int index); - -/* - * Returns the modifiers of a given method. - * The method is identified by method_index. - */ -JNIEXPORT jint JNICALL -JVM_GetMethodIxModifiers(JNIEnv *env, jclass cb, int index); - -/* - * Returns the number of local variables of a given method. - * The method is identified by method_index. - */ -JNIEXPORT jint JNICALL -JVM_GetMethodIxLocalsCount(JNIEnv *env, jclass cb, int index); - -/* - * Returns the number of arguments (including this pointer) of a given method. - * The method is identified by method_index. - */ -JNIEXPORT jint JNICALL -JVM_GetMethodIxArgsSize(JNIEnv *env, jclass cb, int index); - -/* - * Returns the maximum amount of stack (in words) used by a given method. - * The method is identified by method_index. - */ -JNIEXPORT jint JNICALL -JVM_GetMethodIxMaxStack(JNIEnv *env, jclass cb, int index); - -/* - * Is a given method a constructor. - * The method is identified by method_index. - */ -JNIEXPORT jboolean JNICALL -JVM_IsConstructorIx(JNIEnv *env, jclass cb, int index); - -/* - * Returns the name of a given method in UTF format. - * The result remains valid until JVM_ReleaseUTF is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetMethodIxNameUTF(JNIEnv *env, jclass cb, jint index); - -/* - * Returns the signature of a given method in UTF format. - * The result remains valid until JVM_ReleaseUTF is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cb, jint index); - -/* - * Returns the name of the field refered to at a given constant pool - * index. - * - * The result is in UTF format and remains valid until JVM_ReleaseUTF - * is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetCPFieldNameUTF(JNIEnv *env, jclass cb, jint index); - -/* - * Returns the name of the method refered to at a given constant pool - * index. - * - * The result is in UTF format and remains valid until JVM_ReleaseUTF - * is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cb, jint index); - -/* - * Returns the signature of the method refered to at a given constant pool - * index. - * - * The result is in UTF format and remains valid until JVM_ReleaseUTF - * is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cb, jint index); - -/* - * Returns the signature of the field refered to at a given constant pool - * index. - * - * The result is in UTF format and remains valid until JVM_ReleaseUTF - * is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cb, jint index); - -/* - * Returns the class name refered to at a given constant pool index. - * - * The result is in UTF format and remains valid until JVM_ReleaseUTF - * is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetCPClassNameUTF(JNIEnv *env, jclass cb, jint index); - -/* - * Returns the class name refered to at a given constant pool index. - * - * The constant pool entry must refer to a CONSTANT_Fieldref. - * - * The result is in UTF format and remains valid until JVM_ReleaseUTF - * is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cb, jint index); - -/* - * Returns the class name refered to at a given constant pool index. - * - * The constant pool entry must refer to CONSTANT_Methodref or - * CONSTANT_InterfaceMethodref. - * - * The result is in UTF format and remains valid until JVM_ReleaseUTF - * is called. - * - * The caller must treat the string as a constant and not modify it - * in any way. - */ -JNIEXPORT const char * JNICALL -JVM_GetCPMethodClassNameUTF(JNIEnv *env, jclass cb, jint index); - -/* - * Returns the modifiers of a field in calledClass. The field is - * referred to in class cb at constant pool entry index. - * - * The caller must treat the string as a constant and not modify it - * in any way. - * - * Returns -1 if the field does not exist in calledClass. - */ -JNIEXPORT jint JNICALL -JVM_GetCPFieldModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass); - -/* - * Returns the modifiers of a method in calledClass. The method is - * referred to in class cb at constant pool entry index. - * - * Returns -1 if the method does not exist in calledClass. - */ -JNIEXPORT jint JNICALL -JVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass); - -/* - * Releases the UTF string obtained from the VM. - */ -JNIEXPORT void JNICALL -JVM_ReleaseUTF(const char *utf); - -/* - * Compare if two classes are in the same package. - */ -JNIEXPORT jboolean JNICALL -JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2); - -/* Constants in class files */ - -#define JVM_ACC_PUBLIC 0x0001 /* visible to everyone */ -#define JVM_ACC_PRIVATE 0x0002 /* visible only to the defining class */ -#define JVM_ACC_PROTECTED 0x0004 /* visible to subclasses */ -#define JVM_ACC_STATIC 0x0008 /* instance variable is static */ -#define JVM_ACC_FINAL 0x0010 /* no further subclassing, overriding */ -#define JVM_ACC_SYNCHRONIZED 0x0020 /* wrap method call in monitor lock */ -#define JVM_ACC_SUPER 0x0020 /* funky handling of invokespecial */ -#define JVM_ACC_VOLATILE 0x0040 /* can not cache in registers */ -#define JVM_ACC_BRIDGE 0x0040 /* bridge method generated by compiler */ -#define JVM_ACC_TRANSIENT 0x0080 /* not persistant */ -#define JVM_ACC_VARARGS 0x0080 /* method declared with variable number of args */ -#define JVM_ACC_NATIVE 0x0100 /* implemented in C */ -#define JVM_ACC_INTERFACE 0x0200 /* class is an interface */ -#define JVM_ACC_ABSTRACT 0x0400 /* no definition provided */ -#define JVM_ACC_STRICT 0x0800 /* strict floating point */ -#define JVM_ACC_SYNTHETIC 0x1000 /* compiler-generated class, method or field */ - -#define JVM_ACC_ANNOTATION 0x2000 /* annotation type */ -#define JVM_ACC_ENUM 0x4000 /* field is declared as element of enum */ - -#define JVM_ACC_PUBLIC_BIT 0 -#define JVM_ACC_PRIVATE_BIT 1 -#define JVM_ACC_PROTECTED_BIT 2 -#define JVM_ACC_STATIC_BIT 3 -#define JVM_ACC_FINAL_BIT 4 -#define JVM_ACC_SYNCHRONIZED_BIT 5 -#define JVM_ACC_SUPER_BIT 5 -#define JVM_ACC_VOLATILE_BIT 6 -#define JVM_ACC_BRIDGE_BIT 6 -#define JVM_ACC_TRANSIENT_BIT 7 -#define JVM_ACC_VARARGS_BIT 7 -#define JVM_ACC_NATIVE_BIT 8 -#define JVM_ACC_INTERFACE_BIT 9 -#define JVM_ACC_ABSTRACT_BIT 10 -#define JVM_ACC_STRICT_BIT 11 -#define JVM_ACC_SYNTHETIC_BIT 12 -#define JVM_ACC_ANNOTATION_BIT 13 -#define JVM_ACC_ENUM_BIT 14 - -enum { - JVM_CONSTANT_Utf8 = 1, - JVM_CONSTANT_Unicode, /* unused */ - JVM_CONSTANT_Integer, - JVM_CONSTANT_Float, - JVM_CONSTANT_Long, - JVM_CONSTANT_Double, - JVM_CONSTANT_Class, - JVM_CONSTANT_String, - JVM_CONSTANT_Fieldref, - JVM_CONSTANT_Methodref, - JVM_CONSTANT_InterfaceMethodref, - JVM_CONSTANT_NameAndType -}; - -/* Used in the newarray instruction. */ - -#define JVM_T_BOOLEAN 4 -#define JVM_T_CHAR 5 -#define JVM_T_FLOAT 6 -#define JVM_T_DOUBLE 7 -#define JVM_T_BYTE 8 -#define JVM_T_SHORT 9 -#define JVM_T_INT 10 -#define JVM_T_LONG 11 - -/* JVM method signatures */ - -#define JVM_SIGNATURE_ARRAY '[' -#define JVM_SIGNATURE_BYTE 'B' -#define JVM_SIGNATURE_CHAR 'C' -#define JVM_SIGNATURE_CLASS 'L' -#define JVM_SIGNATURE_ENDCLASS ';' -#define JVM_SIGNATURE_ENUM 'E' -#define JVM_SIGNATURE_FLOAT 'F' -#define JVM_SIGNATURE_DOUBLE 'D' -#define JVM_SIGNATURE_FUNC '(' -#define JVM_SIGNATURE_ENDFUNC ')' -#define JVM_SIGNATURE_INT 'I' -#define JVM_SIGNATURE_LONG 'J' -#define JVM_SIGNATURE_SHORT 'S' -#define JVM_SIGNATURE_VOID 'V' -#define JVM_SIGNATURE_BOOLEAN 'Z' - -/* - * A function defined by the byte-code verifier and called by the VM. - * This is not a function implemented in the VM. - * - * Returns JNI_FALSE if verification fails. A detailed error message - * will be places in msg_buf, whose length is specified by buf_len. - */ -typedef jboolean (*verifier_fn_t)(JNIEnv *env, - jclass cb, - char * msg_buf, - jint buf_len); - - -/* - * Support for a VM-independent class format checker. - */ -typedef struct { - unsigned long code; /* byte code */ - unsigned long excs; /* exceptions */ - unsigned long etab; /* catch table */ - unsigned long lnum; /* line number */ - unsigned long lvar; /* local vars */ -} method_size_info; - -typedef struct { - unsigned int constants; /* constant pool */ - unsigned int fields; - unsigned int methods; - unsigned int interfaces; - unsigned int fields2; /* number of static 2-word fields */ - unsigned int innerclasses; /* # of records in InnerClasses attr */ - - method_size_info clinit; /* memory used in clinit */ - method_size_info main; /* used everywhere else */ -} class_size_info; - -/* - * Functions defined in libjava.so to perform string conversions. - * - */ - -typedef jstring (*to_java_string_fn_t)(JNIEnv *env, char *str); - -typedef char *(*to_c_string_fn_t)(JNIEnv *env, jstring s, jboolean *b); - -/* This is the function defined in libjava.so that performs class - * format checks. This functions fills in size information about - * the class file and returns: - * - * 0: good - * -1: out of memory - * -2: bad format - * -3: unsupported version - * -4: bad class name - */ - -typedef jint (*check_format_fn_t)(char *class_name, - unsigned char *data, - unsigned int data_size, - class_size_info *class_size, - char *message_buffer, - jint buffer_length, - jboolean measure_only, - jboolean check_relaxed); - -#define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \ - JVM_ACC_FINAL | \ - JVM_ACC_SUPER | \ - JVM_ACC_INTERFACE | \ - JVM_ACC_ABSTRACT | \ - JVM_ACC_ANNOTATION | \ - JVM_ACC_ENUM | \ - JVM_ACC_SYNTHETIC) - -#define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \ - JVM_ACC_PRIVATE | \ - JVM_ACC_PROTECTED | \ - JVM_ACC_STATIC | \ - JVM_ACC_FINAL | \ - JVM_ACC_VOLATILE | \ - JVM_ACC_TRANSIENT | \ - JVM_ACC_ENUM | \ - JVM_ACC_SYNTHETIC) - -#define JVM_RECOGNIZED_METHOD_MODIFIERS (JVM_ACC_PUBLIC | \ - JVM_ACC_PRIVATE | \ - JVM_ACC_PROTECTED | \ - JVM_ACC_STATIC | \ - JVM_ACC_FINAL | \ - JVM_ACC_SYNCHRONIZED | \ - JVM_ACC_BRIDGE | \ - JVM_ACC_VARARGS | \ - JVM_ACC_NATIVE | \ - JVM_ACC_ABSTRACT | \ - JVM_ACC_STRICT | \ - JVM_ACC_SYNTHETIC) - -/* - * This is the function defined in libjava.so to perform path - * canonicalization. VM call this function before opening jar files - * to load system classes. - * - */ - -typedef int (*canonicalize_fn_t)(JNIEnv *env, char *orig, char *out, int len); - -/************************************************************************* - PART 3: I/O and Network Support - ************************************************************************/ - -/* Note that the JVM IO functions are expected to return JVM_IO_ERR - * when there is any kind of error. The caller can then use the - * platform specific support (e.g., errno) to get the detailed - * error info. The JVM_GetLastErrorString procedure may also be used - * to obtain a descriptive error string. - */ -#define JVM_IO_ERR (-1) - -/* For interruptible IO. Returning JVM_IO_INTR indicates that an IO - * operation has been disrupted by Thread.interrupt. There are a - * number of technical difficulties related to interruptible IO that - * need to be solved. For example, most existing programs do not handle - * InterruptedIOExceptions specially, they simply treat those as any - * IOExceptions, which typically indicate fatal errors. - * - * There are also two modes of operation for interruptible IO. In the - * resumption mode, an interrupted IO operation is guaranteed not to - * have any side-effects, and can be restarted. In the termination mode, - * an interrupted IO operation corrupts the underlying IO stream, so - * that the only reasonable operation on an interrupted stream is to - * close that stream. The resumption mode seems to be impossible to - * implement on Win32 and Solaris. Implementing the termination mode is - * easier, but it's not clear that's the right semantics. - * - * Interruptible IO is not supported on Win32.It can be enabled/disabled - * using a compile-time flag on Solaris. Third-party JVM ports do not - * need to implement interruptible IO. - */ -#define JVM_IO_INTR (-2) - -/* Write a string into the given buffer, in the platform's local encoding, - * that describes the most recent system-level error to occur in this thread. - * Return the length of the string or zero if no error occurred. - */ -JNIEXPORT jint JNICALL -JVM_GetLastErrorString(char *buf, int len); - -/* - * Convert a pathname into native format. This function does syntactic - * cleanup, such as removing redundant separator characters. It modifies - * the given pathname string in place. - */ -JNIEXPORT char * JNICALL -JVM_NativePath(char *); - -/* - * JVM I/O error codes - */ -#define JVM_EEXIST -100 - -/* - * Open a file descriptor. This function returns a negative error code - * on error, and a non-negative integer that is the file descriptor on - * success. - */ -JNIEXPORT jint JNICALL -JVM_Open(const char *fname, jint flags, jint mode); - -/* - * Close a file descriptor. This function returns -1 on error, and 0 - * on success. - * - * fd the file descriptor to close. - */ -JNIEXPORT jint JNICALL -JVM_Close(jint fd); - -/* - * Read data from a file decriptor into a char array. - * - * fd the file descriptor to read from. - * buf the buffer where to put the read data. - * nbytes the number of bytes to read. - * - * This function returns -1 on error, and 0 on success. - */ -JNIEXPORT jint JNICALL -JVM_Read(jint fd, char *buf, jint nbytes); - -/* - * Write data from a char array to a file decriptor. - * - * fd the file descriptor to read from. - * buf the buffer from which to fetch the data. - * nbytes the number of bytes to write. - * - * This function returns -1 on error, and 0 on success. - */ -JNIEXPORT jint JNICALL -JVM_Write(jint fd, char *buf, jint nbytes); - -/* - * Returns the number of bytes available for reading from a given file - * descriptor - */ -JNIEXPORT jint JNICALL -JVM_Available(jint fd, jlong *pbytes); - -/* - * Move the file descriptor pointer from whence by offset. - * - * fd the file descriptor to move. - * offset the number of bytes to move it by. - * whence the start from where to move it. - * - * This function returns the resulting pointer location. - */ -JNIEXPORT jlong JNICALL -JVM_Lseek(jint fd, jlong offset, jint whence); - -/* - * Set the length of the file associated with the given descriptor to the given - * length. If the new length is longer than the current length then the file - * is extended; the contents of the extended portion are not defined. The - * value of the file pointer is undefined after this procedure returns. - */ -JNIEXPORT jint JNICALL -JVM_SetLength(jint fd, jlong length); - -/* - * Synchronize the file descriptor's in memory state with that of the - * physical device. Return of -1 is an error, 0 is OK. - */ -JNIEXPORT jint JNICALL -JVM_Sync(jint fd); - -/* - * Networking library support - */ - -JNIEXPORT jint JNICALL -JVM_InitializeSocketLibrary(void); - -struct sockaddr; - -JNIEXPORT jint JNICALL -JVM_Socket(jint domain, jint type, jint protocol); - -JNIEXPORT jint JNICALL -JVM_SocketClose(jint fd); - -JNIEXPORT jint JNICALL -JVM_SocketShutdown(jint fd, jint howto); - -JNIEXPORT jint JNICALL -JVM_Recv(jint fd, char *buf, jint nBytes, jint flags); - -JNIEXPORT jint JNICALL -JVM_Send(jint fd, char *buf, jint nBytes, jint flags); - -JNIEXPORT jint JNICALL -JVM_Timeout(int fd, long timeout); - -JNIEXPORT jint JNICALL -JVM_Listen(jint fd, jint count); - -JNIEXPORT jint JNICALL -JVM_Connect(jint fd, struct sockaddr *him, jint len); - -JNIEXPORT jint JNICALL -JVM_Bind(jint fd, struct sockaddr *him, jint len); - -JNIEXPORT jint JNICALL -JVM_Accept(jint fd, struct sockaddr *him, jint *len); - -JNIEXPORT jint JNICALL -JVM_RecvFrom(jint fd, char *buf, int nBytes, - int flags, struct sockaddr *from, int *fromlen); - -JNIEXPORT jint JNICALL -JVM_SendTo(jint fd, char *buf, int len, - int flags, struct sockaddr *to, int tolen); - -JNIEXPORT jint JNICALL -JVM_SocketAvailable(jint fd, jint *result); - - -JNIEXPORT jint JNICALL -JVM_GetSockName(jint fd, struct sockaddr *him, int *len); - -JNIEXPORT jint JNICALL -JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen); - -JNIEXPORT jint JNICALL -JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen); - -/* - * These routines are only reentrant on Windows - */ - -#ifdef WIN32 - -JNIEXPORT struct protoent * JNICALL -JVM_GetProtoByName(char* name); - -JNIEXPORT struct hostent* JNICALL -JVM_GetHostByAddr(const char* name, int len, int type); - -JNIEXPORT struct hostent* JNICALL -JVM_GetHostByName(char* name); - -#endif /* _WINDOWS */ - -JNIEXPORT int JNICALL -JVM_GetHostName(char* name, int namelen); - -/* - * The standard printing functions supported by the Java VM. (Should they - * be renamed to JVM_* in the future? - */ - -/* - * BE CAREFUL! The following functions do not implement the - * full feature set of standard C printf formats. - */ -int -jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args); - -int -jio_snprintf(char *str, size_t count, const char *fmt, ...); - -int -jio_fprintf(FILE *, const char *fmt, ...); - -int -jio_vfprintf(FILE *, const char *fmt, va_list args); - - -JNIEXPORT void * JNICALL -JVM_RawMonitorCreate(void); - -JNIEXPORT void JNICALL -JVM_RawMonitorDestroy(void *mon); - -JNIEXPORT jint JNICALL -JVM_RawMonitorEnter(void *mon); - -JNIEXPORT void JNICALL -JVM_RawMonitorExit(void *mon); - -/* - * java.lang.management support - */ -JNIEXPORT void* JNICALL -JVM_GetManagement(jint version); - -/* - * com.sun.tools.attach.VirtualMachine support - * - * Initialize the agent properties with the properties maintained in the VM. - */ -JNIEXPORT jobject JNICALL -JVM_InitAgentProperties(JNIEnv *env, jobject agent_props); - -/* Generics reflection support. - * - * Returns information about the given class's EnclosingMethod - * attribute, if present, or null if the class had no enclosing - * method. - * - * If non-null, the returned array contains three elements. Element 0 - * is the java.lang.Class of which the enclosing method is a member, - * and elements 1 and 2 are the java.lang.Strings for the enclosing - * method's name and descriptor, respectively. - */ -JNIEXPORT jobjectArray JNICALL -JVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass); - -/* - * Java thread state support - */ -enum { - JAVA_THREAD_STATE_NEW = 0, - JAVA_THREAD_STATE_RUNNABLE = 1, - JAVA_THREAD_STATE_BLOCKED = 2, - JAVA_THREAD_STATE_WAITING = 3, - JAVA_THREAD_STATE_TIMED_WAITING = 4, - JAVA_THREAD_STATE_TERMINATED = 5, - JAVA_THREAD_STATE_COUNT = 6 -}; - -/* - * Returns an array of the threadStatus values representing the - * given Java thread state. Returns NULL if the VM version is - * incompatible with the JDK or doesn't support the given - * Java thread state. - */ -JNIEXPORT jintArray JNICALL -JVM_GetThreadStateValues(JNIEnv* env, jint javaThreadState); - -/* - * Returns an array of the substate names representing the - * given Java thread state. Returns NULL if the VM version is - * incompatible with the JDK or the VM doesn't support - * the given Java thread state. - * values must be the jintArray returned from JVM_GetThreadStateValues - * and javaThreadState. - */ -JNIEXPORT jobjectArray JNICALL -JVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArray values); - -/* ========================================================================= - * The following defines a private JVM interface that the JDK can query - * for the JVM version and capabilities. sun.misc.Version defines - * the methods for getting the VM version and its capabilities. - * - * When a new bit is added, the following should be updated to provide - * access to the new capability: - * HS: JVM_GetVersionInfo and Abstract_VM_Version class - * SDK: Version class - * - * Similary, a private JDK interface JDK_GetVersionInfo0 is defined for - * JVM to query for the JDK version and capabilities. - * - * When a new bit is added, the following should be updated to provide - * access to the new capability: - * HS: JDK_Version class - * SDK: JDK_GetVersionInfo0 - * - * ========================================================================== - */ -typedef struct { - /* Naming convention of RE build version string: n.n.n[_uu[c]][-]-bxx */ - unsigned int jvm_version; /* Consists of major, minor, micro (n.n.n) */ - /* and build number (xx) */ - unsigned int update_version : 8; /* Update release version (uu) */ - unsigned int special_update_version : 8; /* Special update release version (c)*/ - unsigned int reserved1 : 16; - unsigned int reserved2; - - /* The following bits represents JVM supports that JDK has dependency on. - * JDK can use these bits to determine which JVM version - * and support it has to maintain runtime compatibility. - * - * When a new bit is added in a minor or update release, make sure - * the new bit is also added in the main/baseline. - */ - unsigned int is_attach_supported : 1; - unsigned int is_kernel_jvm : 1; - unsigned int : 30; - unsigned int : 32; - unsigned int : 32; -} jvm_version_info; - -#define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) -#define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) -#define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8) - -/* Build number is available only for RE builds. - * It will be zero for internal builds. - */ -#define JVM_VERSION_BUILD(version) ((version & 0x000000FF)) - -JNIEXPORT void JNICALL -JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size); - -typedef struct { - // Naming convention of RE build version string: n.n.n[_uu[c]][-]-bxx - unsigned int jdk_version; /* Consists of major, minor, micro (n.n.n) */ - /* and build number (xx) */ - unsigned int update_version : 8; /* Update release version (uu) */ - unsigned int special_update_version : 8; /* Special update release version (c)*/ - unsigned int reserved1 : 16; - unsigned int reserved2; - - /* The following bits represents new JDK supports that VM has dependency on. - * VM implementation can use these bits to determine which JDK version - * and support it has to maintain runtime compatibility. - * - * When a new bit is added in a minor or update release, make sure - * the new bit is also added in the main/baseline. - */ - unsigned int thread_park_blocker : 1; - unsigned int : 31; - unsigned int : 32; - unsigned int : 32; -} jdk_version_info; - -#define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) -#define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) -#define JDK_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8) - -/* Build number is available only for RE build (i.e. JDK_BUILD_NUMBER is set to bNN) - * It will be zero for internal builds. - */ -#define JDK_VERSION_BUILD(version) ((version & 0x000000FF)) - -/* - * This is the function JDK_GetVersionInfo0 defined in libjava.so - * that is dynamically looked up by JVM. - */ -typedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t info_size); - -/* - * This structure is used by the launcher to get the default thread - * stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a - * version of 1.1. As it is not supported otherwise, it has been removed - * from jni.h - */ -typedef struct JDK1_1InitArgs { - jint version; - - char **properties; - jint checkSource; - jint nativeStackSize; - jint javaStackSize; - jint minHeapSize; - jint maxHeapSize; - jint verifyMode; - char *classpath; - - jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args); - void (JNICALL *exit)(jint code); - void (JNICALL *abort)(void); - - jint enableClassGC; - jint enableVerboseGC; - jint disableAsyncGC; - jint verbose; - jboolean debugging; - jint debugPort; -} JDK1_1InitArgs; - - -#ifdef __cplusplus -} /* extern "C" */ - -#endif /* __cplusplus */ - -#endif /* !_JAVASOFT_JVM_H_ */ diff -Nru icedtea-web-1.3.2/launcher/jvm_md.h icedtea-web-1.4/launcher/jvm_md.h --- icedtea-web-1.3.2/launcher/jvm_md.h 2013-04-10 11:40:23.839668000 +0000 +++ icedtea-web-1.4/launcher/jvm_md.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#ifndef _JAVASOFT_JVM_MD_H_ -#define _JAVASOFT_JVM_MD_H_ - -/* - * This file is currently collecting system-specific dregs for the - * JNI conversion, which should be sorted out later. - */ - -#include /* For DIR */ -#include /* For MAXPATHLEN */ -#include /* For F_OK, R_OK, W_OK */ - -#define JNI_ONLOAD_SYMBOLS {"JNI_OnLoad"} -#define JNI_ONUNLOAD_SYMBOLS {"JNI_OnUnload"} - -#define JNI_LIB_PREFIX "lib" -#define JNI_LIB_SUFFIX ".so" - -#define JVM_MAXPATHLEN MAXPATHLEN - -#define JVM_R_OK R_OK -#define JVM_W_OK W_OK -#define JVM_X_OK X_OK -#define JVM_F_OK F_OK - -/* - * File I/O - */ - -#include -#include -#include -#include -#include - -/* O Flags */ - -#define JVM_O_RDONLY O_RDONLY -#define JVM_O_WRONLY O_WRONLY -#define JVM_O_RDWR O_RDWR -#define JVM_O_O_APPEND O_APPEND -#define JVM_O_EXCL O_EXCL -#define JVM_O_CREAT O_CREAT -#define JVM_O_DELETE 0x10000 - -/* Signals */ - -#define JVM_SIGINT SIGINT -#define JVM_SIGTERM SIGTERM - - -#endif /* !_JAVASOFT_JVM_MD_H_ */ diff -Nru icedtea-web-1.3.2/launcher/manifest_info.h icedtea-web-1.4/launcher/manifest_info.h --- icedtea-web-1.3.2/launcher/manifest_info.h 2013-04-10 11:40:23.839668000 +0000 +++ icedtea-web-1.4/launcher/manifest_info.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#ifndef _MANIFEST_INFO_H -#define _MANIFEST_INFO_H - -#include - -/* - * Zip file header signatures - */ -#define SIGSIZ 4 /* size of all header signatures */ -#define LOCSIG 0x04034b50L /* "PK\003\004" */ -#define EXTSIG 0x08074b50L /* "PK\007\008" */ -#define CENSIG 0x02014b50L /* "PK\001\002" */ -#define ENDSIG 0x06054b50L /* "PK\005\006" */ - -/* - * Header sizes including signatures - */ -#define LOCHDR 30 -#define EXTHDR 16 -#define CENHDR 46 -#define ENDHDR 22 - -/* - * Header field access macros - */ -#define CH(b, n) (((unsigned char *)(b))[n]) -#define SH(b, n) (CH(b, n) | (CH(b, n+1) << 8)) -#define LG(b, n) (SH(b, n) | (SH(b, n+2) << 16)) -#define GETSIG(b) LG(b, 0) - -/* - * Macros for getting local file (LOC) header fields - */ -#define LOCVER(b) SH(b, 4) /* version needed to extract */ -#define LOCFLG(b) SH(b, 6) /* general purpose bit flags */ -#define LOCHOW(b) SH(b, 8) /* compression method */ -#define LOCTIM(b) LG(b, 10) /* modification time */ -#define LOCCRC(b) LG(b, 14) /* crc of uncompressed data */ -#define LOCSIZ(b) LG(b, 18) /* compressed data size */ -#define LOCLEN(b) LG(b, 22) /* uncompressed data size */ -#define LOCNAM(b) SH(b, 26) /* filename length */ -#define LOCEXT(b) SH(b, 28) /* extra field length */ - -/* - * Macros for getting extra local (EXT) header fields - */ -#define EXTCRC(b) LG(b, 4) /* crc of uncompressed data */ -#define EXTSIZ(b) LG(b, 8) /* compressed size */ -#define EXTLEN(b) LG(b, 12) /* uncompressed size */ - -/* - * Macros for getting central directory header (CEN) fields - */ -#define CENVEM(b) SH(b, 4) /* version made by */ -#define CENVER(b) SH(b, 6) /* version needed to extract */ -#define CENFLG(b) SH(b, 8) /* general purpose bit flags */ -#define CENHOW(b) SH(b, 10) /* compression method */ -#define CENTIM(b) LG(b, 12) /* modification time */ -#define CENCRC(b) LG(b, 16) /* crc of uncompressed data */ -#define CENSIZ(b) LG(b, 20) /* compressed size */ -#define CENLEN(b) LG(b, 24) /* uncompressed size */ -#define CENNAM(b) SH(b, 28) /* length of filename */ -#define CENEXT(b) SH(b, 30) /* length of extra field */ -#define CENCOM(b) SH(b, 32) /* file comment length */ -#define CENDSK(b) SH(b, 34) /* disk number start */ -#define CENATT(b) SH(b, 36) /* internal file attributes */ -#define CENATX(b) LG(b, 38) /* external file attributes */ -#define CENOFF(b) LG(b, 42) /* offset of local header */ - -/* - * Macros for getting end of central directory header (END) fields - */ -#define ENDSUB(b) SH(b, 8) /* number of entries on this disk */ -#define ENDTOT(b) SH(b, 10) /* total number of entries */ -#define ENDSIZ(b) LG(b, 12) /* central directory size */ -#define ENDOFF(b) LG(b, 16) /* central directory offset */ -#define ENDCOM(b) SH(b, 20) /* size of zip file comment */ - -/* - * A comment of maximum length of 64kb can follow the END record. This - * is the furthest the END record can be from the end of the file. - */ -#define END_MAXLEN (0xFFFF + ENDHDR) - -/* - * Supported compression methods. - */ -#define STORED 0 -#define DEFLATED 8 - -/* - * Information from the CEN entry to inflate a file. - */ -typedef struct zentry { /* Zip file entry */ - size_t isize; /* size of inflated data */ - size_t csize; /* size of compressed data (zero if uncompressed) */ - off_t offset; /* position of compressed data */ - int how; /* compression method (if any) */ -} zentry; - -/* - * Information returned from the Manifest file by the ParseManifest() routine. - * Certainly (much) more could be returned, but this is the information - * currently of interest to the C based Java utilities (particularly the - * Java launcher). - */ -typedef struct manifest_info { /* Interesting fields from the Manifest */ - char *manifest_version; /* Manifest-Version string */ - char *main_class; /* Main-Class entry */ - char *jre_version; /* Appropriate J2SE release spec */ - char jre_restrict_search; /* Restricted JRE search */ - char *splashscreen_image_file_name; /* splashscreen image file */ -} manifest_info; - -/* - * Attribute closure to provide to manifest_iterate. - */ -typedef void (*attribute_closure)(const char *name, const char *value, - void *user_data); - -/* - * Function prototypes. - */ -int JLI_ParseManifest(char *jarfile, manifest_info *info); -void *JLI_JarUnpackFile(const char *jarfile, const char *filename, - int *size); -void JLI_FreeManifest(void); -int JLI_ManifestIterate(const char *jarfile, attribute_closure ac, - void *user_data); - -#endif /* _MANIFEST_INFO_H */ diff -Nru icedtea-web-1.3.2/launcher/parse_manifest.c icedtea-web-1.4/launcher/parse_manifest.c --- icedtea-web-1.3.2/launcher/parse_manifest.c 2013-04-10 11:40:23.840668000 +0000 +++ icedtea-web-1.4/launcher/parse_manifest.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,610 +0,0 @@ -/* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#include -#include -#include -#include -#include -#include - -/* - * If Windows is POSIX compliant, why isn't the prototype for lseek where - * POSIX says it should be? - */ -#ifdef _WIN32 -#include -#include -#else /* Unix */ -#include -#endif /* Unix */ - -#include -#include "manifest_info.h" - -/* - * On Windows, str[n]casecmp() are known as str[n]icmp(). - */ -#ifdef _WIN32 -#define strcasecmp(p1, p2) stricmp((p1), (p2)) -#define strncasecmp(p1, p2, p3) strnicmp((p1), (p2), (p3)) -#endif - -static char *manifest; - -static const char *manifest_name = "META-INF/MANIFEST.MF"; - -/* - * Inflate the manifest file (or any file for that matter). - * - * fd: File descriptor of the jar file. - * entry: Contains the information necessary to perform the inflation - * (the compressed and uncompressed sizes and the offset in - * the file where the compressed data is located). - * size_out: Returns the size of the inflated file. - * - * Upon success, it returns a pointer to a NUL-terminated malloc'd buffer - * containing the inflated manifest file. When the caller is done with it, - * this buffer should be released by a call to free(). Upon failure, - * returns NULL. - */ -static char * -inflate_file(int fd, zentry *entry, int *size_out) -{ - char *in; - char *out; - z_stream zs; - - if (entry->csize == 0xffffffff || entry->isize == 0xffffffff) - return (NULL); - if (lseek(fd, entry->offset, SEEK_SET) < (off_t)0) - return (NULL); - if ((in = malloc(entry->csize + 1)) == NULL) - return (NULL); - if ((size_t)(read(fd, in, (unsigned int)entry->csize)) != entry->csize) { - free(in); - return (NULL); - } - if (entry->how == STORED) { - *(char *)((size_t)in + entry->csize) = '\0'; - if (size_out) { - *size_out = entry->csize; - } - return (in); - } else if (entry->how == DEFLATED) { - zs.zalloc = (alloc_func)Z_NULL; - zs.zfree = (free_func)Z_NULL; - zs.opaque = (voidpf)Z_NULL; - zs.next_in = (Byte*)in; - zs.avail_in = (uInt)entry->csize; - if (inflateInit2(&zs, -MAX_WBITS) < 0) { - free(in); - return (NULL); - } - if ((out = malloc(entry->isize + 1)) == NULL) { - free(in); - return (NULL); - } - zs.next_out = (Byte*)out; - zs.avail_out = (uInt)entry->isize; - if (inflate(&zs, Z_PARTIAL_FLUSH) < 0) { - free(in); - free(out); - return (NULL); - } - *(char *)((size_t)out + entry->isize) = '\0'; - free(in); - if (inflateEnd(&zs) < 0) { - free(out); - return (NULL); - } - if (size_out) { - *size_out = entry->isize; - } - return (out); - } else - return (NULL); -} - -/* - * A very little used routine to handle the case that zip file has - * a comment at the end. Believe it or not, the only way to find the - * END record is to walk backwards, byte by bloody byte looking for - * the END record signature. - * - * fd: File descriptor of the jar file. - * eb: Pointer to a buffer to receive a copy of the END header. - * - * Returns the offset of the END record in the file on success, - * -1 on failure. - */ -static off_t -find_end(int fd, Byte *eb) -{ - off_t len; - off_t pos; - off_t flen; - int bytes; - Byte *cp; - Byte *endpos; - Byte *buffer; - - /* - * 99.44% (or more) of the time, there will be no comment at the - * end of the zip file. Try reading just enough to read the END - * record from the end of the file. - */ - if ((pos = lseek(fd, -ENDHDR, SEEK_END)) < (off_t)0) - return (-1); - if ((bytes = read(fd, eb, ENDHDR)) < 0) - return (-1); - if (GETSIG(eb) == ENDSIG) - return (pos); - - /* - * Shucky-Darn,... There is a comment at the end of the zip file. - * - * Allocate and fill a buffer with enough of the zip file - * to meet the specification for a maximal comment length. - */ - if ((flen = lseek(fd, 0, SEEK_END)) < (off_t)0) - return (-1); - len = (flen < END_MAXLEN) ? flen : END_MAXLEN; - if (lseek(fd, -len, SEEK_END) < (off_t)0) - return (-1); - if ((buffer = malloc(END_MAXLEN)) == NULL) - return (-1); - if ((bytes = read(fd, buffer, len)) < 0) { - free(buffer); - return (-1); - } - - /* - * Search backwards from the end of file stopping when the END header - * signature is found. (The first condition of the "if" is just a - * fast fail, because the GETSIG macro isn't always cheap. The - * final condition protects against false positives.) - */ - endpos = &buffer[bytes]; - for (cp = &buffer[bytes - ENDHDR]; cp >= &buffer[0]; cp--) - if ((*cp == (ENDSIG & 0xFF)) && (GETSIG(cp) == ENDSIG) && - (cp + ENDHDR + ENDCOM(cp) == endpos)) { - (void) memcpy(eb, cp, ENDHDR); - free(buffer); - return (flen - (endpos - cp)); - } - free(buffer); - return (-1); -} - -/* - * Locate the manifest file with the zip/jar file. - * - * fd: File descriptor of the jar file. - * entry: To be populated with the information necessary to perform - * the inflation (the compressed and uncompressed sizes and - * the offset in the file where the compressed data is located). - * - * Returns zero upon success. Returns a negative value upon failure. - * - * The buffer for reading the Central Directory if the zip/jar file needs - * to be large enough to accommodate the largest possible single record - * and the signature of the next record which is: - * - * 3*2**16 + CENHDR + SIGSIZ - * - * Each of the three variable sized fields (name, comment and extension) - * has a maximum possible size of 64k. - * - * Typically, only a small bit of this buffer is used with bytes shuffled - * down to the beginning of the buffer. It is one thing to allocate such - * a large buffer and another thing to actually start faulting it in. - * - * In most cases, all that needs to be read are the first two entries in - * a typical jar file (META-INF and META-INF/MANIFEST.MF). Keep this factoid - * in mind when optimizing this code. - */ -#define BUFSIZE (3 * 65536 + CENHDR + SIGSIZ) -#define MINREAD 1024 - -static int -find_file(int fd, zentry *entry, const char *file_name) -{ - int bytes; - int res; - int entry_size; - int read_size; - int base_offset; - Byte *p; - Byte *bp; - Byte buffer[BUFSIZE]; - Byte locbuf[LOCHDR]; - - p = buffer; - bp = buffer; - - /* - * Read the END Header, which is the starting point for ZIP files. - * (Clearly designed to make writing a zip file easier than reading - * one. Now isn't that precious...) - */ - if ((base_offset = find_end(fd, bp)) == -1) - return (-1); - - /* - * There is a historical, but undocumented, ability to allow for - * additional "stuff" to be prepended to the zip/jar file. It seems - * that this has been used to prepend an actual java launcher - * executable to the jar on Windows. Although this is just another - * form of statically linking a small piece of the JVM to the - * application, we choose to continue to support it. Note that no - * guarantees have been made (or should be made) to the customer that - * this will continue to work. - * - * Therefore, calculate the base offset of the zip file (within the - * expanded file) by assuming that the central directory is followed - * immediately by the end record. - */ - base_offset = base_offset - ENDSIZ(p) - ENDOFF(p); - - /* - * The END Header indicates the start of the Central Directory - * Headers. Remember that the desired Central Directory Header (CEN) - * will almost always be the second one and the first one is a small - * directory entry ("META-INF/"). Keep the code optimized for - * that case. - * - * Begin by seeking to the beginning of the Central Directory and - * reading in the first buffer full of bits. - */ - if (lseek(fd, base_offset + ENDOFF(p), SEEK_SET) < (off_t)0) - return (-1); - if ((bytes = read(fd, bp, MINREAD)) < 0) - return (-1); - - /* - * Loop through the Central Directory Headers. Note that a valid zip/jar - * must have an ENDHDR (with ENDSIG) after the Central Directory. - */ - while (GETSIG(p) == CENSIG) { - - /* - * If a complete header isn't in the buffer, shift the contents - * of the buffer down and refill the buffer. Note that the check - * for "bytes < CENHDR" must be made before the test for the entire - * size of the header, because if bytes is less than CENHDR, the - * actual size of the header can't be determined. The addition of - * SIGSIZ guarantees that the next signature is also in the buffer - * for proper loop termination. - */ - if (bytes < CENHDR) { - p = memmove(bp, p, bytes); - if ((res = read(fd, bp + bytes, MINREAD)) <= 0) - return (-1); - bytes += res; - } - entry_size = CENHDR + CENNAM(p) + CENEXT(p) + CENCOM(p); - if (bytes < entry_size + SIGSIZ) { - if (p != bp) - p = memmove(bp, p, bytes); - read_size = entry_size - bytes + SIGSIZ; - read_size = (read_size < MINREAD) ? MINREAD : read_size; - if ((res = read(fd, bp + bytes, read_size)) <= 0) - return (-1); - bytes += res; - } - - /* - * Check if the name is the droid we are looking for; the jar file - * manifest. If so, build the entry record from the data found in - * the header located and return success. - */ - if (CENNAM(p) == strlen(file_name) && - memcmp((p + CENHDR), file_name, strlen(file_name)) == 0) { - if (lseek(fd, base_offset + CENOFF(p), SEEK_SET) < (off_t)0) - return (-1); - if (read(fd, locbuf, LOCHDR) < 0) - return (-1); - if (GETSIG(locbuf) != LOCSIG) - return (-1); - entry->isize = CENLEN(p); - entry->csize = CENSIZ(p); - entry->offset = base_offset + CENOFF(p) + LOCHDR + - LOCNAM(locbuf) + LOCEXT(locbuf); - entry->how = CENHOW(p); - return (0); - } - - /* - * Point to the next entry and decrement the count of valid remaining - * bytes. - */ - bytes -= entry_size; - p += entry_size; - } - - return (-1); /* Fell off the end the loop without a Manifest */ -} - -/* - * Parse a Manifest file header entry into a distinct "name" and "value". - * Continuation lines are joined into a single "value". The documented - * syntax for a header entry is: - * - * header: name ":" value - * - * name: alphanum *headerchar - * - * value: SPACE *otherchar newline *continuation - * - * continuation: SPACE *otherchar newline - * - * newline: CR LF | LF | CR (not followed by LF) - * - * alphanum: {"A"-"Z"} | {"a"-"z"} | {"0"-"9"} - * - * headerchar: alphanum | "-" | "_" - * - * otherchar: any UTF-8 character except NUL, CR and LF - * - * Note that a manifest file may be composed of multiple sections, - * each of which may contain multiple headers. - * - * section: *header +newline - * - * nonempty-section: +header +newline - * - * (Note that the point of "nonempty-section" is unclear, because it isn't - * referenced elsewhere in the full specification for the Manifest file.) - * - * Arguments: - * lp pointer to a character pointer which points to the start - * of a valid header. - * name pointer to a character pointer which will be set to point - * to the name portion of the header (nul terminated). - * value pointer to a character pointer which will be set to point - * to the value portion of the header (nul terminated). - * - * Returns: - * 1 Successful parsing of an NV pair. lp is updated to point to the - * next character after the terminating newline in the string - * representing the Manifest file. name and value are updated to - * point to the strings parsed. - * 0 A valid end of section indicator was encountered. lp, name, and - * value are not modified. - * -1 lp does not point to a valid header. Upon return, the values of - * lp, name, and value are undefined. - */ -static int -parse_nv_pair(char **lp, char **name, char **value) -{ - char *nl; - char *cp; - - /* - * End of the section - return 0. The end of section condition is - * indicated by either encountering a blank line or the end of the - * Manifest "string" (EOF). - */ - if (**lp == '\0' || **lp == '\n' || **lp == '\r') - return (0); - - /* - * Getting to here, indicates that *lp points to an "otherchar". - * Turn the "header" into a string on its own. - */ - nl = strpbrk(*lp, "\n\r"); - if (nl == NULL) { - nl = strchr(*lp, (int)'\0'); - } else { - cp = nl; /* For merging continuation lines */ - if (*nl == '\r' && *(nl+1) == '\n') - *nl++ = '\0'; - *nl++ = '\0'; - - /* - * Process any "continuation" line(s), by making them part of the - * "header" line. Yes, I know that we are "undoing" the NULs we - * just placed here, but continuation lines are the fairly rare - * case, so we shouldn't unnecessarily complicate the code above. - * - * Note that an entire continuation line is processed each iteration - * through the outer while loop. - */ - while (*nl == ' ') { - nl++; /* First character to be moved */ - while (*nl != '\n' && *nl != '\r' && *nl != '\0') - *cp++ = *nl++; /* Shift string */ - if (*nl == '\0') - return (-1); /* Error: newline required */ - *cp = '\0'; - if (*nl == '\r' && *(nl+1) == '\n') - *nl++ = '\0'; - *nl++ = '\0'; - } - } - - /* - * Separate the name from the value; - */ - cp = strchr(*lp, (int)':'); - if (cp == NULL) - return (-1); - *cp++ = '\0'; /* The colon terminates the name */ - if (*cp != ' ') - return (-1); - *cp++ = '\0'; /* Eat the required space */ - *name = *lp; - *value = cp; - *lp = nl; - return (1); -} - -/* - * Read the manifest from the specified jar file and fill in the manifest_info - * structure with the information found within. - * - * Error returns are as follows: - * 0 Success - * -1 Unable to open jarfile - * -2 Error accessing the manifest from within the jarfile (most likely - * a manifest is not present, or this isn't a valid zip/jar file). - */ -int -JLI_ParseManifest(char *jarfile, manifest_info *info) -{ - int fd; - zentry entry; - char *lp; - char *name; - char *value; - int rc; - char *splashscreen_name = NULL; - - if ((fd = open(jarfile, O_RDONLY -#ifdef O_BINARY - | O_BINARY /* use binary mode on windows */ -#endif - )) == -1) - return (-1); - - info->manifest_version = NULL; - info->main_class = NULL; - info->jre_version = NULL; - info->jre_restrict_search = 0; - info->splashscreen_image_file_name = NULL; - if (rc = find_file(fd, &entry, manifest_name) != 0) { - close(fd); - return (-2); - } - manifest = inflate_file(fd, &entry, NULL); - if (manifest == NULL) { - close(fd); - return (-2); - } - lp = manifest; - while ((rc = parse_nv_pair(&lp, &name, &value)) > 0) { - if (strcasecmp(name, "Manifest-Version") == 0) - info->manifest_version = value; - else if (strcasecmp(name, "Main-Class") == 0) - info->main_class = value; - else if (strcasecmp(name, "JRE-Version") == 0) - info->jre_version = value; - else if (strcasecmp(name, "JRE-Restrict-Search") == 0) { - if (strcasecmp(value, "true") == 0) - info->jre_restrict_search = 1; - } else if (strcasecmp(name, "Splashscreen-Image") == 0) { - info->splashscreen_image_file_name = value; - } - } - close(fd); - if (rc == 0) - return (0); - else - return (-2); -} - -/* - * Opens the jar file and unpacks the specified file from its contents. - * Returns NULL on failure. - */ -void * -JLI_JarUnpackFile(const char *jarfile, const char *filename, int *size) { - int fd; - zentry entry; - void *data = NULL; - - fd = open(jarfile, O_RDONLY -#ifdef O_BINARY - | O_BINARY /* use binary mode on windows */ -#endif - ); - if (fd != -1 && find_file(fd, &entry, filename) == 0) { - data = inflate_file(fd, &entry, size); - } - close(fd); - return (data); -} - -/* - * Specialized "free" function. - */ -void -JLI_FreeManifest() -{ - if (manifest) - free(manifest); -} - -/* - * Iterate over the manifest of the specified jar file and invoke the provided - * closure function for each attribute encountered. - * - * Error returns are as follows: - * 0 Success - * -1 Unable to open jarfile - * -2 Error accessing the manifest from within the jarfile (most likely - * this means a manifest is not present, or it isn't a valid zip/jar file). - */ -int -JLI_ManifestIterate(const char *jarfile, attribute_closure ac, void *user_data) -{ - int fd; - zentry entry; - char *mp; /* manifest pointer */ - char *lp; /* pointer into manifest, updated during iteration */ - char *name; - char *value; - int rc; - - if ((fd = open(jarfile, O_RDONLY -#ifdef O_BINARY - | O_BINARY /* use binary mode on windows */ -#endif - )) == -1) - return (-1); - - if (rc = find_file(fd, &entry, manifest_name) != 0) { - close(fd); - return (-2); - } - - mp = inflate_file(fd, &entry, NULL); - if (mp == NULL) { - close(fd); - return (-2); - } - - lp = mp; - while ((rc = parse_nv_pair(&lp, &name, &value)) > 0) { - (*ac)(name, value, user_data); - } - free(mp); - close(fd); - if (rc == 0) - return (0); - else - return (-2); -} diff -Nru icedtea-web-1.3.2/launcher/splashscreen.h icedtea-web-1.4/launcher/splashscreen.h --- icedtea-web-1.3.2/launcher/splashscreen.h 2013-04-10 11:40:23.840668000 +0000 +++ icedtea-web-1.4/launcher/splashscreen.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - - -int DoSplashLoadMemory(void* pdata, int size); /* requires preloading the file */ -int DoSplashLoadFile(const char* filename); -void DoSplashInit(void); -void DoSplashClose(void); -void DoSplashSetFileJarName(const char* fileName, const char* jarName); diff -Nru icedtea-web-1.3.2/launcher/splashscreen_stubs.c icedtea-web-1.4/launcher/splashscreen_stubs.c --- icedtea-web-1.3.2/launcher/splashscreen_stubs.c 2013-04-10 11:40:23.840668000 +0000 +++ icedtea-web-1.4/launcher/splashscreen_stubs.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#include -#include "splashscreen.h" - -extern void* SplashProcAddress(const char* name); /* in java_md.c */ - -/* - * Prototypes of pointers to functions in splashscreen shared lib - */ -typedef int (*SplashLoadMemory_t)(void* pdata, int size); -typedef int (*SplashLoadFile_t)(const char* filename); -typedef void (*SplashInit_t)(void); -typedef void (*SplashClose_t)(void); -typedef void (*SplashSetFileJarName_t)(const char* fileName, - const char* jarName); - -/* - * This macro invokes a function from the shared lib. - * it locates a function with SplashProcAddress on demand. - * if SplashProcAddress fails, def value is returned. - * - * it is further wrapped with INVOKEV (works with functions which return - * void and INVOKE (for all other functions). INVOKEV looks a bit ugly, - * that's due being unable to return a value of type void in C. INVOKEV - * works around this by using semicolon instead of return operator. - */ -#define _INVOKE(name,def,ret) \ - static void* proc = NULL; \ - if (!proc) { proc = SplashProcAddress(#name); } \ - if (!proc) { return def; } \ - ret ((name##_t)proc) - -#define INVOKE(name,def) _INVOKE(name,def,return) -#define INVOKEV(name) _INVOKE(name, ,;) - -int DoSplashLoadMemory(void* pdata, int size) { - INVOKE(SplashLoadMemory,0)(pdata, size); -} - -int DoSplashLoadFile(const char* filename) { - INVOKE(SplashLoadFile,0)(filename); -} - -void DoSplashInit(void) { - INVOKEV(SplashInit)(); -} - -void DoSplashClose(void) { - INVOKEV(SplashClose)(); -} - -void DoSplashSetFileJarName(const char* fileName, const char* jarName) { - INVOKEV(SplashSetFileJarName)(fileName, jarName); -} diff -Nru icedtea-web-1.3.2/launcher/version_comp.c icedtea-web-1.4/launcher/version_comp.c --- icedtea-web-1.3.2/launcher/version_comp.c 2013-04-10 11:40:23.840668000 +0000 +++ icedtea-web-1.4/launcher/version_comp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,357 +0,0 @@ -/* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#include -#include -#include -#include -#include "jni.h" -#include "jli_util.h" -#include "version_comp.h" - -/* - * A collection of useful strings. One should think of these as #define - * entries, but actual strings can be more efficient (with many compilers). - */ -static const char *separators = ".-_"; -static const char *zero_string = "0"; - -/* - * Validate a string as parsable as a "Java int". If so parsable, - * return true (non-zero) and store the numeric value at the address - * passed in as "value"; otherwise return false (zero). - * - * Note that the maximum allowable value is 2147483647 as defined by - * the "Java Language Specification" which precludes the use of native - * conversion routines which may have other limits. - * - * Also note that we don't have to worry about the alternate maximum - * allowable value of 2147483648 because it is only allowed after - * the unary negation operator and this grammar doesn't have one - * of those. - * - * Finally, note that a value which exceeds the maximum jint value will - * return false (zero). This results in the otherwise purely numeric - * string being compared as a string of characters (as per the spec.) - */ -static int -isjavaint(const char *s, jint *value) -{ - jlong sum = 0; - jint digit; - while (*s != '\0') - if (isdigit(*s)) { - digit = (jint)((int)(*s++) - (int)('0')); - sum = (sum * 10) + digit; - if (sum > 2147483647) - return (0); /* Overflows jint (but not jlong) */ - } else - return (0); - *value = (jint)sum; - return (1); -} - -/* - * Modeled after strcmp(), compare two strings (as in the grammar defined - * in Appendix A of JSR 56). If both strings can be interpreted as - * Java ints, do a numeric comparison, else it is strcmp(). - */ -static int -comp_string(const char *s1, const char *s2) -{ - jint v1, v2; - if (isjavaint(s1, &v1) && isjavaint(s2, &v2)) - return ((int)(v1 - v2)); - else - return (strcmp(s1, s2)); -} - -/* - * Modeled after strcmp(), compare two version-ids for a Prefix - * Match as defined in JSR 56. - */ -int -JLI_PrefixVersionId(char *id1, char *id2) -{ - char *s1 = JLI_StringDup(id1); - char *s2 = JLI_StringDup(id2); - char *m1 = s1; - char *m2 = s2; - char *end1 = NULL; - char *end2 = NULL; - int res = 0; - - do { - - if ((s1 != NULL) && ((end1 = strpbrk(s1, ".-_")) != NULL)) - *end1 = '\0'; - if ((s2 != NULL) && ((end2 = strpbrk(s2, ".-_")) != NULL)) - *end2 = '\0'; - - res = comp_string(s1, s2); - - if (end1 != NULL) - s1 = end1 + 1; - else - s1 = NULL; - if (end2 != NULL) - s2 = end2 + 1; - else - s2 = NULL; - - } while (res == 0 && ((s1 != NULL) && (s2 != NULL))); - - JLI_MemFree(m1); - JLI_MemFree(m2); - return (res); -} - -/* - * Modeled after strcmp(), compare two version-ids for an Exact - * Match as defined in JSR 56. - */ -int -JLI_ExactVersionId(char *id1, char *id2) -{ - char *s1 = JLI_StringDup(id1); - char *s2 = JLI_StringDup(id2); - char *m1 = s1; - char *m2 = s2; - char *end1 = NULL; - char *end2 = NULL; - int res = 0; - - do { - - if ((s1 != NULL) && ((end1 = strpbrk(s1, separators)) != NULL)) - *end1 = '\0'; - if ((s2 != NULL) && ((end2 = strpbrk(s2, separators)) != NULL)) - *end2 = '\0'; - - if ((s1 != NULL) && (s2 == NULL)) - res = comp_string(s1, zero_string); - else if ((s1 == NULL) && (s2 != NULL)) - res = comp_string(zero_string, s2); - else - res = comp_string(s1, s2); - - if (end1 != NULL) - s1 = end1 + 1; - else - s1 = NULL; - if (end2 != NULL) - s2 = end2 + 1; - else - s2 = NULL; - - } while (res == 0 && ((s1 != NULL) || (s2 != NULL))); - - JLI_MemFree(m1); - JLI_MemFree(m2); - return (res); -} - -/* - * Return true if this simple-element (as defined in JSR 56) forms - * an acceptable match. - * - * JSR 56 is modified by the Java Web Start Developer Guide - * where it is stated "... Java Web Start will not consider an installed - * non-FCS (i.e., milestone) JRE as a match. ... a JRE from Sun - * Microsystems, Inc., is by convention a non-FCS (milestone) JRE - * if there is a dash (-) in the version string." - * - * An undocumented caveat to the above is that an exact match with a - * hyphen is accepted as a development extension. - * - * These modifications are addressed by the specific comparisons - * for releases with hyphens. - */ -static int -acceptable_simple_element(char *release, char *simple_element) -{ - char *modifier; - modifier = simple_element + strlen(simple_element) - 1; - if (*modifier == '*') { - *modifier = '\0'; - if (strchr(release, '-')) - return ((strcmp(release, simple_element) == 0)?1:0); - return ((JLI_PrefixVersionId(release, simple_element) == 0)?1:0); - } else if (*modifier == '+') { - *modifier = '\0'; - if (strchr(release, '-')) - return ((strcmp(release, simple_element) == 0)?1:0); - return ((JLI_ExactVersionId(release, simple_element) >= 0)?1:0); - } else { - return ((JLI_ExactVersionId(release, simple_element) == 0)?1:0); - } -} - -/* - * Return true if this element (as defined in JSR 56) forms - * an acceptable match. An element is the intersection (and) - * of multiple simple-elements. - */ -static int -acceptable_element(char *release, char *element) -{ - char *end; - do { - if ((end = strchr(element, '&')) != NULL) - *end = '\0'; - if (!acceptable_simple_element(release, element)) - return (0); - if (end != NULL) - element = end + 1; - } while (end != NULL); - return (1); -} - -/* - * Checks if release is acceptable by the specification version-string. - * Return true if this version-string (as defined in JSR 56) forms - * an acceptable match. A version-string is the union (or) of multiple - * elements. - */ -int -JLI_AcceptableRelease(char *release, char *version_string) -{ - char *vs; - char *m1; - char *end; - m1 = vs = JLI_StringDup(version_string); - do { - if ((end = strchr(vs, ' ')) != NULL) - *end = '\0'; - if (acceptable_element(release, vs)) { - JLI_MemFree(m1); - return (1); - } - if (end != NULL) - vs = end + 1; - } while (end != NULL); - JLI_MemFree(m1); - return (0); -} - -/* - * Return true if this is a valid simple-element (as defined in JSR 56). - * - * The official grammar for a simple-element is: - * - * simple-element ::= version-id | version-id modifier - * modifier ::= '+' | '*' - * version-id ::= string ( separator string )* - * string ::= char ( char )* - * char ::= Any ASCII character except a space, an - * ampersand, a separator or a modifier - * separator ::= '.' | '-' | '_' - * - * However, for efficiency, it is time to abandon the top down parser - * implementation. After deleting the potential trailing modifier, we - * are left with a version-id. - * - * Note that a valid version-id has three simple properties: - * - * 1) Doesn't contain a space, an ampersand or a modifier. - * - * 2) Doesn't begin or end with a separator. - * - * 3) Doesn't contain two adjacent separators. - * - * Any other line noise constitutes a valid version-id. - */ -static int -valid_simple_element(char *simple_element) -{ - char *last; - size_t len; - - if ((simple_element == NULL) || ((len = strlen(simple_element)) == 0)) - return (0); - last = simple_element + len - 1; - if (*last == '*' || *last == '+') { - if (--len == 0) - return (0); - *last-- = '\0'; - } - if (strpbrk(simple_element, " &+*") != NULL) /* Property #1 */ - return (0); - if ((strchr(".-_", *simple_element) != NULL) || /* Property #2 */ - (strchr(".-_", *last) != NULL)) - return (0); - for (; simple_element != last; simple_element++) /* Property #3 */ - if ((strchr(".-_", *simple_element) != NULL) && - (strchr(".-_", *(simple_element + 1)) != NULL)) - return (0); - return (1); -} - -/* - * Return true if this is a valid element (as defined in JSR 56). - * An element is the intersection (and) of multiple simple-elements. - */ -static int -valid_element(char *element) -{ - char *end; - if ((element == NULL) || (strlen(element) == 0)) - return (0); - do { - if ((end = strchr(element, '&')) != NULL) - *end = '\0'; - if (!valid_simple_element(element)) - return (0); - if (end != NULL) - element = end + 1; - } while (end != NULL); - return (1); -} - -/* - * Validates a version string by the extended JSR 56 grammar. - */ -int -JLI_ValidVersionString(char *version_string) -{ - char *vs; - char *m1; - char *end; - if ((version_string == NULL) || (strlen(version_string) == 0)) - return (0); - m1 = vs = JLI_StringDup(version_string); - do { - if ((end = strchr(vs, ' ')) != NULL) - *end = '\0'; - if (!valid_element(vs)) { - JLI_MemFree(m1); - return (0); - } - if (end != NULL) - vs = end + 1; - } while (end != NULL); - JLI_MemFree(m1); - return (1); -} diff -Nru icedtea-web-1.3.2/launcher/version_comp.h icedtea-web-1.4/launcher/version_comp.h --- icedtea-web-1.3.2/launcher/version_comp.h 2013-04-10 11:40:23.841668000 +0000 +++ icedtea-web-1.4/launcher/version_comp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#ifndef _VERSION_COMP_H -#define _VERSION_COMP_H - -/* - * Function prototypes. - */ -int JLI_ExactVersionId(char *id1, char *id2); -int JLI_PrefixVersionId(char *id1, char *id2); -int JLI_AcceptableRelease(char *release, char *version_string); -int JLI_ValidVersionString(char *version_string); - -#endif /* _VERSION_COMP_H */ diff -Nru icedtea-web-1.3.2/launcher/wildcard.c icedtea-web-1.4/launcher/wildcard.c --- icedtea-web-1.3.2/launcher/wildcard.c 2013-04-10 11:40:23.841668000 +0000 +++ icedtea-web-1.4/launcher/wildcard.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,495 +0,0 @@ -/* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -/* - * Class-Path Wildcards - * - * The syntax for wildcards is a single asterisk. The class path - * foo/"*", e.g., loads all jar files in the directory named foo. - * (This requires careful quotation when used in shell scripts.) - * - * Only files whose names end in .jar or .JAR are matched. - * Files whose names end in .zip, or which have a particular - * magic number, regardless of filename extension, are not - * matched. - * - * Files are considered regardless of whether or not they are - * "hidden" in the UNIX sense, i.e., have names beginning with '.'. - * - * A wildcard only matches jar files, not class files in the same - * directory. If you want to load both class files and jar files from - * a single directory foo then you can say foo:foo/"*", or foo/"*":foo - * if you want the jar files to take precedence. - * - * Subdirectories are not searched recursively, i.e., foo/"*" only - * looks for jar files in foo, not in foo/bar, foo/baz, etc. - * - * Expansion of wildcards is done early, prior to the invocation of a - * program's main method, rather than late, during the class-loading - * process itself. Each element of the input class path containing a - * wildcard is replaced by the (possibly empty) sequence of elements - * generated by enumerating the jar files in the named directory. If - * the directory foo contains a.jar, b.jar, and c.jar, - * e.g., then the class path foo/"*" is expanded into - * foo/a.jar:foo/b.jar:foo/c.jar, and that string would be the value - * of the system property java.class.path. - * - * The order in which the jar files in a directory are enumerated in - * the expanded class path is not specified and may vary from platform - * to platform and even from moment to moment on the same machine. A - * well-constructed application should not depend upon any particular - * order. If a specific order is required then the jar files can be - * enumerated explicitly in the class path. - * - * The CLASSPATH environment variable is not treated any differently - * from the -classpath (equiv. -cp) command-line option, - * i.e. wildcards are honored in all these cases. - * - * Class-path wildcards are not honored in the Class-Path jar-manifest - * header. - * - * Class-path wildcards are honored not only by the Java launcher but - * also by most other command-line tools that accept class paths, and - * in particular by javac and javadoc. - * - * Class-path wildcards are not honored in any other kind of path, and - * especially not in the bootstrap class path, which is a mere - * artifact of our implementation and not something that developers - * should use. - * - * Classpath wildcards are only expanded in the Java launcher code, - * supporting the use of wildcards on the command line and in the - * CLASSPATH environment variable. We do not support the use of - * wildcards by applications that embed the JVM. - */ - -#include -#include -#include -#include -#include -#include "java.h" /* Strictly for PATH_SEPARATOR/FILE_SEPARATOR */ -#include "jli_util.h" - -#ifdef _WIN32 -#include -#else /* Unix */ -#include -#include -#endif /* Unix */ - -static int -exists(const char* filename) -{ -#ifdef _WIN32 - return _access(filename, 0) == 0; -#else - return access(filename, F_OK) == 0; -#endif -} - -#define NEW_(TYPE) ((TYPE) JLI_MemAlloc(sizeof(struct TYPE##_))) - -/* - * Wildcard directory iteration. - * WildcardIterator_for(wildcard) returns an iterator. - * Each call to that iterator's next() method returns the basename - * of an entry in the wildcard's directory. The basename's memory - * belongs to the iterator. The caller is responsible for prepending - * the directory name and file separator, if necessary. - * When done with the iterator, call the close method to clean up. - */ -typedef struct WildcardIterator_* WildcardIterator; - -#ifdef _WIN32 -struct WildcardIterator_ -{ - HANDLE handle; - char *firstFile; /* Stupid FindFirstFile...FindNextFile */ -}; - -static WildcardIterator -WildcardIterator_for(const char *wildcard) -{ - WIN32_FIND_DATA find_data; - WildcardIterator it = NEW_(WildcardIterator); - HANDLE handle = FindFirstFile(wildcard, &find_data); - if (handle == INVALID_HANDLE_VALUE) - return NULL; - it->handle = handle; - it->firstFile = find_data.cFileName; - return it; -} - -static char * -WildcardIterator_next(WildcardIterator it) -{ - WIN32_FIND_DATA find_data; - if (it->firstFile != NULL) { - char *firstFile = it->firstFile; - it->firstFile = NULL; - return firstFile; - } - return FindNextFile(it->handle, &find_data) - ? find_data.cFileName : NULL; -} - -static void -WildcardIterator_close(WildcardIterator it) -{ - if (it) { - FindClose(it->handle); - JLI_MemFree(it->firstFile); - JLI_MemFree(it); - } -} - -#else /* Unix */ -struct WildcardIterator_ -{ - DIR *dir; -}; - -static WildcardIterator -WildcardIterator_for(const char *wildcard) -{ - DIR *dir; - int wildlen = strlen(wildcard); - if (wildlen < 2) { - dir = opendir("."); - } else { - char *dirname = JLI_StringDup(wildcard); - dirname[wildlen - 1] = '\0'; - dir = opendir(dirname); - JLI_MemFree(dirname); - } - if (dir == NULL) - return NULL; - else { - WildcardIterator it = NEW_(WildcardIterator); - it->dir = dir; - return it; - } -} - -static char * -WildcardIterator_next(WildcardIterator it) -{ - struct dirent* dirp = readdir(it->dir); - return dirp ? dirp->d_name : NULL; -} - -static void -WildcardIterator_close(WildcardIterator it) -{ - if (it) { - closedir(it->dir); - JLI_MemFree(it); - } -} -#endif /* Unix */ - -static int -equal(const char *s1, const char *s2) -{ - return strcmp(s1, s2) == 0; -} - -/* - * FileList ADT - a dynamic list of C filenames - */ -struct FileList_ -{ - char **files; - int size; - int capacity; -}; -typedef struct FileList_ *FileList; - -static FileList -FileList_new(int capacity) -{ - FileList fl = NEW_(FileList); - fl->capacity = capacity; - fl->files = (char **) JLI_MemAlloc(capacity * sizeof(fl->files[0])); - fl->size = 0; - return fl; -} - -#ifdef DEBUG_WILDCARD -static void -FileList_print(FileList fl) -{ - int i; - putchar('['); - for (i = 0; i < fl->size; i++) { - if (i > 0) printf(", "); - printf("\"%s\"",fl->files[i]); - } - putchar(']'); -} -#endif - -static void -FileList_free(FileList fl) -{ - if (fl) { - if (fl->files) { - int i; - for (i = 0; i < fl->size; i++) - JLI_MemFree(fl->files[i]); - JLI_MemFree(fl->files); - } - JLI_MemFree(fl); - } -} - -static void -FileList_ensureCapacity(FileList fl, int capacity) -{ - if (fl->capacity < capacity) { - while (fl->capacity < capacity) - fl->capacity *= 2; - fl->files = JLI_MemRealloc(fl->files, - fl->capacity * sizeof(fl->files[0])); - } -} - -static void -FileList_add(FileList fl, char *file) -{ - FileList_ensureCapacity(fl, fl->size+1); - fl->files[fl->size++] = file; -} - -static void -FileList_addSubstring(FileList fl, const char *beg, int len) -{ - char *filename = (char *) JLI_MemAlloc(len+1); - memcpy(filename, beg, len); - filename[len] = '\0'; - FileList_ensureCapacity(fl, fl->size+1); - fl->files[fl->size++] = filename; -} - -static char * -FileList_join(FileList fl, char sep) -{ - int i; - int size; - char *path; - char *p; - for (i = 0, size = 1; i < fl->size; i++) - size += strlen(fl->files[i]) + 1; - - path = JLI_MemAlloc(size); - - for (i = 0, p = path; i < fl->size; i++) { - int len = strlen(fl->files[i]); - if (i > 0) *p++ = sep; - memcpy(p, fl->files[i], len); - p += len; - } - *p = '\0'; - - return path; -} - -static FileList -FileList_split(const char *path, char sep) -{ - const char *p, *q; - int len = strlen(path); - int count; - FileList fl; - for (count = 1, p = path; p < path + len; p++) - count += (*p == sep); - fl = FileList_new(count); - for (p = path;;) { - for (q = p; q <= path + len; q++) { - if (*q == sep || *q == '\0') { - FileList_addSubstring(fl, p, q - p); - if (*q == '\0') - return fl; - p = q + 1; - } - } - } -} - -static int -isJarFileName(const char *filename) -{ - int len = strlen(filename); - return (len >= 4) && - (filename[len - 4] == '.') && - (equal(filename + len - 3, "jar") || - equal(filename + len - 3, "JAR")) && - /* Paranoia: Maybe filename is "DIR:foo.jar" */ - (strchr(filename, PATH_SEPARATOR) == NULL); -} - -static char * -wildcardConcat(const char *wildcard, const char *basename) -{ - int wildlen = strlen(wildcard); - int baselen = strlen(basename); - char *filename = (char *) JLI_MemAlloc(wildlen + baselen); - /* Replace the trailing '*' with basename */ - memcpy(filename, wildcard, wildlen-1); - memcpy(filename+wildlen-1, basename, baselen+1); - return filename; -} - -static FileList -wildcardFileList(const char *wildcard) -{ - const char *basename; - FileList fl = FileList_new(16); - WildcardIterator it = WildcardIterator_for(wildcard); - if (it == NULL) - return NULL; - while ((basename = WildcardIterator_next(it)) != NULL) - if (isJarFileName(basename)) - FileList_add(fl, wildcardConcat(wildcard, basename)); - WildcardIterator_close(it); - return fl; -} - -static int -isWildcard(const char *filename) -{ - int len = strlen(filename); - return (len > 0) && - (filename[len - 1] == '*') && - (len == 1 || IS_FILE_SEPARATOR(filename[len - 2])) && - (! exists(filename)); -} - -static void -FileList_expandWildcards(FileList fl) -{ - int i, j; - for (i = 0; i < fl->size; i++) { - if (isWildcard(fl->files[i])) { - FileList expanded = wildcardFileList(fl->files[i]); - if (expanded != NULL && expanded->size > 0) { - JLI_MemFree(fl->files[i]); - FileList_ensureCapacity(fl, fl->size + expanded->size); - for (j = fl->size - 1; j >= i+1; j--) - fl->files[j+expanded->size-1] = fl->files[j]; - for (j = 0; j < expanded->size; j++) - fl->files[i+j] = expanded->files[j]; - i += expanded->size - 1; - fl->size += expanded->size - 1; - /* fl expropriates expanded's elements. */ - expanded->size = 0; - } - FileList_free(expanded); - } - } -} - -const char * -JLI_WildcardExpandClasspath(const char *classpath) -{ - char *expanded; - FileList fl; - - if (strchr(classpath, '*') == NULL) - return classpath; - fl = FileList_split(classpath, PATH_SEPARATOR); - FileList_expandWildcards(fl); - expanded = FileList_join(fl, PATH_SEPARATOR); - FileList_free(fl); - if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) - printf("Expanded wildcards:\n" - " before: \"%s\"\n" - " after : \"%s\"\n", - classpath, expanded); - return expanded; -} - -#ifdef DEBUG_WILDCARD -static void -wildcardExpandArgv(const char ***argv) -{ - int i; - for (i = 0; (*argv)[i]; i++) { - if (equal((*argv)[i], "-cp") || - equal((*argv)[i], "-classpath")) { - i++; - (*argv)[i] = wildcardExpandClasspath((*argv)[i]); - } - } -} - -static void -debugPrintArgv(char *argv[]) -{ - int i; - putchar('['); - for (i = 0; argv[i]; i++) { - if (i > 0) printf(", "); - printf("\"%s\"", argv[i]); - } - printf("]\n"); -} - -int -main(int argc, char *argv[]) -{ - argv[0] = "java"; - wildcardExpandArgv((const char***)&argv); - debugPrintArgv(argv); - /* execvp("java", argv); */ - return 0; -} -#endif /* DEBUG_WILDCARD */ - -/* Cute little perl prototype implementation.... - -my $sep = ($^O =~ /^(Windows|cygwin)/) ? ";" : ":"; - -sub expand($) { - opendir DIR, $_[0] or return $_[0]; - join $sep, map {"$_[0]/$_"} grep {/\.(jar|JAR)$/} readdir DIR; -} - -sub munge($) { - join $sep, - map {(! -r $_ and s/[\/\\]+\*$//) ? expand $_ : $_} split $sep, $_[0]; -} - -for (my $i = 0; $i < @ARGV - 1; $i++) { - $ARGV[$i+1] = munge $ARGV[$i+1] if $ARGV[$i] =~ /^-c(p|lasspath)$/; -} - -$ENV{CLASSPATH} = munge $ENV{CLASSPATH} if exists $ENV{CLASSPATH}; -@ARGV = ("java", @ARGV); -print "@ARGV\n"; -exec @ARGV; - -*/ diff -Nru icedtea-web-1.3.2/launcher/wildcard.h icedtea-web-1.4/launcher/wildcard.h --- icedtea-web-1.3.2/launcher/wildcard.h 2013-04-10 11:40:23.841668000 +0000 +++ icedtea-web-1.4/launcher/wildcard.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. - * 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. - */ - -#ifndef WILDCARD_H_ -#define WILDCARD_H_ - -#ifdef EXPAND_CLASSPATH_WILDCARDS -const char *JLI_WildcardExpandClasspath(const char *classpath); -#else -#define JLI_WildcardExpandClasspath(s) (s) -#endif - -#endif /* include guard */ diff -Nru icedtea-web-1.3.2/Makefile.am icedtea-web-1.4/Makefile.am --- icedtea-web-1.3.2/Makefile.am 2013-04-10 11:40:23.830668000 +0000 +++ icedtea-web-1.4/Makefile.am 2013-05-03 19:08:24.127521667 +0000 @@ -1,5 +1,7 @@ # Source directories +export TOP_BUILD_DIR = $(abs_top_builddir) + export NETX_DIR = $(abs_top_builddir)/netx.build export NETX_SRCDIR = $(abs_top_srcdir)/netx export NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources @@ -18,11 +20,16 @@ export JUNIT_RUNNER_DIR=$(TESTS_DIR)/junit-runner export JUNIT_RUNNER_SRCDIR=$(TESTS_SRCDIR)/junit-runner +export JACOCO_OPERATOR_DIR=$(TESTS_DIR)/jacoco-operator +export JACOCO_OPERATOR_SRCDIR=$(TESTS_SRCDIR)/jacoco-operator export TEST_EXTENSIONS_SRCDIR=$(TESTS_SRCDIR)/test-extensions export TEST_EXTENSIONS_TESTS_SRCDIR=$(TESTS_SRCDIR)/test-extensions-tests export REPRODUCERS_TESTS_SRCDIR=$(TESTS_SRCDIR)/reproducers export TEST_EXTENSIONS_DIR=$(TESTS_DIR)/test-extensions +export CPP_UNITTEST_FRAMEWORK_SRCDIR=$(TESTS_SRCDIR)/UnitTest++ +export CPP_UNITTEST_SRCDIR=$(TESTS_SRCDIR)/cpp-unit-tests +export CPP_UNITTEST_DIR=$(TESTS_DIR)/cpp-unit-tests export TEST_EXTENSIONS_COMPATIBILITY_SYMLINK=$(TESTS_DIR)/netx/jnlp_testsengine export TEST_EXTENSIONS_TESTS_DIR=$(TESTS_DIR)/test-extensions-tests export REPRODUCERS_TESTS_SERVER_DEPLOYDIR=$(TESTS_DIR)/reproducers_test_server_deploydir @@ -34,6 +41,7 @@ export TEST_CERT_ALIAS=icedteaweb export PUBLIC_KEYSTORE=${HOME}/.icedtea/security/trusted.certs export PUBLIC_KEYSTORE_PASS=changeit +export SOFTKILLER=softkiller export JUNIT_RUNNER_JAR=$(abs_top_builddir)/junit-runner.jar export UNIT_CLASS_NAMES = $(abs_top_builddir)/unit_class_names @@ -44,12 +52,28 @@ export EMMA_BACKUP_SUFFIX=_noEmma export EMMA_SUFFIX=_withEmma export META_MANIFEST = META-INF/MANIFEST.MF -export SIGNED_REPRODUCERS=signed +export SIGNED_REPRODUCERS=signed signed2 export SIMPLE_REPRODUCERS=simple export CUSTOM_REPRODUCERS=custom export ALL_NONCUSTOM_REPRODUCERS=$(SIMPLE_REPRODUCERS) $(SIGNED_REPRODUCERS) export ALL_REPRODUCERS=$(ALL_NONCUSTOM_REPRODUCERS) $(CUSTOM_REPRODUCERS) +export JACOCO_PATH:=$(shell dirname "$(JACOCO_JAR)") +export JACOCO_AGENT=org.jacoco.agent.jar +export JACOCO_ANT=org.jacoco.ant.jar +export JACOCO_REPORT=org.jacoco.report.jar +export JACOCO_AGENTRT=org.jacoco.agent.rt.jar +export JACOCO_CORE=org.jacoco.core.jar +export JACOCO_JAVAWS_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec +export JACOCO_PLUGIN_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec +export JACOCO_CLASSPATH=$(JACOCO_PATH)/$(JACOCO_CORE):$(JACOCO_PATH)/$(JACOCO_AGENT):$(JACOCO_PATH)/$(JACOCO_REPORT):$(JACOCO_PATH)/$(JACOCO_AGENTRT):$(JACOCO_PATH)/$(JACOCO_ANT):$(ASM_JAR) +export JACOCO_AGENT_SWITCH_BODY=-javaagent:$(JACOCO_PATH)/$(JACOCO_AGENTRT) +export JACOCO_BASE_EXCLUDE=org.junit.*:junit.* +export JACOCO_ADVANCED_EXCLUDE=:*jacoco*:java.lang.*:java.reflect.*:java.util.*:sun.reflect.* +export JACOCO_AGENT_SWITCH="$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)" +export JACOCO_AGENT_JAVAWS_SWITCH=\"$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)$(JACOCO_ADVANCED_EXCLUDE),xboot=true,destfile=$(JACOCO_JAVAWS_RESULTS)\" +export JACOCO_AGENT_PLUGIN_SWITCH=\"$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)$(JACOCO_ADVANCED_EXCLUDE),xboot=true,destfile=$(JACOCO_PLUGIN_RESULTS)\" +export JACOCO_OPERATOR_EXEC=$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(JACOCO_OPERATOR_DIR):$(JACOCO_CLASSPATH):. org.jacoco.operator.Main # linking variables export PLUGIN_LINK_NAME=libjavaplugin.so @@ -59,6 +83,10 @@ export OPERA_GLOBAL64_PLUGINDIR=/usr/lib64/opera/plugins export OPERA_GLOBAL32_PLUGINDIR=/usr/lib/opera/plugins export BUILT_PLUGIN_LIBRARY=IcedTeaPlugin.so +export CPP_UNITTEST_FRAMEWORK_BUILDDIR=$(CPP_UNITTEST_DIR)/UnitTest++ +export CPP_UNITTEST_FRAMEWORK_LIB_NAME=libUnitTest++.a +export CPP_UNITTEST_FRAMEWORK_LIB=$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$(CPP_UNITTEST_FRAMEWORK_LIB_NAME) +export CPP_UNITTEST_EXECUTABLE=$(CPP_UNITTEST_DIR)/IcedTeaPluginUnitTests export MOZILLA_LOCAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origU export MOZILLA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origMG export OPERA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origOG @@ -93,6 +121,7 @@ # export LAUNCHER_BOOTCLASSPATH="-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar$(RHINO_RUNTIME)" export PLUGIN_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar:$(datadir)/$(PACKAGE_NAME)/plugin.jar$(RHINO_RUNTIME)"' +export PLUGIN_COVERAGE_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar:$(datadir)/$(PACKAGE_NAME)/plugin.jar$(RHINO_RUNTIME):$(JACOCO_CLASSPATH)"' # Fake update version to work with the Deployment Toolkit script used by Oracle # http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/depltoolkit_index.html @@ -118,6 +147,8 @@ export LIVECONNECT_SRCS = $(PLUGIN_SRCDIR)/java export ICEDTEAPLUGIN_TARGET = $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) stamps/liveconnect-dist.stamp export PLUGIN_PKGS = sun.applet netscape.security netscape.javascript +#this is for plugin testcoverage +export COVERABLE_PLUGIN_DIR=$(TESTS_DIR)/icedteanp-build-with-jacoco endif if CP_SUPPORTS_REFLINK @@ -176,6 +207,7 @@ edit_launcher_script = sed \ -e 's|[@]LAUNCHER_BOOTCLASSPATH[@]|$(LAUNCHER_BOOTCLASSPATH)|g' \ -e 's|[@]JAVAWS_BIN_LOCATION[@]|$(bindir)/$(javaws)|g' \ + -e 's|[@]JAVAWS_SPLASH_LOCATION[@]|$(datadir)/$(PACKAGE_NAME)/javaws_splash.png|g' \ -e 's|[@]ITWEB_SETTINGS_BIN_LOCATION[@]|$(bindir)/$(itweb_settings)|g' \ -e 's|[@]JAVA[@]|$(JAVA)|g' \ -e 's|[@]JRE[@]|$(SYSTEM_JRE_DIR)|g' @@ -206,6 +238,7 @@ ${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar endif ${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar + ${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png ${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir) ${INSTALL_DATA} extra-lib/about.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/about.jar ${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir) @@ -251,11 +284,11 @@ PLUGIN_SRC=IcedTeaNPPlugin.cc IcedTeaScriptablePluginObject.cc \ IcedTeaJavaRequestProcessor.cc IcedTeaPluginRequestProcessor.cc \ - IcedTeaPluginUtils.cc + IcedTeaPluginUtils.cc IcedTeaParseProperties.cc PLUGIN_OBJECTS=IcedTeaNPPlugin.o IcedTeaScriptablePluginObject.o \ IcedTeaJavaRequestProcessor.o IcedTeaPluginRequestProcessor.o \ - IcedTeaPluginUtils.o + IcedTeaPluginUtils.o IcedTeaParseProperties.o $(PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc mkdir -p $(PLUGIN_DIR) && \ @@ -271,6 +304,7 @@ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ $(GLIB_CFLAGS) \ $(MOZILLA_CFLAGS) \ + -fvisibility=hidden \ -fPIC -o $@ -c $< $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) @@ -278,9 +312,78 @@ $(CXX) $(CXXFLAGS) \ $(PLUGIN_OBJECTS) \ $(GLIB_LIBS) \ - $(MOZILLA_LIBS)\ + $(MOZILLA_LIBS) \ -shared -o $@ +# Start of CPP Unit test targets + +# Note that UnitTest++ has its own makefile, however this is avoided because it creates an in-source build. +$(CPP_UNITTEST_FRAMEWORK_LIB): $(CPP_UNITTEST_FRAMEWORK_SRCDIR) + mkdir -p $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) && \ + pushd $(CPP_UNITTEST_FRAMEWORK_SRCDIR) && \ + for cppfile in $$(find $(CPP_UNITTEST_FRAMEWORK_SRCDIR) -name '*.cpp') ; \ + do \ + objfile="$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$$(basename $${cppfile%.cpp}).o" ; \ + $(CXX) $(CXXFLAGS) -c $$cppfile -o $$objfile || exit 1 ; \ + done ; \ + ar cr $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o ; \ + popd + +clean-unittest++: + rm -f $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o + rm -f $(CPP_UNITTEST_FRAMEWORK_LIB) + if [ -e $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ] ; then \ + rmdir $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ; \ + fi + +stamps/cpp-unit-tests-compile.stamp: $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_SRCDIR) $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) + mkdir -p $(CPP_UNITTEST_DIR) && \ + pushd $(CPP_UNITTEST_SRCDIR) && \ + for cppfile in $$(find $(CPP_UNITTEST_SRCDIR) -name '*.cc') ; \ + do \ + objfile="$(CPP_UNITTEST_DIR)/$$(basename $${cppfile%.cc}).o" ; \ + echo "Compiling $$cppfile to $$objfile"; \ + $(CXX) $(CXXFLAGS) \ + $(DEFS) $(VERSION_DEFS) \ + -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ + -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \ + -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ + -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ + -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ + -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ + -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ + $(GLIB_CFLAGS) \ + $(MOZILLA_CFLAGS) \ + "-I$(CPP_UNITTEST_FRAMEWORK_SRCDIR)/src" \ + "-I$(PLUGIN_SRCDIR)" \ + -o $$objfile -c $$cppfile || exit 1 ; \ + done ; \ + popd ; \ + mkdir -p stamps ; \ + touch $@ + +$(CPP_UNITTEST_EXECUTABLE): $(CPP_UNITTEST_FRAMEWORK_LIB) stamps/cpp-unit-tests-compile.stamp + cd $(CPP_UNITTEST_DIR) && \ + $(CXX) $(CXXFLAGS) \ + $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) \ + $(CPP_UNITTEST_DIR)/*.o \ + -lrt \ + -lpthread \ + $(GLIB_LIBS) \ + $(MOZILLA_LIBS) \ + $(CPP_UNITTEST_FRAMEWORK_LIB)\ + $(BUILT_CPP_UNIT_TEST_FRAMEWORK) -o $@ + +clean-cpp-unit-tests: + rm -f stamps/cpp-unit-tests-compile.stamp + rm -f $(CPP_UNITTEST_EXECUTABLE) + rm -f $(CPP_UNITTEST_DIR)/*.o + +run-cpp-unit-tests: $(CPP_UNITTEST_EXECUTABLE) + $(CPP_UNITTEST_EXECUTABLE) + +# End of CPP Unit test targets + clean-IcedTeaPlugin: rm -f $(PLUGIN_DIR)/*.o rm -f $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) @@ -487,7 +590,10 @@ # check # ========================== -clean-tests: clean-netx-tests +clean-tests: clean-netx-tests clean-cpp-unit-tests clean-unittest++ + if [ -e $(CPP_UNITTEST_DIR) ] ; then \ + rmdir $(CPP_UNITTEST_DIR) ; \ + fi if [ -e $(TESTS_DIR) ]; then \ rmdir $(TESTS_DIR) ; \ fi @@ -501,6 +607,9 @@ junit-runner-source-files.txt: find $(JUNIT_RUNNER_SRCDIR) -name '*.java' | sort > $@ +jacoco-operator-source-files.txt: + find $(JACOCO_OPERATOR_SRCDIR) -name '*.java' | sort > $@ + $(JUNIT_RUNNER_JAR): junit-runner-source-files.txt stamps/test-extensions-compile.stamp mkdir -p $(JUNIT_RUNNER_DIR) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ @@ -532,7 +641,7 @@ mkdir -p stamps && \ touch $@ -stamps/netx-dist-tests-prepare-reproducers.stamp: stamps/junit-jnlp-dist-dirs +stamps/netx-dist-tests-prepare-reproducers.stamp: stamps/junit-jnlp-dist-dirs stamps/liveconnect-dist.stamp stamps/netx-dist.stamp stamps/plugin.stamp types=($(ALL_NONCUSTOM_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ @@ -622,7 +731,7 @@ done ; types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ - keytool -export -alias $(TEST_CERT_ALIAS)_$$which -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) -storepass $(PRIVATE_KEYSTORE_PASS) -keystore $(PRIVATE_KEYSTORE_NAME) ; \ + $(BOOT_DIR)/bin/keytool -export -alias $(TEST_CERT_ALIAS)_$$which -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) -storepass $(PRIVATE_KEYSTORE_PASS) -keystore $(PRIVATE_KEYSTORE_NAME) ; \ done ; mkdir -p stamps && \ touch $@ @@ -645,13 +754,13 @@ test-extensions-source-files.txt: find $(TEST_EXTENSIONS_SRCDIR) -name '*.java' | sort > $@ -stamps/test-extensions-compile.stamp: stamps/junit-jnlp-dist-dirs test-extensions-source-files.txt +stamps/test-extensions-compile.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs test-extensions-source-files.txt mkdir -p $(TEST_EXTENSIONS_DIR); mkdir -p $(NETX_TEST_DIR); ln -s $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK); $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_DIR) \ - -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar \ + -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar \ @test-extensions-source-files.txt && \ mkdir -p stamps && \ touch $@ @@ -668,7 +777,7 @@ mkdir -p stamps && \ touch $@ -stamps/compile-reproducers-testcases.stamp: stamps/netx.stamp stamps/junit-jnlp-dist-dirs \ +stamps/compile-reproducers-testcases.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs \ test-extensions-source-files.txt stamps/test-extensions-compile.stamp stamps/test-extensions-tests-compile.stamp types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ @@ -679,7 +788,15 @@ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ - "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/"* ; \ + "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/"*.java ; \ + if [ -d "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ]; then \ + pushd "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ; \ + NONJAVA_RESOURCES=`ls | grep -v ".*\\.java$$"` ; \ + if [ -n "$$NONJAVA_RESOURCES" ]; then \ + cp $$NONJAVA_RESOURCES $(TEST_EXTENSIONS_TESTS_DIR)/ ; \ + fi ; \ + popd ; \ + fi ; \ done ; \ done ; \ mkdir -p stamps && \ @@ -722,19 +839,24 @@ done ; \ echo $$class_names > $(REPRODUCERS_CLASS_NAMES) +$(TESTS_DIR)/$(SOFTKILLER): + cd $(TESTS_SRCDIR)/$(SOFTKILLER); \ + $(MAKE) ; \ + mv $(SOFTKILLER) $(TESTS_DIR)/ + stamps/run-netx-dist-tests.stamp: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher.build/$(javaws) \ javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop \ - stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ + stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public $(TESTS_DIR)/softkiller \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) stamps/process-custom-reproducers.stamp cd $(TEST_EXTENSIONS_DIR) ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ - CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) \ $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath:$(RUNTIME) CommandLine $$class_names if WITH_XSLTPROC - $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(TEST_EXTENSIONS_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_reproducers.html - $(XSLTPROC) --stringparam logs logs_reproducers.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html + -$(XSLTPROC) --stringparam logs logs_reproducers.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html + -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(TEST_EXTENSIONS_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_reproducers.html endif touch $@ @@ -877,7 +999,7 @@ mkdir -p $(NETX_UNIT_TEST_DIR) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_UNIT_TEST_DIR) \ - -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ + -classpath $(JUNIT_JAR):$(abs_top_builddir)/liveconnect/lib/classes.jar:$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ @netx-unit-tests-source-files.txt && \ mkdir -p stamps && \ touch $@ @@ -907,11 +1029,11 @@ done ; \ cd $(NETX_UNIT_TEST_DIR) ; \ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ - CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR) \ $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names if WITH_XSLTPROC - $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(NETX_UNIT_TEST_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_unit.html - $(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html + -$(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html + -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(NETX_UNIT_TEST_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_unit.html endif mkdir -p stamps && \ touch $@ @@ -943,6 +1065,7 @@ -cp $(BOOT_DIR)/jre/lib/resources.jar \ -cp $(RHINO_RUNTIME) \ -cp $(TEST_EXTENSIONS_DIR) \ + -cp $(TEST_EXTENSIONS_SRCDIR) \ -cp . \ -ix "-org.junit.*" \ -ix "-junit.*" \ @@ -957,6 +1080,53 @@ endif touch $@ +stamps/compile-jacoco-operator.stamp: jacoco-operator-source-files.txt +if WITH_JACOCO + mkdir -p $(JACOCO_OPERATOR_DIR) && \ + $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ + -d $(JACOCO_OPERATOR_DIR) \ + -classpath $(JACOCO_CLASSPATH) \ + @jacoco-operator-source-files.txt ; +else + echo "Sorry, jacoco coverage report generator cant be compiled without jacoco installed. Try installing jacoco or specify with-jacoco value" ; + exit 5 +endif + touch $@ + + +#warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file) +#xml results run with jacoco agent however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored +stamps/run-unit-test-code-coverage-jacoco.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ + $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) stamps/compile-jacoco-operator.stamp +if WITH_JACOCO + filename=" " ; \ + cd $(NETX_UNIT_TEST_SRCDIR) ; \ + for file in `find . -type f \! -iname "*.java"`; do\ + filename=`echo $$file `; \ + cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \ + done ; \ + cd $(NETX_UNIT_TEST_DIR) ; \ + for file in $(EMMA_MODIFIED_FILES) ; do \ + mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ + done ;\ + class_names=`cat $(UNIT_CLASS_NAMES)` ; \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):.:$(TEST_EXTENSIONS_SRCDIR) \ + $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) -Xbootclasspath:$(RUNTIME) CommandLine $$class_names ; \ + for file in $(EMMA_MODIFIED_FILES) ; do \ + mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ + mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \ + done ; \ + $(JACOCO_OPERATOR_EXEC) \ + report --die-soon --html-output coverage --xml-output coverage.xml --input-file jacoco.exec \ + --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(NETX_UNIT_TEST_SRCDIR) $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) \ + --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(NETX_UNIT_TEST_DIR) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) \ + --title "IcedTea-Web unit-tests codecoverage" ; +else + echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; + exit 5 +endif + touch $@ + #warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-reproducers-test-code-coverage.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) @@ -1010,6 +1180,7 @@ -cp $(BOOT_DIR)/jre/lib/resources.jar \ -cp $(RHINO_RUNTIME) \ -cp . \ + -cp $(TEST_EXTENSIONS_SRCDIR) \ -cp $(TEST_EXTENSIONS_TESTS_DIR) \ -ix "-org.junit.*" \ -ix "-junit.*" \ @@ -1047,7 +1218,143 @@ endif touch $@ -run-test-code-coverage: run-unit-test-code-coverage run-reproducers-test-code-coverage +$(COVERABLE_PLUGIN_DIR): + mkdir -p $(COVERABLE_PLUGIN_DIR); + +$(COVERABLE_PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc + cd $(COVERABLE_PLUGIN_DIR) && \ + $(CXX) $(CXXFLAGS) \ + $(DEFS) $(VERSION_DEFS) \ + -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ + -DPLUGIN_NAME="\"IcedTea-Web Plugin with jacoco coverage agent\"" \ + -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ + -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ + -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ + -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ + -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_COVERAGE_BOOTCLASSPATH) \ + -DCOVERAGE_AGENT=$(JACOCO_AGENT_PLUGIN_SWITCH) \ + $(GLIB_CFLAGS) \ + $(MOZILLA_CFLAGS) \ + -fvisibility=hidden \ + -fPIC -o $@ -c $< + +$(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) + cd $(COVERABLE_PLUGIN_DIR) && \ + $(CXX) $(CXXFLAGS) \ + $(PLUGIN_OBJECTS) \ + $(GLIB_LIBS) \ + $(MOZILLA_LIBS) \ + -shared -o $@ + +stamps/build-fake-plugin.stamp: $(COVERABLE_PLUGIN_DIR) $(addprefix $(PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) + touch $@ + +#warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) +#xml results run with jacoco agent, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored +stamps/run-reproducers-test-code-coverage-jacoco.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) \ +stamps/compile-jacoco-operator.stamp stamps/build-fake-plugin.stamp +if WITH_JACOCO + cd $(TESTS_DIR) ; \ + for file in $(EMMA_MODIFIED_FILES) ; do \ + mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ + done ;\ + echo "backuping javaws in $(DESTDIR)$(bindir)" ; \ + javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \ + mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \ + echo "patching $(javaws)" ; \ + nw_bootclasspath="$(LAUNCHER_BOOTCLASSPATH):$(JACOCO_CLASSPATH)" ; \ + cat $$javaws_backup | sed "s|COMMAND.k.=\"..JAVA.\"|COMMAND[k]=\"\\$$\\{JAVA\\}\" ; k=1 ; COMMAND[k]=$(JACOCO_AGENT_JAVAWS_SWITCH)|" | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \ + chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \ + echo "backuping plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ + plugin_backup=$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)_backup ; \ + mv $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $$plugin_backup ; \ + echo "fakeing plugin" ; \ + cp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ + testcases_srcs=( ) ; \ + k=0 ; \ + types=($(ALL_REPRODUCERS)); \ + for which in "$${types[@]}" ; do \ + . $(abs_top_srcdir)/NEW_LINE_IFS ; \ + simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ + IFS="$$IFS_BACKUP" ; \ + for dir in "$${simpleReproducers[@]}" ; do \ + testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ + k=$$((k+1)) ; \ + done ; \ + done ; \ + cd $(TEST_EXTENSIONS_DIR) ; \ + class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) \ + $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) $(REPRODUCERS_DPARAMETERS) \ + -Xbootclasspath:$(RUNTIME) CommandLine $$class_names ; \ + if [ -f $(JACOCO_JAVAWS_RESULTS) ] ; then \ + jacoco_javaws_results=$(JACOCO_JAVAWS_RESULTS) ; \ + $(JACOCO_OPERATOR_EXEC) \ + report --die-soon --html-output coverage-javaws --xml-output coverage-javaws.xml --input-file $(JACOCO_JAVAWS_RESULTS) \ + --input-srcs $(NETX_SRCDIR) \ + --input-builds $(NETX_DIR)/lib/classes.jar \ + --title "IcedTea-Web javaws reproducers codecoverage" ; \ + fi; \ + if [ -f $(JACOCO_PLUGIN_RESULTS) ] ; then \ + jacoco_plugin_results=$(JACOCO_PLUGIN_RESULTS) ; \ + $(JACOCO_OPERATOR_EXEC) \ + report --die-soon --html-output coverage-plugin --xml-output coverage-plugin.xml --input-file $(JACOCO_PLUGIN_RESULTS) \ + --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java \ + --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar \ + --title "IcedTea-Web plugin reproducers codecoverage" ; \ + fi; \ + $(JACOCO_OPERATOR_EXEC) \ + merge --die-soon --input-files jacoco.exec $$jacoco_javaws_results $$jacoco_plugin_results --output-file jacoco-merged-reproducers.exec ; \ + $(JACOCO_OPERATOR_EXEC) \ + report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged-reproducers.exec \ + --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ + --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ + --title "IcedTea-Web reproducers-tests codecoverage" ; \ + echo "restoring javaws in $(DESTDIR)$(bindir)" ; \ + rm -f $(DESTDIR)$(bindir)/$(javaws); \ + mv $$javaws_backup $(DESTDIR)$(bindir)/$(javaws); \ + echo "restoring plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ + mv $$plugin_backup $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ + for file in $(EMMA_MODIFIED_FILES) ; do \ + mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ + mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \ + done ; +else + echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; + exit 5 +endif + touch $@ + +run-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp stamps/run-reproducers-test-code-coverage-jacoco.stamp +if WITH_JACOCO + cd $(TESTS_DIR) ; \ + k=0 ; \ + types=($(ALL_REPRODUCERS)); \ + for which in "$${types[@]}" ; do \ + . $(abs_top_srcdir)/NEW_LINE_IFS ; \ + simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ + IFS="$$IFS_BACKUP" ; \ + for dir in "$${simpleReproducers[@]}" ; do \ + testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ + k=$$((k+1)) ; \ + done ; \ + done ; \ + class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ + $(JACOCO_OPERATOR_EXEC) \ + merge --die-soon --input-files $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec $(NETX_UNIT_TEST_DIR)/jacoco.exec --output-file jacoco-merged.exec; \ + $(JACOCO_OPERATOR_EXEC) \ + report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged.exec \ + --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ + --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ + --input-srcs $(NETX_UNIT_TEST_SRCDIR) \ + --input-builds $(NETX_UNIT_TEST_DIR) \ + --title "IcedTea-Web complete codecoverage" ; +else + echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; + exit 5 +endif + +run-test-code-coverage: stamps/run-unit-test-code-coverage.stamps stamps/run-reproducers-test-code-coverage.stamps if WITH_EMMA cd $(TESTS_DIR) ; \ k=0 ; \ @@ -1083,7 +1390,21 @@ exit 5 endif -clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage +run-test-server-on-44321: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ + stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp + cd $(TEST_EXTENSIONS_DIR) ; \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \ + $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ + -Xbootclasspath:$(RUNTIME) net.sourceforge.jnlp.ServerAccess + +run-test-server-on-random-port: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ + stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp + cd $(TEST_EXTENSIONS_DIR) ; \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \ + $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ + -Xbootclasspath:$(RUNTIME) net.sourceforge.jnlp.ServerAccess randomport + +clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage-jacoco clean-test-code-coverage if [ -e $(TESTS_DIR)/netx ]; then \ rmdir $(TESTS_DIR)/netx ; \ fi @@ -1105,7 +1426,10 @@ rm -rf $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ rm -f $(TESTS_DIR)/*.html -clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers +clean-$(SOFTKILLER): + rm -f $(TESTS_DIR)/softkiller + +clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers clean-$(SOFTKILLER) rm -f test-extensions-source-files.txt rm -f test-extensions-tests-source-files.txt rm -f $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK) @@ -1163,6 +1487,43 @@ rm -f $(TESTS_DIR)/coverage.em ; \ fi +clean-unit-test-code-coverage-jacoco: + if [ -e stamps/run-unit-test-code-coverage-jacoco.stamp ]; then \ + rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \ + rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \ + rm -f $(NETX_UNIT_TEST_DIR)/jacoco.exec ; \ + rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \ + rm -f stamps/run-unit-test-code-coverage-jacoco.stamp ; \ + fi + +clean-reproducers-test-code-coverage-jacoco: + if [ -e stamps/run-reproducers-test-code-coverage-jacoco.stamp ]; then \ + rm -rf $(TEST_EXTENSIONS_DIR)/coverage-javaws ; \ + rm -f $(TEST_EXTENSIONS_DIR)/coverage-javaws.xml ; \ + rm -f $(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec ; \ + rm -rf $(TEST_EXTENSIONS_DIR)/coverage-plugin ; \ + rm -f $(TEST_EXTENSIONS_DIR)/coverage-plugin.xml ; \ + rm -f $(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec ; \ + rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \ + rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \ + rm -f $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec ; \ + rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \ + rm -f stamps/run-reproducers-test-code-coverage-jacoco.stamp ; \ + fi + +clean-test-code-coverage-jacoco: clean-unit-test-code-coverage-jacoco clean-reproducers-test-code-coverage-jacoco clean-test-code-coverage-tools-jacoco + if [ -e $(TESTS_DIR)/coverage.xml ]; then \ + rm -rf $(TESTS_DIR)/coverage ; \ + rm -f $(TESTS_DIR)/jacoco-merged.exec; \ + fi + +clean-test-code-coverage-tools-jacoco: + rm -rf $(JACOCO_OPERATOR_DIR) + rm -rf $(COVERABLE_PLUGIN_DIR) + rm -f stamps/compile-jacoco-operator.stamp; + rm -f jacoco-operator-source-files.txt + rm -f stamps/build-fake-plugin.stamp + # plugin tests @@ -1282,3 +1643,7 @@ run-unit-test-code-coverage: stamps/run-unit-test-code-coverage.stamp run-reproducers-test-code-coverage: stamps/run-reproducers-test-code-coverage.stamp + +run-unit-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp + +run-reproducers-test-code-coverage-jacoco: stamps/run-reproducers-test-code-coverage-jacoco.stamp diff -Nru icedtea-web-1.3.2/Makefile.in icedtea-web-1.4/Makefile.in --- icedtea-web-1.3.2/Makefile.in 2013-04-11 16:15:37.816212806 +0000 +++ icedtea-web-1.4/Makefile.in 2013-05-03 19:23:56.312803705 +0000 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.12.2 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,23 +17,6 @@ # Source directories VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -70,32 +54,23 @@ CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best -DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ARCHFLAG = @ARCHFLAG@ ARCH_PREFIX = @ARCH_PREFIX@ +ASM_AVAILABLE = @ASM_AVAILABLE@ +ASM_JAR = @ASM_JAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -138,6 +113,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACOCO_AVAILABLE = @JACOCO_AVAILABLE@ +JACOCO_JAR = @JACOCO_JAR@ JAR = @JAR@ JARSIGNER = @JARSIGNER@ JAR_ACCEPTS_STDIN_LIST = @JAR_ACCEPTS_STDIN_LIST@ @@ -264,6 +241,7 @@ edit_launcher_script = sed \ -e 's|[@]LAUNCHER_BOOTCLASSPATH[@]|$(LAUNCHER_BOOTCLASSPATH)|g' \ -e 's|[@]JAVAWS_BIN_LOCATION[@]|$(bindir)/$(javaws)|g' \ + -e 's|[@]JAVAWS_SPLASH_LOCATION[@]|$(datadir)/$(PACKAGE_NAME)/javaws_splash.png|g' \ -e 's|[@]ITWEB_SETTINGS_BIN_LOCATION[@]|$(bindir)/$(itweb_settings)|g' \ -e 's|[@]JAVA[@]|$(JAVA)|g' \ -e 's|[@]JRE[@]|$(SYSTEM_JRE_DIR)|g' @@ -277,16 +255,16 @@ # http://developer.mozilla.org/en/docs/XPCOM_Glue @ENABLE_PLUGIN_TRUE@PLUGIN_SRC = IcedTeaNPPlugin.cc IcedTeaScriptablePluginObject.cc \ @ENABLE_PLUGIN_TRUE@ IcedTeaJavaRequestProcessor.cc IcedTeaPluginRequestProcessor.cc \ -@ENABLE_PLUGIN_TRUE@ IcedTeaPluginUtils.cc +@ENABLE_PLUGIN_TRUE@ IcedTeaPluginUtils.cc IcedTeaParseProperties.cc @ENABLE_PLUGIN_TRUE@PLUGIN_OBJECTS = IcedTeaNPPlugin.o IcedTeaScriptablePluginObject.o \ @ENABLE_PLUGIN_TRUE@ IcedTeaJavaRequestProcessor.o IcedTeaPluginRequestProcessor.o \ -@ENABLE_PLUGIN_TRUE@ IcedTeaPluginUtils.o +@ENABLE_PLUGIN_TRUE@ IcedTeaPluginUtils.o IcedTeaParseProperties.o all: all-am .SUFFIXES: -am--refresh: Makefile +am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -334,8 +312,6 @@ ctags: CTAGS CTAGS: -cscope cscopelist: - distdir: $(DISTFILES) $(am__remove_distdir) @@ -378,36 +354,36 @@ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__post_remove_distdir) + $(am__remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) + $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__post_remove_distdir) + $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) + $(am__remove_distdir) -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -418,8 +394,8 @@ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ @@ -429,7 +405,7 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod u+w $(distdir) + chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) @@ -439,7 +415,6 @@ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -463,21 +438,13 @@ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__post_remove_distdir) + $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -508,15 +475,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: @@ -601,7 +563,7 @@ .PHONY: all all-am all-local am--refresh check check-am check-local \ clean clean-generic clean-local dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ @@ -615,6 +577,8 @@ uninstall-local +export TOP_BUILD_DIR = $(abs_top_builddir) + export NETX_DIR = $(abs_top_builddir)/netx.build export NETX_SRCDIR = $(abs_top_srcdir)/netx export NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources @@ -633,10 +597,16 @@ export JUNIT_RUNNER_DIR=$(TESTS_DIR)/junit-runner export JUNIT_RUNNER_SRCDIR=$(TESTS_SRCDIR)/junit-runner +export JACOCO_OPERATOR_DIR=$(TESTS_DIR)/jacoco-operator +export JACOCO_OPERATOR_SRCDIR=$(TESTS_SRCDIR)/jacoco-operator + export TEST_EXTENSIONS_SRCDIR=$(TESTS_SRCDIR)/test-extensions export TEST_EXTENSIONS_TESTS_SRCDIR=$(TESTS_SRCDIR)/test-extensions-tests export REPRODUCERS_TESTS_SRCDIR=$(TESTS_SRCDIR)/reproducers export TEST_EXTENSIONS_DIR=$(TESTS_DIR)/test-extensions +export CPP_UNITTEST_FRAMEWORK_SRCDIR=$(TESTS_SRCDIR)/UnitTest++ +export CPP_UNITTEST_SRCDIR=$(TESTS_SRCDIR)/cpp-unit-tests +export CPP_UNITTEST_DIR=$(TESTS_DIR)/cpp-unit-tests export TEST_EXTENSIONS_COMPATIBILITY_SYMLINK=$(TESTS_DIR)/netx/jnlp_testsengine export TEST_EXTENSIONS_TESTS_DIR=$(TESTS_DIR)/test-extensions-tests export REPRODUCERS_TESTS_SERVER_DEPLOYDIR=$(TESTS_DIR)/reproducers_test_server_deploydir @@ -648,6 +618,7 @@ export TEST_CERT_ALIAS=icedteaweb export PUBLIC_KEYSTORE=${HOME}/.icedtea/security/trusted.certs export PUBLIC_KEYSTORE_PASS=changeit +export SOFTKILLER=softkiller export JUNIT_RUNNER_JAR=$(abs_top_builddir)/junit-runner.jar export UNIT_CLASS_NAMES = $(abs_top_builddir)/unit_class_names @@ -658,12 +629,29 @@ export EMMA_BACKUP_SUFFIX=_noEmma export EMMA_SUFFIX=_withEmma export META_MANIFEST = META-INF/MANIFEST.MF -export SIGNED_REPRODUCERS=signed +export SIGNED_REPRODUCERS=signed signed2 export SIMPLE_REPRODUCERS=simple export CUSTOM_REPRODUCERS=custom export ALL_NONCUSTOM_REPRODUCERS=$(SIMPLE_REPRODUCERS) $(SIGNED_REPRODUCERS) export ALL_REPRODUCERS=$(ALL_NONCUSTOM_REPRODUCERS) $(CUSTOM_REPRODUCERS) +export JACOCO_PATH:=$(shell dirname "$(JACOCO_JAR)") +export JACOCO_AGENT=org.jacoco.agent.jar +export JACOCO_ANT=org.jacoco.ant.jar +export JACOCO_REPORT=org.jacoco.report.jar +export JACOCO_AGENTRT=org.jacoco.agent.rt.jar +export JACOCO_CORE=org.jacoco.core.jar +export JACOCO_JAVAWS_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec +export JACOCO_PLUGIN_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec +export JACOCO_CLASSPATH=$(JACOCO_PATH)/$(JACOCO_CORE):$(JACOCO_PATH)/$(JACOCO_AGENT):$(JACOCO_PATH)/$(JACOCO_REPORT):$(JACOCO_PATH)/$(JACOCO_AGENTRT):$(JACOCO_PATH)/$(JACOCO_ANT):$(ASM_JAR) +export JACOCO_AGENT_SWITCH_BODY=-javaagent:$(JACOCO_PATH)/$(JACOCO_AGENTRT) +export JACOCO_BASE_EXCLUDE=org.junit.*:junit.* +export JACOCO_ADVANCED_EXCLUDE=:*jacoco*:java.lang.*:java.reflect.*:java.util.*:sun.reflect.* +export JACOCO_AGENT_SWITCH="$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)" +export JACOCO_AGENT_JAVAWS_SWITCH=\"$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)$(JACOCO_ADVANCED_EXCLUDE),xboot=true,destfile=$(JACOCO_JAVAWS_RESULTS)\" +export JACOCO_AGENT_PLUGIN_SWITCH=\"$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)$(JACOCO_ADVANCED_EXCLUDE),xboot=true,destfile=$(JACOCO_PLUGIN_RESULTS)\" +export JACOCO_OPERATOR_EXEC=$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(JACOCO_OPERATOR_DIR):$(JACOCO_CLASSPATH):. org.jacoco.operator.Main + # linking variables export PLUGIN_LINK_NAME=libjavaplugin.so export MOZILLA_LOCAL_PLUGINDIR=${HOME}/.mozilla/plugins @@ -672,6 +660,10 @@ export OPERA_GLOBAL64_PLUGINDIR=/usr/lib64/opera/plugins export OPERA_GLOBAL32_PLUGINDIR=/usr/lib/opera/plugins export BUILT_PLUGIN_LIBRARY=IcedTeaPlugin.so +export CPP_UNITTEST_FRAMEWORK_BUILDDIR=$(CPP_UNITTEST_DIR)/UnitTest++ +export CPP_UNITTEST_FRAMEWORK_LIB_NAME=libUnitTest++.a +export CPP_UNITTEST_FRAMEWORK_LIB=$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$(CPP_UNITTEST_FRAMEWORK_LIB_NAME) +export CPP_UNITTEST_EXECUTABLE=$(CPP_UNITTEST_DIR)/IcedTeaPluginUnitTests export MOZILLA_LOCAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origU export MOZILLA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origMG export OPERA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origOG @@ -700,6 +692,7 @@ # export LAUNCHER_BOOTCLASSPATH="-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar$(RHINO_RUNTIME)" export PLUGIN_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar:$(datadir)/$(PACKAGE_NAME)/plugin.jar$(RHINO_RUNTIME)"' +export PLUGIN_COVERAGE_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar:$(datadir)/$(PACKAGE_NAME)/plugin.jar$(RHINO_RUNTIME):$(JACOCO_CLASSPATH)"' # Fake update version to work with the Deployment Toolkit script used by Oracle # http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/depltoolkit_index.html @@ -724,6 +717,8 @@ @ENABLE_PLUGIN_TRUE@export LIVECONNECT_SRCS = $(PLUGIN_SRCDIR)/java @ENABLE_PLUGIN_TRUE@export ICEDTEAPLUGIN_TARGET = $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) stamps/liveconnect-dist.stamp @ENABLE_PLUGIN_TRUE@export PLUGIN_PKGS = sun.applet netscape.security netscape.javascript +#this is for plugin testcoverage +@ENABLE_PLUGIN_TRUE@export COVERABLE_PLUGIN_DIR=$(TESTS_DIR)/icedteanp-build-with-jacoco export PLUGIN_VERSION = IcedTea-Web $(FULL_VERSION) @@ -764,6 +759,7 @@ @ENABLE_PLUGIN_TRUE@ ${INSTALL_PROGRAM} $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir) @ENABLE_PLUGIN_TRUE@ ${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar ${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar + ${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png ${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir) ${INSTALL_DATA} extra-lib/about.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/about.jar ${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir) @@ -809,6 +805,7 @@ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ @ENABLE_PLUGIN_TRUE@ $(GLIB_CFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(MOZILLA_CFLAGS) \ +@ENABLE_PLUGIN_TRUE@ -fvisibility=hidden \ @ENABLE_PLUGIN_TRUE@ -fPIC -o $@ -c $< @ENABLE_PLUGIN_TRUE@$(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) @@ -816,9 +813,78 @@ @ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(PLUGIN_OBJECTS) \ @ENABLE_PLUGIN_TRUE@ $(GLIB_LIBS) \ -@ENABLE_PLUGIN_TRUE@ $(MOZILLA_LIBS)\ +@ENABLE_PLUGIN_TRUE@ $(MOZILLA_LIBS) \ @ENABLE_PLUGIN_TRUE@ -shared -o $@ +# Start of CPP Unit test targets + +# Note that UnitTest++ has its own makefile, however this is avoided because it creates an in-source build. +@ENABLE_PLUGIN_TRUE@$(CPP_UNITTEST_FRAMEWORK_LIB): $(CPP_UNITTEST_FRAMEWORK_SRCDIR) +@ENABLE_PLUGIN_TRUE@ mkdir -p $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) && \ +@ENABLE_PLUGIN_TRUE@ pushd $(CPP_UNITTEST_FRAMEWORK_SRCDIR) && \ +@ENABLE_PLUGIN_TRUE@ for cppfile in $$(find $(CPP_UNITTEST_FRAMEWORK_SRCDIR) -name '*.cpp') ; \ +@ENABLE_PLUGIN_TRUE@ do \ +@ENABLE_PLUGIN_TRUE@ objfile="$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$$(basename $${cppfile%.cpp}).o" ; \ +@ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) -c $$cppfile -o $$objfile || exit 1 ; \ +@ENABLE_PLUGIN_TRUE@ done ; \ +@ENABLE_PLUGIN_TRUE@ ar cr $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o ; \ +@ENABLE_PLUGIN_TRUE@ popd + +@ENABLE_PLUGIN_TRUE@clean-unittest++: +@ENABLE_PLUGIN_TRUE@ rm -f $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o +@ENABLE_PLUGIN_TRUE@ rm -f $(CPP_UNITTEST_FRAMEWORK_LIB) +@ENABLE_PLUGIN_TRUE@ if [ -e $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ] ; then \ +@ENABLE_PLUGIN_TRUE@ rmdir $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ; \ +@ENABLE_PLUGIN_TRUE@ fi + +@ENABLE_PLUGIN_TRUE@stamps/cpp-unit-tests-compile.stamp: $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_SRCDIR) $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) +@ENABLE_PLUGIN_TRUE@ mkdir -p $(CPP_UNITTEST_DIR) && \ +@ENABLE_PLUGIN_TRUE@ pushd $(CPP_UNITTEST_SRCDIR) && \ +@ENABLE_PLUGIN_TRUE@ for cppfile in $$(find $(CPP_UNITTEST_SRCDIR) -name '*.cc') ; \ +@ENABLE_PLUGIN_TRUE@ do \ +@ENABLE_PLUGIN_TRUE@ objfile="$(CPP_UNITTEST_DIR)/$$(basename $${cppfile%.cc}).o" ; \ +@ENABLE_PLUGIN_TRUE@ echo "Compiling $$cppfile to $$objfile"; \ +@ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) \ +@ENABLE_PLUGIN_TRUE@ $(DEFS) $(VERSION_DEFS) \ +@ENABLE_PLUGIN_TRUE@ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ +@ENABLE_PLUGIN_TRUE@ -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \ +@ENABLE_PLUGIN_TRUE@ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ +@ENABLE_PLUGIN_TRUE@ -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ +@ENABLE_PLUGIN_TRUE@ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ +@ENABLE_PLUGIN_TRUE@ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ +@ENABLE_PLUGIN_TRUE@ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ +@ENABLE_PLUGIN_TRUE@ $(GLIB_CFLAGS) \ +@ENABLE_PLUGIN_TRUE@ $(MOZILLA_CFLAGS) \ +@ENABLE_PLUGIN_TRUE@ "-I$(CPP_UNITTEST_FRAMEWORK_SRCDIR)/src" \ +@ENABLE_PLUGIN_TRUE@ "-I$(PLUGIN_SRCDIR)" \ +@ENABLE_PLUGIN_TRUE@ -o $$objfile -c $$cppfile || exit 1 ; \ +@ENABLE_PLUGIN_TRUE@ done ; \ +@ENABLE_PLUGIN_TRUE@ popd ; \ +@ENABLE_PLUGIN_TRUE@ mkdir -p stamps ; \ +@ENABLE_PLUGIN_TRUE@ touch $@ + +@ENABLE_PLUGIN_TRUE@$(CPP_UNITTEST_EXECUTABLE): $(CPP_UNITTEST_FRAMEWORK_LIB) stamps/cpp-unit-tests-compile.stamp +@ENABLE_PLUGIN_TRUE@ cd $(CPP_UNITTEST_DIR) && \ +@ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) \ +@ENABLE_PLUGIN_TRUE@ $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) \ +@ENABLE_PLUGIN_TRUE@ $(CPP_UNITTEST_DIR)/*.o \ +@ENABLE_PLUGIN_TRUE@ -lrt \ +@ENABLE_PLUGIN_TRUE@ -lpthread \ +@ENABLE_PLUGIN_TRUE@ $(GLIB_LIBS) \ +@ENABLE_PLUGIN_TRUE@ $(MOZILLA_LIBS) \ +@ENABLE_PLUGIN_TRUE@ $(CPP_UNITTEST_FRAMEWORK_LIB)\ +@ENABLE_PLUGIN_TRUE@ $(BUILT_CPP_UNIT_TEST_FRAMEWORK) -o $@ + +@ENABLE_PLUGIN_TRUE@clean-cpp-unit-tests: +@ENABLE_PLUGIN_TRUE@ rm -f stamps/cpp-unit-tests-compile.stamp +@ENABLE_PLUGIN_TRUE@ rm -f $(CPP_UNITTEST_EXECUTABLE) +@ENABLE_PLUGIN_TRUE@ rm -f $(CPP_UNITTEST_DIR)/*.o + +@ENABLE_PLUGIN_TRUE@run-cpp-unit-tests: $(CPP_UNITTEST_EXECUTABLE) +@ENABLE_PLUGIN_TRUE@ $(CPP_UNITTEST_EXECUTABLE) + +# End of CPP Unit test targets + @ENABLE_PLUGIN_TRUE@clean-IcedTeaPlugin: @ENABLE_PLUGIN_TRUE@ rm -f $(PLUGIN_DIR)/*.o @ENABLE_PLUGIN_TRUE@ rm -f $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) @@ -1013,7 +1079,10 @@ # check # ========================== -clean-tests: clean-netx-tests +clean-tests: clean-netx-tests clean-cpp-unit-tests clean-unittest++ + if [ -e $(CPP_UNITTEST_DIR) ] ; then \ + rmdir $(CPP_UNITTEST_DIR) ; \ + fi if [ -e $(TESTS_DIR) ]; then \ rmdir $(TESTS_DIR) ; \ fi @@ -1027,6 +1096,9 @@ junit-runner-source-files.txt: find $(JUNIT_RUNNER_SRCDIR) -name '*.java' | sort > $@ +jacoco-operator-source-files.txt: + find $(JACOCO_OPERATOR_SRCDIR) -name '*.java' | sort > $@ + $(JUNIT_RUNNER_JAR): junit-runner-source-files.txt stamps/test-extensions-compile.stamp mkdir -p $(JUNIT_RUNNER_DIR) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ @@ -1058,7 +1130,7 @@ mkdir -p stamps && \ touch $@ -stamps/netx-dist-tests-prepare-reproducers.stamp: stamps/junit-jnlp-dist-dirs +stamps/netx-dist-tests-prepare-reproducers.stamp: stamps/junit-jnlp-dist-dirs stamps/liveconnect-dist.stamp stamps/netx-dist.stamp stamps/plugin.stamp types=($(ALL_NONCUSTOM_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ @@ -1148,7 +1220,7 @@ done ; types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ - keytool -export -alias $(TEST_CERT_ALIAS)_$$which -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) -storepass $(PRIVATE_KEYSTORE_PASS) -keystore $(PRIVATE_KEYSTORE_NAME) ; \ + $(BOOT_DIR)/bin/keytool -export -alias $(TEST_CERT_ALIAS)_$$which -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) -storepass $(PRIVATE_KEYSTORE_PASS) -keystore $(PRIVATE_KEYSTORE_NAME) ; \ done ; mkdir -p stamps && \ touch $@ @@ -1171,13 +1243,13 @@ test-extensions-source-files.txt: find $(TEST_EXTENSIONS_SRCDIR) -name '*.java' | sort > $@ -stamps/test-extensions-compile.stamp: stamps/junit-jnlp-dist-dirs test-extensions-source-files.txt +stamps/test-extensions-compile.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs test-extensions-source-files.txt mkdir -p $(TEST_EXTENSIONS_DIR); mkdir -p $(NETX_TEST_DIR); ln -s $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK); $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_DIR) \ - -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar \ + -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar \ @test-extensions-source-files.txt && \ mkdir -p stamps && \ touch $@ @@ -1194,7 +1266,7 @@ mkdir -p stamps && \ touch $@ -stamps/compile-reproducers-testcases.stamp: stamps/netx.stamp stamps/junit-jnlp-dist-dirs \ +stamps/compile-reproducers-testcases.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs \ test-extensions-source-files.txt stamps/test-extensions-compile.stamp stamps/test-extensions-tests-compile.stamp types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ @@ -1205,7 +1277,15 @@ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ - "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/"* ; \ + "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/"*.java ; \ + if [ -d "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ]; then \ + pushd "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ; \ + NONJAVA_RESOURCES=`ls | grep -v ".*\\.java$$"` ; \ + if [ -n "$$NONJAVA_RESOURCES" ]; then \ + cp $$NONJAVA_RESOURCES $(TEST_EXTENSIONS_TESTS_DIR)/ ; \ + fi ; \ + popd ; \ + fi ; \ done ; \ done ; \ mkdir -p stamps && \ @@ -1248,18 +1328,23 @@ done ; \ echo $$class_names > $(REPRODUCERS_CLASS_NAMES) +$(TESTS_DIR)/$(SOFTKILLER): + cd $(TESTS_SRCDIR)/$(SOFTKILLER); \ + $(MAKE) ; \ + mv $(SOFTKILLER) $(TESTS_DIR)/ + stamps/run-netx-dist-tests.stamp: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher.build/$(javaws) \ javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop \ - stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ + stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public $(TESTS_DIR)/softkiller \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) stamps/process-custom-reproducers.stamp cd $(TEST_EXTENSIONS_DIR) ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ - CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) \ $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath:$(RUNTIME) CommandLine $$class_names -@WITH_XSLTPROC_TRUE@ $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(TEST_EXTENSIONS_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_reproducers.html -@WITH_XSLTPROC_TRUE@ $(XSLTPROC) --stringparam logs logs_reproducers.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html +@WITH_XSLTPROC_TRUE@ -$(XSLTPROC) --stringparam logs logs_reproducers.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html +@WITH_XSLTPROC_TRUE@ -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(TEST_EXTENSIONS_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_reproducers.html touch $@ stamps/process-custom-reproducers.stamp: stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ @@ -1399,7 +1484,7 @@ mkdir -p $(NETX_UNIT_TEST_DIR) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_UNIT_TEST_DIR) \ - -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ + -classpath $(JUNIT_JAR):$(abs_top_builddir)/liveconnect/lib/classes.jar:$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ @netx-unit-tests-source-files.txt && \ mkdir -p stamps && \ touch $@ @@ -1429,10 +1514,10 @@ done ; \ cd $(NETX_UNIT_TEST_DIR) ; \ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ - CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR) \ $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names -@WITH_XSLTPROC_TRUE@ $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(NETX_UNIT_TEST_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_unit.html -@WITH_XSLTPROC_TRUE@ $(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html +@WITH_XSLTPROC_TRUE@ -$(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html +@WITH_XSLTPROC_TRUE@ -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(NETX_UNIT_TEST_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_unit.html mkdir -p stamps && \ touch $@ @@ -1462,6 +1547,7 @@ @WITH_EMMA_TRUE@ -cp $(BOOT_DIR)/jre/lib/resources.jar \ @WITH_EMMA_TRUE@ -cp $(RHINO_RUNTIME) \ @WITH_EMMA_TRUE@ -cp $(TEST_EXTENSIONS_DIR) \ +@WITH_EMMA_TRUE@ -cp $(TEST_EXTENSIONS_SRCDIR) \ @WITH_EMMA_TRUE@ -cp . \ @WITH_EMMA_TRUE@ -ix "-org.junit.*" \ @WITH_EMMA_TRUE@ -ix "-junit.*" \ @@ -1474,6 +1560,46 @@ @WITH_EMMA_FALSE@ exit 5 touch $@ +stamps/compile-jacoco-operator.stamp: jacoco-operator-source-files.txt +@WITH_JACOCO_TRUE@ mkdir -p $(JACOCO_OPERATOR_DIR) && \ +@WITH_JACOCO_TRUE@ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ +@WITH_JACOCO_TRUE@ -d $(JACOCO_OPERATOR_DIR) \ +@WITH_JACOCO_TRUE@ -classpath $(JACOCO_CLASSPATH) \ +@WITH_JACOCO_TRUE@ @jacoco-operator-source-files.txt ; +@WITH_JACOCO_FALSE@ echo "Sorry, jacoco coverage report generator cant be compiled without jacoco installed. Try installing jacoco or specify with-jacoco value" ; +@WITH_JACOCO_FALSE@ exit 5 + touch $@ + +#warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file) +#xml results run with jacoco agent however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored +stamps/run-unit-test-code-coverage-jacoco.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ + $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) stamps/compile-jacoco-operator.stamp +@WITH_JACOCO_TRUE@ filename=" " ; \ +@WITH_JACOCO_TRUE@ cd $(NETX_UNIT_TEST_SRCDIR) ; \ +@WITH_JACOCO_TRUE@ for file in `find . -type f \! -iname "*.java"`; do\ +@WITH_JACOCO_TRUE@ filename=`echo $$file `; \ +@WITH_JACOCO_TRUE@ cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \ +@WITH_JACOCO_TRUE@ done ; \ +@WITH_JACOCO_TRUE@ cd $(NETX_UNIT_TEST_DIR) ; \ +@WITH_JACOCO_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ +@WITH_JACOCO_TRUE@ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ +@WITH_JACOCO_TRUE@ done ;\ +@WITH_JACOCO_TRUE@ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ +@WITH_JACOCO_TRUE@ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):.:$(TEST_EXTENSIONS_SRCDIR) \ +@WITH_JACOCO_TRUE@ $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) -Xbootclasspath:$(RUNTIME) CommandLine $$class_names ; \ +@WITH_JACOCO_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ +@WITH_JACOCO_TRUE@ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ +@WITH_JACOCO_TRUE@ mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \ +@WITH_JACOCO_TRUE@ done ; \ +@WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ +@WITH_JACOCO_TRUE@ report --die-soon --html-output coverage --xml-output coverage.xml --input-file jacoco.exec \ +@WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(NETX_UNIT_TEST_SRCDIR) $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) \ +@WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(NETX_UNIT_TEST_DIR) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) \ +@WITH_JACOCO_TRUE@ --title "IcedTea-Web unit-tests codecoverage" ; +@WITH_JACOCO_FALSE@ echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; +@WITH_JACOCO_FALSE@ exit 5 + touch $@ + #warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-reproducers-test-code-coverage.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) @@ -1526,6 +1652,7 @@ @WITH_EMMA_TRUE@ -cp $(BOOT_DIR)/jre/lib/resources.jar \ @WITH_EMMA_TRUE@ -cp $(RHINO_RUNTIME) \ @WITH_EMMA_TRUE@ -cp . \ +@WITH_EMMA_TRUE@ -cp $(TEST_EXTENSIONS_SRCDIR) \ @WITH_EMMA_TRUE@ -cp $(TEST_EXTENSIONS_TESTS_DIR) \ @WITH_EMMA_TRUE@ -ix "-org.junit.*" \ @WITH_EMMA_TRUE@ -ix "-junit.*" \ @@ -1561,7 +1688,137 @@ @WITH_EMMA_FALSE@ exit 5 touch $@ -run-test-code-coverage: run-unit-test-code-coverage run-reproducers-test-code-coverage +$(COVERABLE_PLUGIN_DIR): + mkdir -p $(COVERABLE_PLUGIN_DIR); + +$(COVERABLE_PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc + cd $(COVERABLE_PLUGIN_DIR) && \ + $(CXX) $(CXXFLAGS) \ + $(DEFS) $(VERSION_DEFS) \ + -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ + -DPLUGIN_NAME="\"IcedTea-Web Plugin with jacoco coverage agent\"" \ + -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ + -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ + -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ + -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ + -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_COVERAGE_BOOTCLASSPATH) \ + -DCOVERAGE_AGENT=$(JACOCO_AGENT_PLUGIN_SWITCH) \ + $(GLIB_CFLAGS) \ + $(MOZILLA_CFLAGS) \ + -fvisibility=hidden \ + -fPIC -o $@ -c $< + +$(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) + cd $(COVERABLE_PLUGIN_DIR) && \ + $(CXX) $(CXXFLAGS) \ + $(PLUGIN_OBJECTS) \ + $(GLIB_LIBS) \ + $(MOZILLA_LIBS) \ + -shared -o $@ + +stamps/build-fake-plugin.stamp: $(COVERABLE_PLUGIN_DIR) $(addprefix $(PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) + touch $@ + +#warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) +#xml results run with jacoco agent, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored +stamps/run-reproducers-test-code-coverage-jacoco.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) \ +stamps/compile-jacoco-operator.stamp stamps/build-fake-plugin.stamp +@WITH_JACOCO_TRUE@ cd $(TESTS_DIR) ; \ +@WITH_JACOCO_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ +@WITH_JACOCO_TRUE@ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ +@WITH_JACOCO_TRUE@ done ;\ +@WITH_JACOCO_TRUE@ echo "backuping javaws in $(DESTDIR)$(bindir)" ; \ +@WITH_JACOCO_TRUE@ javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \ +@WITH_JACOCO_TRUE@ mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \ +@WITH_JACOCO_TRUE@ echo "patching $(javaws)" ; \ +@WITH_JACOCO_TRUE@ nw_bootclasspath="$(LAUNCHER_BOOTCLASSPATH):$(JACOCO_CLASSPATH)" ; \ +@WITH_JACOCO_TRUE@ cat $$javaws_backup | sed "s|COMMAND.k.=\"..JAVA.\"|COMMAND[k]=\"\\$$\\{JAVA\\}\" ; k=1 ; COMMAND[k]=$(JACOCO_AGENT_JAVAWS_SWITCH)|" | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \ +@WITH_JACOCO_TRUE@ chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \ +@WITH_JACOCO_TRUE@ echo "backuping plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ +@WITH_JACOCO_TRUE@ plugin_backup=$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)_backup ; \ +@WITH_JACOCO_TRUE@ mv $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $$plugin_backup ; \ +@WITH_JACOCO_TRUE@ echo "fakeing plugin" ; \ +@WITH_JACOCO_TRUE@ cp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ +@WITH_JACOCO_TRUE@ testcases_srcs=( ) ; \ +@WITH_JACOCO_TRUE@ k=0 ; \ +@WITH_JACOCO_TRUE@ types=($(ALL_REPRODUCERS)); \ +@WITH_JACOCO_TRUE@ for which in "$${types[@]}" ; do \ +@WITH_JACOCO_TRUE@ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ +@WITH_JACOCO_TRUE@ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ +@WITH_JACOCO_TRUE@ IFS="$$IFS_BACKUP" ; \ +@WITH_JACOCO_TRUE@ for dir in "$${simpleReproducers[@]}" ; do \ +@WITH_JACOCO_TRUE@ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ +@WITH_JACOCO_TRUE@ k=$$((k+1)) ; \ +@WITH_JACOCO_TRUE@ done ; \ +@WITH_JACOCO_TRUE@ done ; \ +@WITH_JACOCO_TRUE@ cd $(TEST_EXTENSIONS_DIR) ; \ +@WITH_JACOCO_TRUE@ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ +@WITH_JACOCO_TRUE@ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) \ +@WITH_JACOCO_TRUE@ $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) $(REPRODUCERS_DPARAMETERS) \ +@WITH_JACOCO_TRUE@ -Xbootclasspath:$(RUNTIME) CommandLine $$class_names ; \ +@WITH_JACOCO_TRUE@ if [ -f $(JACOCO_JAVAWS_RESULTS) ] ; then \ +@WITH_JACOCO_TRUE@ jacoco_javaws_results=$(JACOCO_JAVAWS_RESULTS) ; \ +@WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ +@WITH_JACOCO_TRUE@ report --die-soon --html-output coverage-javaws --xml-output coverage-javaws.xml --input-file $(JACOCO_JAVAWS_RESULTS) \ +@WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) \ +@WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar \ +@WITH_JACOCO_TRUE@ --title "IcedTea-Web javaws reproducers codecoverage" ; \ +@WITH_JACOCO_TRUE@ fi; \ +@WITH_JACOCO_TRUE@ if [ -f $(JACOCO_PLUGIN_RESULTS) ] ; then \ +@WITH_JACOCO_TRUE@ jacoco_plugin_results=$(JACOCO_PLUGIN_RESULTS) ; \ +@WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ +@WITH_JACOCO_TRUE@ report --die-soon --html-output coverage-plugin --xml-output coverage-plugin.xml --input-file $(JACOCO_PLUGIN_RESULTS) \ +@WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java \ +@WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar \ +@WITH_JACOCO_TRUE@ --title "IcedTea-Web plugin reproducers codecoverage" ; \ +@WITH_JACOCO_TRUE@ fi; \ +@WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ +@WITH_JACOCO_TRUE@ merge --die-soon --input-files jacoco.exec $$jacoco_javaws_results $$jacoco_plugin_results --output-file jacoco-merged-reproducers.exec ; \ +@WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ +@WITH_JACOCO_TRUE@ report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged-reproducers.exec \ +@WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ +@WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ +@WITH_JACOCO_TRUE@ --title "IcedTea-Web reproducers-tests codecoverage" ; \ +@WITH_JACOCO_TRUE@ echo "restoring javaws in $(DESTDIR)$(bindir)" ; \ +@WITH_JACOCO_TRUE@ rm -f $(DESTDIR)$(bindir)/$(javaws); \ +@WITH_JACOCO_TRUE@ mv $$javaws_backup $(DESTDIR)$(bindir)/$(javaws); \ +@WITH_JACOCO_TRUE@ echo "restoring plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ +@WITH_JACOCO_TRUE@ mv $$plugin_backup $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ +@WITH_JACOCO_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ +@WITH_JACOCO_TRUE@ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ +@WITH_JACOCO_TRUE@ mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \ +@WITH_JACOCO_TRUE@ done ; +@WITH_JACOCO_FALSE@ echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; +@WITH_JACOCO_FALSE@ exit 5 + touch $@ + +run-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp stamps/run-reproducers-test-code-coverage-jacoco.stamp +@WITH_JACOCO_TRUE@ cd $(TESTS_DIR) ; \ +@WITH_JACOCO_TRUE@ k=0 ; \ +@WITH_JACOCO_TRUE@ types=($(ALL_REPRODUCERS)); \ +@WITH_JACOCO_TRUE@ for which in "$${types[@]}" ; do \ +@WITH_JACOCO_TRUE@ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ +@WITH_JACOCO_TRUE@ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ +@WITH_JACOCO_TRUE@ IFS="$$IFS_BACKUP" ; \ +@WITH_JACOCO_TRUE@ for dir in "$${simpleReproducers[@]}" ; do \ +@WITH_JACOCO_TRUE@ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ +@WITH_JACOCO_TRUE@ k=$$((k+1)) ; \ +@WITH_JACOCO_TRUE@ done ; \ +@WITH_JACOCO_TRUE@ done ; \ +@WITH_JACOCO_TRUE@ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ +@WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ +@WITH_JACOCO_TRUE@ merge --die-soon --input-files $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec $(NETX_UNIT_TEST_DIR)/jacoco.exec --output-file jacoco-merged.exec; \ +@WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ +@WITH_JACOCO_TRUE@ report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged.exec \ +@WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ +@WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ +@WITH_JACOCO_TRUE@ --input-srcs $(NETX_UNIT_TEST_SRCDIR) \ +@WITH_JACOCO_TRUE@ --input-builds $(NETX_UNIT_TEST_DIR) \ +@WITH_JACOCO_TRUE@ --title "IcedTea-Web complete codecoverage" ; +@WITH_JACOCO_FALSE@ echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; +@WITH_JACOCO_FALSE@ exit 5 + +run-test-code-coverage: stamps/run-unit-test-code-coverage.stamps stamps/run-reproducers-test-code-coverage.stamps @WITH_EMMA_TRUE@ cd $(TESTS_DIR) ; \ @WITH_EMMA_TRUE@ k=0 ; \ @WITH_EMMA_TRUE@ types=($(ALL_REPRODUCERS)); \ @@ -1594,7 +1851,21 @@ @WITH_EMMA_FALSE@ echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ; @WITH_EMMA_FALSE@ exit 5 -clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage +run-test-server-on-44321: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ + stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp + cd $(TEST_EXTENSIONS_DIR) ; \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \ + $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ + -Xbootclasspath:$(RUNTIME) net.sourceforge.jnlp.ServerAccess + +run-test-server-on-random-port: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ + stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp + cd $(TEST_EXTENSIONS_DIR) ; \ + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \ + $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ + -Xbootclasspath:$(RUNTIME) net.sourceforge.jnlp.ServerAccess randomport + +clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage-jacoco clean-test-code-coverage if [ -e $(TESTS_DIR)/netx ]; then \ rmdir $(TESTS_DIR)/netx ; \ fi @@ -1616,7 +1887,10 @@ rm -rf $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ rm -f $(TESTS_DIR)/*.html -clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers +clean-$(SOFTKILLER): + rm -f $(TESTS_DIR)/softkiller + +clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers clean-$(SOFTKILLER) rm -f test-extensions-source-files.txt rm -f test-extensions-tests-source-files.txt rm -f $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK) @@ -1674,6 +1948,43 @@ rm -f $(TESTS_DIR)/coverage.em ; \ fi +clean-unit-test-code-coverage-jacoco: + if [ -e stamps/run-unit-test-code-coverage-jacoco.stamp ]; then \ + rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \ + rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \ + rm -f $(NETX_UNIT_TEST_DIR)/jacoco.exec ; \ + rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \ + rm -f stamps/run-unit-test-code-coverage-jacoco.stamp ; \ + fi + +clean-reproducers-test-code-coverage-jacoco: + if [ -e stamps/run-reproducers-test-code-coverage-jacoco.stamp ]; then \ + rm -rf $(TEST_EXTENSIONS_DIR)/coverage-javaws ; \ + rm -f $(TEST_EXTENSIONS_DIR)/coverage-javaws.xml ; \ + rm -f $(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec ; \ + rm -rf $(TEST_EXTENSIONS_DIR)/coverage-plugin ; \ + rm -f $(TEST_EXTENSIONS_DIR)/coverage-plugin.xml ; \ + rm -f $(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec ; \ + rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \ + rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \ + rm -f $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec ; \ + rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \ + rm -f stamps/run-reproducers-test-code-coverage-jacoco.stamp ; \ + fi + +clean-test-code-coverage-jacoco: clean-unit-test-code-coverage-jacoco clean-reproducers-test-code-coverage-jacoco clean-test-code-coverage-tools-jacoco + if [ -e $(TESTS_DIR)/coverage.xml ]; then \ + rm -rf $(TESTS_DIR)/coverage ; \ + rm -f $(TESTS_DIR)/jacoco-merged.exec; \ + fi + +clean-test-code-coverage-tools-jacoco: + rm -rf $(JACOCO_OPERATOR_DIR) + rm -rf $(COVERABLE_PLUGIN_DIR) + rm -f stamps/compile-jacoco-operator.stamp; + rm -f jacoco-operator-source-files.txt + rm -f stamps/build-fake-plugin.stamp + # plugin tests @ENABLE_PLUGIN_TRUE@stamps/plugin-tests.stamp: $(PLUGIN_TEST_SRCS) stamps/plugin.stamp @@ -1791,6 +2102,10 @@ run-reproducers-test-code-coverage: stamps/run-reproducers-test-code-coverage.stamp +run-unit-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp + +run-reproducers-test-code-coverage-jacoco: stamps/run-reproducers-test-code-coverage-jacoco.stamp + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru icedtea-web-1.3.2/missing icedtea-web-1.4/missing --- icedtea-web-1.3.2/missing 2013-04-11 16:15:37.734212805 +0000 +++ icedtea-web-1.4/missing 2013-05-03 19:23:56.185805302 +0000 @@ -1,9 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2012-01-06.18; # UTC +scriptversion=2009-04-28.21; # UTC -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -25,7 +26,7 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" + echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi @@ -33,7 +34,7 @@ sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' -# In the cases where this matters, 'missing' is being run in the +# In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac @@ -64,7 +65,7 @@ echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: @@ -73,20 +74,21 @@ --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file 'aclocal.m4' - autoconf touch file 'configure' - autoheader touch file 'config.h.in' + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one - automake touch all 'Makefile.in' files - bison create 'y.tab.[ch]', if possible, from existing .[ch] - flex create 'lex.yy.c', if possible, from existing .c + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file - lex create 'lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - yacc create 'y.tab.[ch]', if possible, from existing .[ch] + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. Send bug reports to ." exit $? @@ -98,8 +100,8 @@ ;; -*) - echo 1>&2 "$0: Unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; @@ -120,13 +122,22 @@ # Not GNU programs, they don't have --version. ;; + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone - # running '$TOOL --version' or '$TOOL --help' to check whether + # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi @@ -138,27 +149,27 @@ case $program in aclocal*) echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified 'acinclude.m4' or '${configure_ac}'. You might want - to install the Automake and Perl packages. Grab them from +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified '${configure_ac}'. You might want to install the - Autoconf and GNU m4 packages. Grab them from any GNU +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified 'acconfig.h' or '${configure_ac}'. You might want - to install the Autoconf and GNU m4 packages. Grab them +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" @@ -175,9 +186,9 @@ automake*) echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'. - You might want to install the Automake and Perl packages. +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | @@ -186,10 +197,10 @@ autom4te*) echo 1>&2 "\ -WARNING: '$1' is needed, but is $msg. +WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. - You can get '$1' as part of Autoconf from any GNU + You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` @@ -209,13 +220,13 @@ bison*|yacc*) echo 1>&2 "\ -WARNING: '$1' $msg. You should only need it if - you modified a '.y' file. You may need the Bison package +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get - Bison from any GNU archive site." + \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG=\${$#} + eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -239,13 +250,13 @@ lex*|flex*) echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified a '.l' file. You may need the Flex package +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get - Flex from any GNU archive site." + \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG=\${$#} + eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -262,10 +273,10 @@ help2man*) echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the - Help2man package in order for those modifications to take - effect. You can get Help2man from any GNU archive site." + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` @@ -280,12 +291,12 @@ makeinfo*) echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified a '.texi' or '.texinfo' file, or any other file +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy 'make' (AIX, - DU, IRIX). You might want to install the Texinfo package or - the GNU make package. Grab either from any GNU archive site." + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` @@ -307,14 +318,49 @@ touch $file ;; + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + *) echo 1>&2 "\ -WARNING: '$1' is needed, and is $msg. +WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the - proper tools for further handling them. Check the 'README' file, + proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case - some other package would contain this missing '$1' program." + some other package would contain this missing \`$1' program." exit 1 ;; esac Binary files /tmp/NuT9CcZAiZ/icedtea-web-1.3.2/netx/javaws_splash.png and /tmp/WZlglBfzlP/icedtea-web-1.4/netx/javaws_splash.png differ diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/AppletLog.java icedtea-web-1.4/netx/net/sourceforge/jnlp/AppletLog.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/AppletLog.java 2013-04-10 11:40:23.847668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/AppletLog.java 2013-05-03 19:08:24.199520761 +0000 @@ -1,3 +1,40 @@ +/* AppletLog.java + Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + package net.sourceforge.jnlp; import java.io.ByteArrayOutputStream; diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java icedtea-web-1.4/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java 2013-04-10 11:40:23.858668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java 2013-05-03 19:08:24.220520500 +0000 @@ -146,7 +146,7 @@ browserHttpsProxyPort = stringToPort(prefs.get("network.proxy.ssl_port")); browserFtpProxyHost = prefs.get("network.proxy.ftp"); browserFtpProxyPort = stringToPort(prefs.get("network.proxy.ftp_port")); - browserSocks4ProxyHost = prefs.get("networking.proxy.socks"); + browserSocks4ProxyHost = prefs.get("network.proxy.socks"); browserSocks4ProxyPort = stringToPort(prefs.get("network.proxy.socks_port")); } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/CacheUtil.java icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/CacheUtil.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/CacheUtil.java 2013-04-10 11:40:23.860668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/CacheUtil.java 2013-05-03 19:08:24.223520461 +0000 @@ -18,25 +18,38 @@ import static net.sourceforge.jnlp.runtime.Translator.R; -import java.io.*; -import java.net.*; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FilePermission; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.nio.channels.OverlappingFileLockException; +import java.security.Permission; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map.Entry; import java.util.Set; -import java.security.*; -import javax.jnlp.*; -import net.sourceforge.jnlp.*; +import javax.jnlp.DownloadServiceListener; + +import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.config.DeploymentConfiguration; -import net.sourceforge.jnlp.runtime.*; +import net.sourceforge.jnlp.runtime.ApplicationInstance; +import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.PropertiesFile; +import net.sourceforge.jnlp.util.UrlUtils; /** * Provides static methods to interact with the cache, download @@ -72,8 +85,8 @@ return true; } try { - URL nu1 = ResourceTracker.normalizeUrl(u1, false); - URL nu2 = ResourceTracker.normalizeUrl(u2, false); + URL nu1 = UrlUtils.normalizeUrl(u1); + URL nu2 = UrlUtils.normalizeUrl(u2); if (notNullUrlEquals(nu1, nu2)) { return true; } @@ -367,6 +380,25 @@ } /** + * Returns the parent directory of the cached resource. + * @param path The path of the cached resource directory. + */ + public static String getCacheParentDirectory(String filePath) { + String path = filePath; + String tempPath = ""; + + while(path.startsWith(cacheDir) && !path.equals(cacheDir)){ + tempPath = new File(path).getParent(); + + if (tempPath.equals(cacheDir)) + break; + + path = tempPath; + } + return path; + } + + /** * This will create a new entry for the cache item. It is however not * initialized but any future calls to getCacheFile with the source and * version given to here, will cause it to return this item. diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java 2013-04-10 11:40:23.860668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java 2013-05-03 19:08:24.224520448 +0000 @@ -29,6 +29,7 @@ import net.sourceforge.jnlp.runtime.*; import net.sourceforge.jnlp.util.ImageResources; +import net.sourceforge.jnlp.util.ScreenFinder; /** * Show the progress of downloads. @@ -62,6 +63,7 @@ /** shared constraint */ static GridBagConstraints vertical; + static GridBagConstraints verticalNoClean; static GridBagConstraints verticalIndent; static { vertical = new GridBagConstraints(); @@ -70,6 +72,9 @@ vertical.fill = GridBagConstraints.HORIZONTAL; vertical.anchor = GridBagConstraints.WEST; + verticalNoClean = new GridBagConstraints(); + verticalNoClean.weightx = 1.0; + verticalIndent = (GridBagConstraints) vertical.clone(); verticalIndent.insets = new Insets(0, 10, 3, 0); } @@ -101,9 +106,7 @@ synchronized (frameMutex) { if (frame == null) { - frame = new JFrame(downloading + "..."); - frame.setIconImages(ImageResources.INSTANCE.getApplicationImages()); - frame.getContentPane().setLayout(new GridBagLayout()); + frame=createDownloadIndicatorFrame(true); } if (resources != null) { @@ -114,15 +117,13 @@ frame.getContentPane().add(result, vertical); frame.pack(); - - if (!frame.isVisible()) { - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration()); - Dimension screen = new Dimension(screenSize.width - insets.left, - screenSize.height - insets.top); - frame.setLocation(screen.width - frame.getWidth(), - screen.height - frame.getHeight()); - } + placeFrameToLowerRight(); + result.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent e) { + placeFrameToLowerRight(); + } + }); frame.setVisible(true); @@ -130,6 +131,23 @@ } } + public static JFrame createDownloadIndicatorFrame(boolean undecorated) throws HeadlessException { + JFrame f = new JFrame(downloading + "..."); + f.setUndecorated(undecorated); + f.setIconImages(ImageResources.INSTANCE.getApplicationImages()); + f.getContentPane().setLayout(new GridBagLayout()); + return f; + } + + /** + * This places indicator to lower right corner of active monitor. + */ + private static void placeFrameToLowerRight() throws HeadlessException { + Rectangle bounds = ScreenFinder.getCurrentScreenSizeWithoutBounds(); + frame.setLocation(bounds.width+bounds.x - frame.getWidth(), + bounds.height+bounds.y - frame.getHeight()); + } + /** * Remove a download service listener that was obtained by * calling the getDownloadListener method from the shared @@ -163,13 +181,31 @@ * Groups the url progress in a panel. */ static class DownloadPanel extends JPanel implements DownloadServiceListener { + private final DownloadPanel self; + private static enum States{ + ONE_JAR, COLLAPSED, DETAILED; + } + + private static final String DETAILS=R("ButShowDetails"); + private static final String HIDE_DETAILS=R("ButHideDetails"); /** the download name */ private String downloadName; - /** Downloading part: */ private JLabel header = new JLabel(); - + /** Show/hide detailsButton button: */ + private final JButton detailsButton; + private static final URL magnifyGlassUrl = ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/showDownloadDetails.png"); + private static final URL redCrossUrl = ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/hideDownloadDetails.png"); + private static final Icon magnifyGlassIcon = new ImageIcon(magnifyGlassUrl); + private static final Icon redCrossIcon = new ImageIcon(redCrossUrl); + /** used instead of detailsButton button in case of one jar*/ + private JLabel delimiter = new JLabel(""); + /** all already created progress bars*/ + private List progressPanels = new ArrayList(); + private States state=States.ONE_JAR; + private ProgressPanel mainProgressPanel; + /** list of URLs being downloaded */ private List urls = new ArrayList(); @@ -181,12 +217,52 @@ * name. */ protected DownloadPanel(String downloadName) { + self = this; setLayout(new GridBagLayout()); - this.downloadName = downloadName; - this.add(header, vertical); + this.add(header, verticalNoClean); header.setFont(header.getFont().deriveFont(Font.BOLD)); + this.add(delimiter, vertical); + detailsButton = new JButton(magnifyGlassIcon); + int w = magnifyGlassIcon.getIconWidth(); + int h = magnifyGlassIcon.getIconHeight(); + detailsButton.setPreferredSize(new Dimension(w + 2, h + 2)); + detailsButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (state == States.DETAILED) { + state = States.COLLAPSED; + detailsButton.setToolTipText(DETAILS); + detailsButton.setIcon(magnifyGlassIcon); + for (ProgressPanel progressPanel : progressPanels) { + remove(progressPanel); + } + add(mainProgressPanel, verticalIndent); + recreateFrame(true); + } else { + state = States.DETAILED; + detailsButton.setToolTipText(HIDE_DETAILS); + detailsButton.setIcon(redCrossIcon); + remove(mainProgressPanel); + for (ProgressPanel progressPanel : progressPanels) { + add(progressPanel, verticalIndent); + } + recreateFrame(false); + } + } + public void recreateFrame(boolean undecorated) throws HeadlessException { + JFrame oldFrame = frame; + frame = createDownloadIndicatorFrame(undecorated); + frame.getContentPane().add(self, vertical); + synchronized (frameMutex) { + frame.pack(); + placeFrameToLowerRight(); + } + frame.setVisible(true); + oldFrame.dispose(); + } + }); setOverallPercent(0); } @@ -196,14 +272,32 @@ protected void addProgressPanel(URL url, String version) { if (!urls.contains(url)) { ProgressPanel panel = new ProgressPanel(url, version); - - add(panel, verticalIndent); + if (state != States.COLLAPSED) { + add(panel, verticalIndent); + } + progressPanels.add(panel); + urls.add(url); + panels.add(panel); + //download indicator does not know about added jars + //When only one jar is added to downlaod queue then its progress is + //shown, and there is no show detail button. + //When second one is added, then it already knows that there will + //be two or more jars, so it swap to collapsed state in count of two. + //no later, no sooner + if (panels.size() == 2){ + remove(panels.get(0)); + remove(panels.get(1)); + remove(delimiter); + add(detailsButton,vertical); + mainProgressPanel=new ProgressPanel(); + add(mainProgressPanel, verticalIndent); + state=States.COLLAPSED; + } synchronized (frameMutex) { frame.pack(); + placeFrameToLowerRight(); } - urls.add(url); - panels.add(panel); } } @@ -219,10 +313,10 @@ addProgressPanel(url, version); setOverallPercent(overallPercent); - ProgressPanel panel = panels.get(urls.indexOf(url)); panel.setProgress(readSoFar, total); panel.repaint(); + } }; SwingUtilities.invokeLater(r); @@ -230,12 +324,27 @@ /** * Sets the overall percent completed. + * should be called via invokeLater */ public void setOverallPercent(int percent) { // don't get whole string from resource and sub in // values because it'll be doing a MessageFormat for // each update. header.setText(downloading + " " + downloadName + ": " + percent + "% " + complete + "."); + Container c = header.getParent(); + //we need to adapt both panels and also frame to new length of header text + while (c != null) { + c.invalidate(); + c.validate(); + if (c instanceof Window){ + ((Window) c).pack(); + } + c=c.getParent(); + } + if (mainProgressPanel != null) { + mainProgressPanel.setProgress(percent, 100); + mainProgressPanel.repaint(); + } } /** @@ -276,12 +385,28 @@ private long total; private long readSoFar; + private Dimension size = new Dimension(80, 15); + + ProgressPanel() { + bar.setMinimumSize(size); + bar.setPreferredSize(size); + bar.setOpaque(false); + + setLayout(new GridBagLayout()); + GridBagConstraints gbc = new GridBagConstraints(); + styleGridBagConstraints(gbc); + add(bar, gbc); + } + ProgressPanel(URL url, String version) { - JLabel location = new JLabel(" " + url.getHost() + "/" + url.getFile()); + this(" " + url.getHost() + "/" + url.getFile(),version); + } + ProgressPanel(String caption, String version) { + JLabel location = new JLabel(caption); - bar.setMinimumSize(new Dimension(80, 15)); - bar.setPreferredSize(new Dimension(80, 15)); + bar.setMinimumSize(size); + bar.setPreferredSize(size); bar.setOpaque(false); setLayout(new GridBagLayout()); @@ -291,12 +416,8 @@ gbc.fill = GridBagConstraints.NONE; gbc.gridwidth = GridBagConstraints.RELATIVE; add(bar, gbc); - - gbc.insets = new Insets(0, 3, 0, 0); - gbc.weightx = 1.0; - gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.gridwidth = GridBagConstraints.REMAINDER; - gbc.anchor = GridBagConstraints.WEST; + + styleGridBagConstraints(gbc); add(location, gbc); } @@ -325,6 +446,14 @@ g.fillRect(x + 1, y + 1, divide - 1, h - 1); } } + + private void styleGridBagConstraints(GridBagConstraints gbc) { + gbc.insets = new Insets(0, 3, 0, 0); + gbc.weightx = 1.0; + gbc.fill = GridBagConstraints.HORIZONTAL; + gbc.gridwidth = GridBagConstraints.REMAINDER; + gbc.anchor = GridBagConstraints.WEST; + } }; } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java 2013-04-10 11:40:23.861668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java 2013-05-03 19:08:24.225520435 +0000 @@ -1,3 +1,40 @@ +/* IllegalResourceDescriptorException.java + Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + package net.sourceforge.jnlp.cache; @SuppressWarnings("serial") diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/Resource.java icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/Resource.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/Resource.java 2013-04-10 11:40:23.862668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/Resource.java 2013-05-03 19:08:24.225520435 +0000 @@ -109,6 +109,8 @@ synchronized (resources) { Resource resource = new Resource(location, requestVersion, updatePolicy); + //FIXME - url ignores port during its comparison + //this may affect test-suites int index = resources.indexOf(resource); if (index >= 0) { // return existing object Resource result = resources.get(index); diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/ResourceTracker.java icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/ResourceTracker.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/ResourceTracker.java 2013-04-10 11:40:23.862668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/ResourceTracker.java 2013-05-03 19:08:24.227520409 +0000 @@ -24,17 +24,16 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; -import java.net.URLDecoder; -import java.net.URLEncoder; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.jar.JarOutputStream; import java.util.jar.Pack200; @@ -46,6 +45,8 @@ import net.sourceforge.jnlp.event.DownloadEvent; import net.sourceforge.jnlp.event.DownloadListener; import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.util.HttpUtils; +import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.WeakList; /** @@ -111,17 +112,11 @@ private static final int ERROR = Resource.ERROR; private static final int STARTED = Resource.STARTED; - // normalization of url - private static final char PATH_DELIMITER_MARK = '/'; - private static final String PATH_DELIMITER = "" + PATH_DELIMITER_MARK; - private static final char QUERY_DELIMITER_MARK = '&'; - private static final String QUERY_DELIMITER = "" + QUERY_DELIMITER_MARK; - private static final char QUERY_MARK = '?'; - private static final char HREF_MARK = '#'; - private static final String UTF8 = "utf-8"; - /** max threads */ private static final int maxThreads = 5; + + /** methods used to try individual URLs when choosing best*/ + private static final String[] requestMethods = {"HEAD", "GET"}; /** running threads */ private static int threads = 0; @@ -186,7 +181,7 @@ if (location == null) throw new IllegalResourceDescriptorException("location==null"); try { - location = normalizeUrl(location, JNLPRuntime.isDebug()); + location = UrlUtils.normalizeUrl(location); } catch (Exception ex) { System.err.println("Normalization of " + location.toString() + " have failed"); ex.printStackTrace(); @@ -394,7 +389,7 @@ return resource.localFile; if (location.getProtocol().equalsIgnoreCase("file")) { - File file = new File(location.getFile()); + File file = UrlUtils.decodeUrlAsFile(location); if (file.exists()) return file; } @@ -566,7 +561,7 @@ if (threads < maxThreads) { threads++; - Thread thread = new Thread(new Downloader()); + Thread thread = new Thread(new Downloader(), "DownloaderThread" + threads); thread.start(); } } @@ -792,6 +787,12 @@ // connect URL finalLocation = findBestUrl(resource); + + if (finalLocation == null) { + System.err.println("Attempted to download " + resource.location + ", but failed to connect!"); + throw new NullPointerException("finalLocation == null"); // Caught below + } + resource.setDownloadLocation(finalLocation); URLConnection connection = finalLocation.openConnection(); // this won't change so should be okay unsynchronized connection.addRequestProperty("Accept-Encoding", "pack200-gzip, gzip"); @@ -850,14 +851,46 @@ entry.unlock(); } } + /** + * Connects to the given URL, and grabs a response code if the URL uses + * the HTTP protocol, or returns an arbitrary valid HTTP response code. + * + * @return the response code if HTTP connection, or HttpURLConnection.HTTP_OK if not. + * @throws IOException + */ + static int getUrlResponseCode(URL url, Map requestProperties, String requestMethod) throws IOException { + URLConnection connection = url.openConnection(); + + for (Map.Entry property : requestProperties.entrySet()){ + connection.addRequestProperty(property.getKey(), property.getValue()); + } + + if (connection instanceof HttpURLConnection) { + HttpURLConnection httpConnection = (HttpURLConnection)connection; + httpConnection.setRequestMethod(requestMethod); + + int responseCode = httpConnection.getResponseCode(); + + /* Fully consuming current request helps with connection re-use + * See http://docs.oracle.com/javase/1.5.0/docs/guide/net/http-keepalive.html */ + HttpUtils.consumeAndCloseConnectionSilently(httpConnection); + + return responseCode; + } + + return HttpURLConnection.HTTP_OK /* return a valid response code */; + } + /** - * Returns the best URL to use for downloading the resource + * Returns the 'best' valid URL for the given resource. + * This first adjusts the file name to take into account file versioning + * and packing, if possible. * * @param resource the resource - * @return a URL or null + * @return the best URL, or null if all failed to resolve */ - private URL findBestUrl(Resource resource) { + URL findBestUrl(Resource resource) { DownloadOptions options = downloadOptions.get(resource); if (options == null) { options = new DownloadOptions(false, false); @@ -868,29 +901,37 @@ System.err.println("All possible urls for " + resource.toString() + " : " + urls); } - URL bestUrl = null; - for (URL url : urls) { - try { - URLConnection connection = url.openConnection(); - connection.addRequestProperty("Accept-Encoding", "pack200-gzip, gzip"); - if (connection instanceof HttpURLConnection) { - HttpURLConnection con = (HttpURLConnection)connection; - int responseCode = con.getResponseCode(); - if (responseCode == -1 || responseCode < 200 || responseCode >= 300) { - continue; - } - } - if (JNLPRuntime.isDebug()) { - System.err.println("best url for " + resource.toString() + " is " + url.toString()); - } - bestUrl = url; - break; - } catch (IOException e) { - // continue - } - } - return bestUrl; + for (String requestMethod : requestMethods) { + for (URL url : urls) { + try { + Map requestProperties = new HashMap(); + requestProperties.put("Accept-Encoding", "pack200-gzip, gzip"); + + int responseCode = getUrlResponseCode(url, requestProperties, requestMethod); + + if (responseCode < 200 || responseCode >= 300) { + if (JNLPRuntime.isDebug()) { + System.err.println("For "+resource.toString()+" the server returned " + responseCode + " code for "+requestMethod+" request for " + url.toExternalForm()); + } + }else { + if (JNLPRuntime.isDebug()) { + System.err.println("best url for " + resource.toString() + " is " + url.toString() + " by " + requestMethod); + } + return url; /* This is the best URL */ + } + } catch (IOException e) { + // continue to next candidate + if (JNLPRuntime.isDebug()) { + System.err.println("While processing " + url.toString() + " by " + requestMethod + " for resource " + resource.toString() + " got " + e + ": "); + e.printStackTrace(); + } + } + } + } + + /* No valid URL, return null */ + return null; } /** @@ -1142,116 +1183,4 @@ // selectNextResource(); } }; - - private static String normalizeChunk(String base, boolean debug) throws UnsupportedEncodingException { - if (base == null) { - return base; - } - if ("".equals(base)) { - return base; - } - String result = base; - String ssE = URLDecoder.decode(base, UTF8); - // System.out.println("*" + base + "*"); - // System.out.println("-" + ssE + "-"); - if (base.equals(ssE)) { - result = URLEncoder.encode(base, UTF8); - if (debug) { - System.out.println(base + " chunk needs to be encoded => " + result); - } - } else { - if (debug) { - System.out.println(base + " chunk already encoded"); - } - } - return result; - } - - public static URL normalizeUrl(URL u, boolean debug) throws MalformedURLException, UnsupportedEncodingException { - if (u == null) { - return null; - } - String protocol = u.getProtocol(); - if (protocol == null || "file".equals(protocol)) { - return u; - } - String file = u.getPath(); - if (file == null) { - return u; - } - String host = u.getHost(); - String ref = u.getRef(); - int port = u.getPort(); - String query = u.getQuery(); - String[] qq = {}; - if (query != null) { - qq = query.split(QUERY_DELIMITER); - } - String[] ss = file.split(PATH_DELIMITER); - int normalized = 0; - if (debug) { - System.out.println("normalizing path " + file + " in " + u.toString()); - } - for (int i = 0; i < ss.length; i++) { - String base = ss[i]; - String r = normalizeChunk(base, debug); - if (!r.equals(ss[i])) { - normalized++; - } - ss[i] = r; - } - if (debug) { - System.out.println("normalizing query " + query + " in " + u.toString()); - } - for (int i = 0; i < qq.length; i++) { - String base = qq[i]; - String r = normalizeChunk(base, debug); - if (!r.equals(qq[i])) { - normalized++; - } - qq[i] = r; - } - if (normalized == 0) { - if (debug) { - System.out.println("Nothing was normalized in this url"); - } - return u; - } else { - if (debug) { - System.out.println(normalized + " chunks normalized, rejoining url"); - } - } - StringBuilder composed = new StringBuilder(""); - for (int i = 0; i < ss.length; i++) { - String string = ss[i]; - if (ss.length <= 1 || (string != null && !"".equals(string))) { - composed.append(PATH_DELIMITER_MARK).append(string); - } - } - String composed1 = composed.toString(); - if (query != null && !query.trim().equals("")) { - composed.append(QUERY_MARK); - for (int i = 0; i < qq.length; i++) { - String string = qq[i]; - if ((string != null && !"".equals(string))) { - composed.append(string); - if (i != qq.length - 1) { - composed.append(QUERY_DELIMITER_MARK); - } - } - } - } - String composed2 = composed.substring(composed1.length() - 1); - if (ref != null && !ref.trim().equals("")) { - composed.append(HREF_MARK).append(ref); - } - - URL result = new URL(protocol, host, port, composed.toString()); - - if (debug) { - System.out.println("normalized `" + composed1 + "` and `" + composed2 + "` in " + result.toString()); - } - return result; - - } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java 2013-04-10 11:40:23.862668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java 2013-05-03 19:08:24.227520409 +0000 @@ -58,7 +58,7 @@ * Returns a list of URLs that the resources might be downloadable from. * The Resources may not be downloadable from any of them. The returned order is the order * the urls should be attempted in. - * @return + * @return a list of URLs that the resources might be downloadable from */ public List getUrls() { List urls = new LinkedList(); @@ -102,9 +102,9 @@ * @param resource the resource * @param usePack whether the URL should point to the pack200 file * @param useVersion whether the URL should be modified to include the version - * @return a URL for the resource or null if an appropraite URL can not be found + * @return a URL for the resource or null if an appropriate URL can not be found */ - protected URL getUrl(Resource resource, boolean usePack, boolean useVersion) { + static URL getUrl(Resource resource, boolean usePack, boolean useVersion) { if (!(usePack || useVersion)) { throw new IllegalArgumentException("either pack200 or version required"); } @@ -116,10 +116,21 @@ } String filename = location.substring(lastSlash + 1); if (useVersion && resource.requestVersion != null) { - String parts[] = filename.split("\\.", 2); - String name = parts[0]; - String extension = parts[1]; - filename = name + "__V" + resource.requestVersion + "." + extension; + // With 'useVersion', j2-commons-cli.jar becomes, for example, j2-commons-cli__V1.0.jar + String parts[] = filename.split("\\.", -1 /* Keep blank strings*/); + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < parts.length; i++) { + sb.append(parts[i]); + // Append __V before last '.' + if (i == parts.length -2) { + sb.append("__V" + resource.requestVersion); + } + sb.append('.'); + } + sb.setLength(sb.length() - 1); // remove last '.' + + filename = sb.toString(); } if (usePack) { filename = filename + ".pack.gz"; diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/config/BasicValueValidators.java icedtea-web-1.4/netx/net/sourceforge/jnlp/config/BasicValueValidators.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/config/BasicValueValidators.java 2013-04-10 11:40:23.863668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/config/BasicValueValidators.java 2013-05-03 19:08:24.229520385 +0000 @@ -37,6 +37,7 @@ package net.sourceforge.jnlp.config; +import java.io.File; import static net.sourceforge.jnlp.runtime.Translator.R; import java.net.URL; @@ -86,8 +87,9 @@ * Checks if a value is a valid file path (not a valid file!). The actual * file may or may not exist */ - private static class FilePathValidator implements ValueValidator { - + //package private for testing purposes + static class FilePathValidator implements ValueValidator { + @Override public void validate(Object value) throws IllegalArgumentException { if (value == null) { @@ -97,13 +99,15 @@ Object possibleValue = value; if (!(possibleValue instanceof String)) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("Value should be string!"); } String possibleFile = (String) possibleValue; - if (!(possibleFile.startsWith("/"))) { - throw new IllegalArgumentException(); - } + + boolean absolute = new File(possibleFile).isAbsolute(); + if (!absolute) { + throw new IllegalArgumentException("File must be absolute"); + } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/config/Defaults.java icedtea-web-1.4/netx/net/sourceforge/jnlp/config/Defaults.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/config/Defaults.java 2013-04-10 11:40:23.864668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/config/Defaults.java 2013-05-03 19:08:24.230520373 +0000 @@ -42,6 +42,7 @@ import java.io.File; import java.util.HashMap; import java.util.Map; +import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.ShortcutDesc; import net.sourceforge.jnlp.runtime.JNLPProxySelector; @@ -384,6 +385,18 @@ DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS, null, null + }, + //unsigned applet security level + { + DeploymentConfiguration.KEY_SECURITY_LEVEL, + new SecurityValueValidator(), + null + }, + //JVM executable for itw + { + DeploymentConfiguration.KEY_JRE_DIR, + null, + null } }; diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java icedtea-web-1.4/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java 2013-04-10 11:40:23.864668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java 2013-05-03 19:08:24.230520373 +0000 @@ -51,6 +51,7 @@ public static final String DEPLOYMENT_DIR = ".icedtea"; public static final String DEPLOYMENT_CONFIG = "deployment.config"; public static final String DEPLOYMENT_PROPERTIES = "deployment.properties"; + public static final String APPLET_TRUST_SETTINGS = ".appletTrustSettings"; public static final String DEPLOYMENT_COMMENT = "Netx deployment configuration"; @@ -105,6 +106,9 @@ /** Boolean. Only show security prompts to user if true */ public static final String KEY_SECURITY_PROMPT_USER = "deployment.security.askgrantdialog.show"; + //enum of AppletSecurityLevel in result + public static final String KEY_SECURITY_LEVEL = "deployment.security.level"; + public static final String KEY_SECURITY_TRUSTED_POLICY = "deployment.security.trusted.policy"; /** Boolean. Only give AWTPermission("showWindowWithoutWarningBanner") if true */ @@ -162,6 +166,7 @@ * JVM arguments for plugin */ public static final String KEY_PLUGIN_JVM_ARGUMENTS= "deployment.plugin.jvm.arguments"; + public static final String KEY_JRE_DIR= "deployment.jre.dir"; public enum ConfigType { System, User @@ -174,6 +179,10 @@ private File systemPropertiesFile = null; /** The user's deployment.config file */ private File userPropertiesFile = null; + + /*default user file*/ + public static final File USER_DEPLOYMENT_PROPERTIES_FILE = new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR + + File.separator + DEPLOYMENT_PROPERTIES); /** the current deployment properties */ private Map> currentConfiguration; @@ -196,6 +205,17 @@ load(true); } + public static File getAppletTrustUserSettingsPath() { + return new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR + + File.separator + APPLET_TRUST_SETTINGS); + } + + public static File getAppletTrustGlobalSettingsPath() { + return new File(File.separator + "etc" + File.separator + ".java" + File.separator + + "deployment" + File.separator + APPLET_TRUST_SETTINGS); + + } + /** * Initialize this deployment configuration by reading configuration files. * Generally, it will try to continue and ignore errors it finds (such as file not found). @@ -206,14 +226,19 @@ */ public void load(boolean fixIssues) throws ConfigurationException { // make sure no state leaks if security check fails later on - File userFile = new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR - + File.separator + DEPLOYMENT_PROPERTIES); + File userFile = new File(USER_DEPLOYMENT_PROPERTIES_FILE.getAbsolutePath()); SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkRead(userFile.toString()); } + File systemConfigFile = findSystemConfigFile(); + + load(systemConfigFile, userFile, fixIssues); + } + + void load(File systemConfigFile, File userFile, boolean fixIssues) throws ConfigurationException { Map> initialProperties = Defaults.getDefaults(); Map> systemProperties = null; @@ -223,7 +248,6 @@ * there is a system-level deployment.poperties file */ - File systemConfigFile = findSystemConfigFile(); if (systemConfigFile != null) { if (loadSystemConfiguration(systemConfigFile)) { if (JNLPRuntime.isDebug()) { @@ -262,6 +286,21 @@ } /** + * Copies the current configuration into the target + */ + public void copyTo(Properties target) { + Set names = getAllPropertyNames(); + + for (String name : names) { + String value = getProperty(name); + // for Properties, missing and null are identical + if (value != null) { + target.setProperty(name, value); + } + } + } + + /** * Get the value for the given key * * @param key the property key @@ -380,8 +419,25 @@ return etcFile; } - File jreFile = new File(System.getProperty("java.home") + File.separator + "lib" - + File.separator + DEPLOYMENT_CONFIG); + String jrePath = null; + try { + Map> tmpProperties = parsePropertiesFile(USER_DEPLOYMENT_PROPERTIES_FILE); + Setting jreSetting = tmpProperties.get(KEY_JRE_DIR); + if (jreSetting != null) { + jrePath = jreSetting.getValue(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + + File jreFile; + if (jrePath != null) { + jreFile = new File(jrePath + File.separator + "lib" + + File.separator + DEPLOYMENT_CONFIG); + } else { + jreFile = new File(System.getProperty("java.home") + File.separator + "lib" + + File.separator + DEPLOYMENT_CONFIG); + } if (jreFile.isFile()) { return jreFile; } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/config/SecurityValueValidator.java icedtea-web-1.4/netx/net/sourceforge/jnlp/config/SecurityValueValidator.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/config/SecurityValueValidator.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/config/SecurityValueValidator.java 2013-05-03 19:08:24.231520361 +0000 @@ -0,0 +1,76 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.config; + +import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; + +class SecurityValueValidator implements ValueValidator { + + public SecurityValueValidator() { + } + + @Override + public void validate(Object value) throws IllegalArgumentException { + if (value == null) { + // null is correct, it means it is not user set + // and so default shoudl be used whatever it is + // returning to prevent NPE in fromString + return; + } + if (value instanceof AppletSecurityLevel) { + //?? + return; + } + if (!(value instanceof String)) { + throw new IllegalArgumentException("Expected was String, was " + value.getClass()); + } + try { + AppletSecurityLevel validated = AppletSecurityLevel.fromString((String) value); + if (validated == null) { + throw new IllegalArgumentException("Result can't be null, was"); + } + //thrown by fromString + } catch (RuntimeException ex) { + throw new IllegalArgumentException(ex); + } + } + + @Override + public String getPossibleValues() { + return AppletSecurityLevel.allToString(); + } + +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java 2013-04-10 11:40:23.865668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java 2013-05-03 19:08:24.232520349 +0000 @@ -32,6 +32,7 @@ import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.ImageResources; +import net.sourceforge.jnlp.util.ScreenFinder; /** * This dialog provides a means for user to edit more of the proxy settings. @@ -106,10 +107,7 @@ * Center the dialog box. */ private void centerDialog() { - Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - Dimension dialogSize = getSize(); - - setLocation((screen.width - dialogSize.width) / 2, (screen.height - dialogSize.height) / 2); + ScreenFinder.centerWindowsToCurrentScreen(this); } /** diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java 2013-04-10 11:40:23.866668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java 2013-05-03 19:08:24.234520324 +0000 @@ -31,6 +31,7 @@ import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.ImageResources; +import net.sourceforge.jnlp.util.ScreenFinder; /** * This class will provide a visual way of viewing cache. @@ -113,9 +114,6 @@ * Center the dialog box. */ private void centerDialog() { - Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - Dimension dialogSize = getSize(); - - setLocation((screen.width - dialogSize.width) / 2, (screen.height - dialogSize.height) / 2); + ScreenFinder.centerWindowsToCurrentScreen(this); } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java 2013-04-10 11:40:23.867668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java 2013-05-03 19:08:24.235520311 +0000 @@ -41,6 +41,7 @@ import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.SwingConstants; @@ -52,6 +53,7 @@ import javax.swing.event.ListSelectionListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.controlpanel.JVMPanel.JvmValidationResult; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.security.KeyStores; import net.sourceforge.jnlp.security.viewer.CertificatePane; @@ -65,6 +67,7 @@ * */ public class ControlPanel extends JFrame { + private JVMPanel jvmPanel; /** * Class for keeping track of the panels and their associated text. @@ -156,6 +159,21 @@ topPanel.setBorder(new EmptyBorder(10, 10, 10, 10)); return topPanel; } + + private int validateJdk() { + String s = ControlPanel.this.config.getProperty(DeploymentConfiguration.KEY_JRE_DIR); + JvmValidationResult validationResult = JVMPanel.validateJvm(s); + if (validationResult.id == JvmValidationResult.STATE.NOT_DIR + || validationResult.id == JvmValidationResult.STATE.NOT_VALID_DIR + || validationResult.id == JvmValidationResult.STATE.NOT_VALID_JDK) { + return JOptionPane.showConfirmDialog(ControlPanel.this, + ""+Translator.R("CPJVMNotokMessage1", s)+"
" + + validationResult.formattedText+"
" + + Translator.R("CPJVMNotokMessage2", DeploymentConfiguration.KEY_JRE_DIR, DeploymentConfiguration.USER_DEPLOYMENT_PROPERTIES_FILE)+"", + Translator.R("CPJVMconfirmInvalidJdkTitle"),JOptionPane.OK_CANCEL_OPTION); + } + return JOptionPane.OK_OPTION; + } /** * Creates the "ok" "apply" and "cancel" buttons. @@ -172,6 +190,10 @@ @Override public void actionPerformed(ActionEvent e) { ControlPanel.this.saveConfiguration(); + int validationResult = validateJdk(); + if (validationResult!= JOptionPane.OK_OPTION){ + return; + } ControlPanel.this.dispose(); } }); @@ -182,6 +204,15 @@ @Override public void actionPerformed(ActionEvent e) { ControlPanel.this.saveConfiguration(); + int validationResult = validateJdk(); + if (validationResult != JOptionPane.OK_OPTION) { + int i = JOptionPane.showConfirmDialog(ControlPanel.this, + Translator.R("CPJVMconfirmReset"), + Translator.R("CPJVMconfirmReset"), JOptionPane.OK_CANCEL_OPTION); + if (i == JOptionPane.OK_OPTION) { + jvmPanel.resetTestFieldArgumentsExec(); + } + } } }); buttons.add(applyButton); @@ -218,7 +249,7 @@ * @return A panel with all the components in place. */ private JPanel createMainSettingsPanel() { - + jvmPanel = (JVMPanel) createJVMSettingsPanel(); SettingsPanel[] panels = new SettingsPanel[] { new SettingsPanel(Translator.R("CPTabAbout"), createAboutPanel()), new SettingsPanel(Translator.R("CPTabCache"), createCacheSettingsPanel()), new SettingsPanel(Translator.R("CPTabCertificate"), createCertificatesSettingsPanel()), @@ -226,11 +257,14 @@ // new SettingsPanel(Translator.R("CPTabClassLoader"), createClassLoaderSettingsPanel()), new SettingsPanel(Translator.R("CPTabDebugging"), createDebugSettingsPanel()), new SettingsPanel(Translator.R("CPTabDesktopIntegration"), createDesktopSettingsPanel()), - new SettingsPanel(Translator.R("CPTabJVMSettings"), createJVMSettingsPanel()), + new SettingsPanel(Translator.R("CPTabJVMSettings"),jvmPanel), new SettingsPanel(Translator.R("CPTabNetwork"), createNetworkSettingsPanel()), // TODO: This is commented out since this is not implemented yet // new SettingsPanel(Translator.R("CPTabRuntimes"), createRuntimesSettingsPanel()), - new SettingsPanel(Translator.R("CPTabSecurity"), createSecuritySettingsPanel()), }; + new SettingsPanel(Translator.R("CPTabSecurity"), createSecuritySettingsPanel()), + //todo refactor to work with tmp file and apply as asu designed it + new SettingsPanel(Translator.R("APPEXTSECControlPanelExtendedAppletSecurityTitle"), new UnsignedAppletsTrustingListPanel(DeploymentConfiguration.getAppletTrustGlobalSettingsPath(),DeploymentConfiguration.getAppletTrustUserSettingsPath(), this.config) ) + }; // Add panels. final JPanel settingsPanel = new JPanel(new CardLayout()); @@ -360,6 +394,7 @@ config.save(); } catch (IOException e) { e.printStackTrace(); + JOptionPane.showMessageDialog(this, e); } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java 2013-04-10 11:40:23.868668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java 2013-05-03 19:08:24.237520285 +0000 @@ -40,17 +40,43 @@ import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; - +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JTextField; - +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.Document; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; +import net.sourceforge.jnlp.util.StreamUtils; @SuppressWarnings("serial") public class JVMPanel extends NamedBorderPanel { + + public static class JvmValidationResult { + + public static enum STATE { + + EMPTY, NOT_DIR, NOT_VALID_DIR, NOT_VALID_JDK, VALID_JDK; + } + public final String formattedText; + public final STATE id; + + public JvmValidationResult(String formattedText, STATE id) { + this.id = id; + this.formattedText = formattedText; + } + } private DeploymentConfiguration config; + private File lastPath = new File("/usr/lib/jvm/java/jre/"); + JTextField testFieldArgumentsExec; JVMPanel(DeploymentConfiguration config) { super(Translator.R("CPHeadJVMSettings"), new GridBagLayout()); @@ -58,23 +84,125 @@ addComponents(); } + + void resetTestFieldArgumentsExec(){ + testFieldArgumentsExec.setText(""); + } private void addComponents() { - JLabel description = new JLabel("" + Translator.R("CPJVMPluginArguments") + "
"); - JTextField testFieldArguments = new JTextField(25); + final JLabel description = new JLabel("" + Translator.R("CPJVMPluginArguments") + "
"); + final JTextField testFieldArguments = new JTextField(25); testFieldArguments.getDocument().addDocumentListener(new DocumentAdapter(config, DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS)); testFieldArguments.setText(config.getProperty(DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS)); + + final JLabel descriptionExec = new JLabel("" + Translator.R("CPJVMitwExec") + "
"); + testFieldArgumentsExec = new JTextField(100); + final JLabel validationResult = new JLabel(resetValidationResult(testFieldArgumentsExec.getText(), "", "CPJVMnone")); + final JCheckBox allowTypoTimeValidation = new JCheckBox(Translator.R("CPJVMPluginAllowTTValidation"), true); + allowTypoTimeValidation.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), "", "CPJVMnone")); + } + }); + testFieldArgumentsExec.getDocument().addDocumentListener(new DocumentListener() { + + @Override + public void insertUpdate(DocumentEvent e) { + if (allowTypoTimeValidation.isSelected()) { + JvmValidationResult s = validateJvm(testFieldArgumentsExec.getText()); + validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), s.formattedText, "CPJVMvalidated")); + } + } + + @Override + public void removeUpdate(DocumentEvent e) { + if (allowTypoTimeValidation.isSelected()) { + JvmValidationResult s = validateJvm(testFieldArgumentsExec.getText()); + validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), s.formattedText, "CPJVMvalidated")); + } + } + + @Override + public void changedUpdate(DocumentEvent e) { + if (allowTypoTimeValidation.isSelected()) { + JvmValidationResult s = validateJvm(testFieldArgumentsExec.getText()); + validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), s.formattedText, "CPJVMvalidated")); + } + } + }); + + testFieldArgumentsExec.getDocument().addDocumentListener(new DocumentAdapter(config, DeploymentConfiguration.KEY_JRE_DIR)); + testFieldArgumentsExec.setText(config.getProperty(DeploymentConfiguration.KEY_JRE_DIR)); + + final JButton selectJvm = new JButton(Translator.R("CPJVMPluginSelectExec")); + selectJvm.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + JFileChooser jfch; + if (lastPath != null && lastPath.exists()) { + jfch = new JFileChooser(lastPath); + } else { + jfch = new JFileChooser(); + } + jfch.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + int i = jfch.showOpenDialog(JVMPanel.this); + if (i == JFileChooser.APPROVE_OPTION && jfch.getSelectedFile() != null) { + lastPath = jfch.getSelectedFile().getParentFile(); + String nws = jfch.getSelectedFile().getAbsolutePath(); + String olds = testFieldArgumentsExec.getText(); + if (!nws.equals(olds)) { + validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), "", "CPJVMnone")); + } + testFieldArgumentsExec.setText(nws); + } + + } + }); + final JButton validateJvm = new JButton(Translator.R("CPJVMitwExecValidation")); + validateJvm.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + JvmValidationResult s = validateJvm(testFieldArgumentsExec.getText()); + validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), s.formattedText, "CPJVMvalidated")); + + } + }); + // Filler to pack the bottom of the panel. GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1; + c.gridwidth = 4; c.gridx = 0; c.gridy = 0; + c.insets = new Insets(2, 2, 4, 4); this.add(description, c); c.gridy++; this.add(testFieldArguments, c); + c.gridy++; + this.add(descriptionExec, c); + c.gridy++; + this.add(testFieldArgumentsExec, c); + c.gridy++; + GridBagConstraints cb1 = (GridBagConstraints) c.clone(); + cb1.fill = GridBagConstraints.NONE; + cb1.gridwidth = 1; + this.add(selectJvm, cb1); + GridBagConstraints cb3 = (GridBagConstraints) c.clone(); + cb3.fill = GridBagConstraints.NONE; + cb3.gridx = 2; + cb3.gridwidth = 1; + this.add(allowTypoTimeValidation, cb3); + GridBagConstraints cb2 = (GridBagConstraints) c.clone(); + cb2.fill = GridBagConstraints.NONE; + cb2.gridx = 3; + cb2.gridwidth = 1; + this.add(validateJvm, cb2); + c.gridy++; + this.add(validationResult, c); // This is to keep it from expanding vertically if resized. Component filler = Box.createRigidArea(new Dimension(1, 1)); @@ -82,4 +210,104 @@ c.weighty++; this.add(filler, c); } + + public static JvmValidationResult validateJvm(String cmd) { + if (cmd == null || cmd.trim().equals("")) { + return new JvmValidationResult("" + Translator.R("CPJVMvalueNotSet") + "", + JvmValidationResult.STATE.EMPTY); + } + String validationResult = ""; + File jreDirFile = new File(cmd); + JvmValidationResult.STATE latestOne = JvmValidationResult.STATE.EMPTY; + if (jreDirFile.isDirectory()) { + validationResult += "" + Translator.R("CPJVMisDir") + "
"; + } else { + validationResult += "" + Translator.R("CPJVMnotDir") + "
"; + latestOne = JvmValidationResult.STATE.NOT_DIR; + } + File javaFile = new File(cmd + File.separator + "bin" + File.separator + "java"); + if (javaFile.isFile()) { + validationResult += "" + Translator.R("CPJVMjava") + "
"; + } else { + validationResult += "" + Translator.R("CPJVMnoJava") + "
"; + if (latestOne != JvmValidationResult.STATE.NOT_DIR) { + latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; + } + } + File rtFile = new File(cmd + File.separator + "lib" + File.separator + "rt.jar"); + if (rtFile.isFile()) { + validationResult += "" + Translator.R("CPJVMrtJar") + "
"; + } else { + validationResult += "" + Translator.R("CPJVMnoRtJar") + "
"; + if (latestOne != JvmValidationResult.STATE.NOT_DIR) { + latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; + } + } + ProcessBuilder sb = new ProcessBuilder(javaFile.getAbsolutePath(), "-version"); + Process p = null; + String processErrorStream = ""; + String processStdOutStream = ""; + Integer r = null; + try { + p = sb.start(); + p.waitFor(); + processErrorStream = StreamUtils.readStreamAsString(p.getErrorStream()); + processStdOutStream = StreamUtils.readStreamAsString(p.getInputStream()); + r = p.exitValue(); + System.err.println(processErrorStream); + System.out.println(processStdOutStream); + processErrorStream = processErrorStream.toLowerCase(); + processStdOutStream = processStdOutStream.toLowerCase(); + } catch (Exception ex) {; + ex.printStackTrace(); + + } + if (r == null) { + validationResult += "" + Translator.R("CPJVMnotLaunched") + ""; + if (latestOne != JvmValidationResult.STATE.NOT_DIR) { + latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; + } + return new JvmValidationResult(validationResult, latestOne); + } + if (r.intValue() != 0) { + validationResult += "" + Translator.R("CPJVMnoSuccess") + ""; + if (latestOne != JvmValidationResult.STATE.NOT_DIR) { + latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; + } + return new JvmValidationResult(validationResult, latestOne); + } + if (processErrorStream.contains("openjdk") || processStdOutStream.contains("openjdk")) { + validationResult += "" + Translator.R("CPJVMopenJdkFound") + ""; + return new JvmValidationResult(validationResult, JvmValidationResult.STATE.VALID_JDK); + } + if (processErrorStream.contains("ibm") || processStdOutStream.contains("ibm")) { + validationResult += "" + Translator.R("CPJVMibmFound") + ""; + if (latestOne != JvmValidationResult.STATE.NOT_DIR) { + latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; + } + return new JvmValidationResult(validationResult, latestOne); + } + if (processErrorStream.contains("gij") || processStdOutStream.contains("gij")) { + validationResult += "" + Translator.R("CPJVMgijFound") + ""; + if (latestOne != JvmValidationResult.STATE.NOT_DIR) { + latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; + } + return new JvmValidationResult(validationResult, latestOne); + } + if (processErrorStream.contains("oracle") || processStdOutStream.contains("oracle") + || processErrorStream.contains("java(tm)") || processStdOutStream.contains("java(tm)")) { + validationResult += "" + Translator.R("CPJVMoracleFound") + ""; + if (latestOne != JvmValidationResult.STATE.NOT_DIR) { + latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; + } + return new JvmValidationResult(validationResult, latestOne); + } + validationResult += "" + Translator.R("CPJVMstrangeProcess") + ""; + return new JvmValidationResult(validationResult, JvmValidationResult.STATE.NOT_VALID_JDK); + + } + + private String resetValidationResult(final String value, String result, String headerKey) { + return "" + Translator.R(headerKey) + ":
" + value + "
" + result + "
"; + } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java 2013-05-03 19:08:24.239520259 +0000 @@ -0,0 +1,205 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.controlpanel; + +import java.util.Date; +import javax.swing.event.TableModelEvent; +import javax.swing.table.AbstractTableModel; +import net.sourceforge.jnlp.runtime.Translator; +import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteUnsignedApplet; +import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; +import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx; +import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageExtendedImpl; + +public class UnsignedAppletActionTableModel extends AbstractTableModel { + + final UnsignedAppletActionStorageExtendedImpl back; + private final String[] columns = new String[]{Translator.R("APPEXTSECguiTableModelTableColumnAction"), + Translator.R("APPEXTSECguiTableModelTableColumnDateOfAction"), + Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase"), + Translator.R("APPEXTSECguiTableModelTableColumnCodeBase"), + Translator.R("APPEXTSECguiTableModelTableColumnArchives")}; + + public UnsignedAppletActionTableModel(UnsignedAppletActionStorageExtendedImpl back) { + this.back = back; + } + + @Override + public int getRowCount() { + return back.toArray().length; + } + + @Override + public int getColumnCount() { + return columns.length; + } + + @Override + public String getColumnName(int columnIndex) { + return columns[columnIndex]; + } + + @Override + public Class getColumnClass(int columnIndex) { + if (columnIndex == 0) { + return ExecuteUnsignedApplet.class; + } + if (columnIndex == 1) { + return Date.class; + } + if (columnIndex == 2) { + return UrlRegEx.class; + } + if (columnIndex == 3) { + return UrlRegEx.class; + } + if (columnIndex == 4) { + return String.class; + } + if (columnIndex == 5) { + return String.class; + } + return Object.class; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + if (back.isReadOnly()) { + return false; + } + if (columnIndex == 1) { + return false; + } + if (columnIndex == 0) { + return true; + } + if (getValueAt(rowIndex, columnIndex - 1) == null || getValueAt(rowIndex, columnIndex - 1).toString().trim().isEmpty()) { + return false; + } + return true; + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + + UnsignedAppletActionEntry source = back.toArray()[rowIndex]; + if (columnIndex == 0) { + return source.getUnsignedAppletAction(); + } + if (columnIndex == 1) { + return source.getTimeStamp(); + } + if (columnIndex == 2) { + return source.getDocumentBase(); + } + if (columnIndex == 3) { + return source.getCodeBase(); + } + if (columnIndex == 4) { + return UnsignedAppletActionEntry.createArchivesString(source.getArchives()); + } + return null; + } + + @Override + public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex) { + final UnsignedAppletActionEntry source = back.toArray()[rowIndex]; + back.modify(source, columnIndex, aValue); + + } + + public void addRow() { + int i = getRowCount()-1; + String s = "\\Qhttp://localhost:80/\\E.*"; + back.add(new UnsignedAppletActionEntry( + ExecuteUnsignedApplet.NEVER, + new Date(), + new UrlRegEx(s), + new UrlRegEx(s), + null)); + fireTableRowsInserted(i+1, i+1); + } + + public void removeRow(int i) { + int ii = getRowCount()-1; + if (ii<0){ + return; + } + if (i<0){ + return; + } + back.remove(i); + fireTableRowsDeleted(i, i); + } + + public void clear() { + int i = getRowCount()-1; + if (i<0){ + return; + } + back.clear(); + fireTableRowsDeleted(0, i); + } + + void removeByBehaviour(ExecuteUnsignedApplet unsignedAppletAction) { + int i = getRowCount()-1; + if (i<0){ + return; + } + back.removeByBehaviour(unsignedAppletAction); + fireTableRowsDeleted(0, i); + } + + int moveUp(int selectedRow) { + int i = getRowCount()-1; + if (i<0){ + return selectedRow; + } + int x = back.moveUp(selectedRow); + fireTableChanged(new TableModelEvent(this, 0, i)); + return x; + } + + int moveDown(int selectedRow) { + int i = getRowCount()-1; + if (i<0){ + return selectedRow; + } + int x = back.moveDown(selectedRow); + fireTableChanged(new TableModelEvent(this, 0, i)); + return x; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java 2013-05-03 19:08:24.240520246 +0000 @@ -0,0 +1,973 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.controlpanel; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.text.DateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.regex.Pattern; +import javax.swing.DefaultCellEditor; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.RowFilter; +import javax.swing.RowFilter.Entry; +import javax.swing.RowSorter.SortKey; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; +import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.runtime.Translator; +import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; +import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteUnsignedApplet; +import net.sourceforge.jnlp.security.appletextendedsecurity.ExtendedAppletSecurityHelp; +import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; +import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx; +import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageExtendedImpl; +import net.sourceforge.jnlp.util.ScreenFinder; + +public class UnsignedAppletsTrustingListPanel extends javax.swing.JPanel { + + private javax.swing.JButton helpButton; + private javax.swing.JButton deleteButton; + private javax.swing.JButton addRowButton; + private javax.swing.JButton validateTableButton; + private javax.swing.JButton testUrlButton; + private javax.swing.JButton invertSelectionButton; + private javax.swing.JButton moveRowUpButton; + private javax.swing.JButton moveRowDownButton; + private javax.swing.JCheckBox askBeforeActionCheckBox; + private javax.swing.JCheckBox filterRegexesCheckBox; + private javax.swing.JComboBox mainPolicyComboBox; + private javax.swing.JComboBox deleteTypeComboBox; + private javax.swing.JComboBox viewFilter; + private javax.swing.JLabel globalBehaviourLabel; + private javax.swing.JLabel securityLevelLabel; + private javax.swing.JScrollPane userTableScrollPane; + private javax.swing.JTabbedPane mainTabPanel; + private javax.swing.JTable userTable; + private javax.swing.JScrollPane globalTableScrollPane; + private javax.swing.JTable globalTable; + private final UnsignedAppletActionStorageExtendedImpl customBackEnd; + private final UnsignedAppletActionStorageExtendedImpl globalBackEnd; + private final UnsignedAppletActionTableModel customModel; + private final UnsignedAppletActionTableModel globalModel; + private final ByPermanencyFilter customFilter; + private final ByPermanencyFilter globalFilter; + private final DeploymentConfiguration conf; + private javax.swing.JTable currentTable; + private UnsignedAppletActionTableModel currentModel; + private String lastDoc; + private String lastCode; + private final UnsignedAppletsTrustingListPanel self; + + + /* + * for testing and playing + */ + public static void main(String args[]) { + final String defaultDir = System.getProperty("user.home") + "/Desktop/"; + final String defaultFileName1 = "terrorList1"; + final String defaultFileName2 = "terrorList2"; + final String defaultFile1 = defaultDir + defaultFileName1; + final String defaultFile2 = defaultDir + defaultFileName2; + java.awt.EventQueue.invokeLater(new Runnable() { + @Override + public void run() { + try { + JFrame f = new JFrame(); + f.setSize(700, 300); + f.setLayout(new BorderLayout()); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + DeploymentConfiguration cc = new DeploymentConfiguration(); + cc.load(); + File ff1 = new File(defaultFile1); + File ff2 = new File(defaultFile2); + f.add(new UnsignedAppletsTrustingListPanel(ff2, ff1, cc)); + f.setVisible(true); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }); + } + + public UnsignedAppletsTrustingListPanel(File globalSettings, File customSettings, DeploymentConfiguration conf) { + self = this; + customBackEnd = new UnsignedAppletActionStorageExtendedImpl(customSettings); + globalBackEnd = new UnsignedAppletActionStorageExtendedImpl(globalSettings); + customModel = new UnsignedAppletActionTableModel(customBackEnd); + globalModel = new UnsignedAppletActionTableModel(globalBackEnd); + customFilter = new ByPermanencyFilter(customModel); + globalFilter = new ByPermanencyFilter(globalModel); + initComponents(); + userTable.setRowSorter(customFilter); + globalTable.setRowSorter(globalFilter); + this.conf = conf; + AppletSecurityLevel gs = AppletSecurityLevel.getDefault(); + String s = conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); + if (s != null) { + gs = AppletSecurityLevel.fromString(s); + } + mainPolicyComboBox.setSelectedItem(gs); + userTable.getSelectionModel().addListSelectionListener(new SingleSelectionListenerImpl(userTable)); + globalTable.getSelectionModel().addListSelectionListener(new SingleSelectionListenerImpl(globalTable)); + + userTable.addKeyListener(new DeleteAdapter(userTable)); + globalTable.addKeyListener(new DeleteAdapter(globalTable)); + currentTable = userTable; + currentModel = customModel; + setButtons((!currentModel.back.isReadOnly())); + } + + public String appletItemsToCaption(List ii, String caption) { + StringBuilder sb = new StringBuilder(); + for (UnsignedAppletActionEntry i : ii) { + sb.append(appletItemToCaption(i, caption)).append("\n"); + } + return sb.toString(); + } + + public static String appletItemToCaption(UnsignedAppletActionEntry i, String caption) { + return Translator.R("APPEXTSECguiPanelAppletInfoHederPart1", caption, i.getDocumentBase().getFilteredRegEx()) + + "\n (" + Translator.R("APPEXTSECguiPanelAppletInfoHederPart2", i.getUnsignedAppletAction(), DateFormat.getInstance().format(i.getTimeStamp())) + + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase") + ": " + i.getDocumentBase().getFilteredRegEx() + + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnCodeBase") + ": " + i.getCodeBase().getFilteredRegEx() + + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnArchives") + ": " + UnsignedAppletActionEntry.createArchivesString(i.getArchives()); + } + + public void removeSelectedFromTable(JTable table) { + removeSelectedFromTable(table, askBeforeActionCheckBox.isSelected(), currentModel, this); + } + + public static void removeSelectedFromTable(JTable table, boolean ask, UnsignedAppletActionTableModel data, Component forDialog) { + int[] originalIndexes = table.getSelectedRows(); + List newIndexes = new ArrayList(originalIndexes.length); + for (int i = 0; i < originalIndexes.length; i++) { + //we need to remap values first + int modelRow = table.convertRowIndexToModel(originalIndexes[i]); + newIndexes.add(modelRow); + } + //now to sort so we can incrementaly dec safely + Collections.sort(newIndexes); + if (ask) { + String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", newIndexes.size()) + ": \n"; + UnsignedAppletActionEntry[] items = data.back.toArray(); + for (int i = 0; i < newIndexes.size(); i++) { + Integer integer = newIndexes.get(i); + s += appletItemToCaption(items[integer], " ") + "\n"; + } + int a = JOptionPane.showConfirmDialog(forDialog, s); + if (a != JOptionPane.OK_OPTION) { + return; + } + } + int sub = 0; + for (int i = 0; i < newIndexes.size(); i++) { + Integer integer = newIndexes.get(i); + data.removeRow(integer.intValue() + sub); + sub--; + } + } + + public void removeAllItemsFromTable(JTable table, UnsignedAppletActionTableModel model) { + table.clearSelection(); + + if (askBeforeActionCheckBox.isSelected()) { + UnsignedAppletActionEntry[] items = model.back.toArray(); + String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", items.length) + ": \n"; + for (int i = 0; i < items.length; i++) { + s += appletItemToCaption(items[i], " ") + "\n"; + } + int a = JOptionPane.showConfirmDialog(this, s); + if (a != JOptionPane.OK_OPTION) { + return; + } + } + model.clear(); + } + + private void initComponents() { + + userTableScrollPane = new javax.swing.JScrollPane(); + globalTableScrollPane = new javax.swing.JScrollPane(); + userTable = createTbale(customModel); + globalTable = createTbale(globalModel); + helpButton = new javax.swing.JButton(); + mainPolicyComboBox = new JComboBox(new AppletSecurityLevel[]{ + AppletSecurityLevel.DENY_ALL, + AppletSecurityLevel.DENY_UNSIGNED, + AppletSecurityLevel.ASK_UNSIGNED, + AppletSecurityLevel.ALLOW_UNSIGNED + }); + mainPolicyComboBox.setSelectedItem(AppletSecurityLevel.getDefault()); + securityLevelLabel = new javax.swing.JLabel(); + globalBehaviourLabel = new javax.swing.JLabel(); + deleteTypeComboBox = new javax.swing.JComboBox(); + viewFilter = new javax.swing.JComboBox(); + deleteButton = new javax.swing.JButton(); + testUrlButton = new javax.swing.JButton(); + addRowButton = new javax.swing.JButton(); + validateTableButton = new javax.swing.JButton(); + askBeforeActionCheckBox = new javax.swing.JCheckBox(); + filterRegexesCheckBox = new javax.swing.JCheckBox(); + invertSelectionButton = new javax.swing.JButton(); + moveRowUpButton = new javax.swing.JButton(); + moveRowDownButton = new javax.swing.JButton(); + mainTabPanel = new javax.swing.JTabbedPane(); + + userTableScrollPane.setViewportView(userTable); + + globalTableScrollPane.setViewportView(globalTable); + + helpButton.setText(Translator.R("APPEXTSECguiPanelHelpButton")); + helpButton.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + helpButtonActionPerformed(evt); + } + }); + + mainPolicyComboBox.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + mainPolicyComboBoxActionPerformed(evt); + } + }); + + viewFilter.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + userTable.getRowSorter().setSortKeys(null); + userTable.getRowSorter().setSortKeys(null); + int i = viewFilter.getSelectedIndex(); + switch (i) { + case 0: + customFilter.setRowFilter(ByPermanencyFilter.showPermanents); + globalFilter.setRowFilter(ByPermanencyFilter.showPermanents); + break; + case 1: + customFilter.setRowFilter(ByPermanencyFilter.showTemporarilyDecisions); + globalFilter.setRowFilter(ByPermanencyFilter.showTemporarilyDecisions); + break; + case 2: + customFilter.setRowFilter(ByPermanencyFilter.showAll); + globalFilter.setRowFilter(ByPermanencyFilter.showAll); + break; + case 3: + customFilter.setRowFilter(ByPermanencyFilter.showPermanentA); + globalFilter.setRowFilter(ByPermanencyFilter.showPermanentA); + break; + case 4: + customFilter.setRowFilter(ByPermanencyFilter.showPermanentN); + globalFilter.setRowFilter(ByPermanencyFilter.showPermanentN); + break; + case 5: + customFilter.setRowFilter(ByPermanencyFilter.showHasChosenYes); + globalFilter.setRowFilter(ByPermanencyFilter.showHasChosenYes); + break; + case 6: + customFilter.setRowFilter(ByPermanencyFilter.showHasChosenNo); + globalFilter.setRowFilter(ByPermanencyFilter.showHasChosenNo); + break; + } + + } + }); + + + securityLevelLabel.setText(Translator.R("APPEXTSECguiPanelSecurityLevel")); + + globalBehaviourLabel.setText(Translator.R("APPEXTSECguiPanelGlobalBehaviourCaption")); + + deleteTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[]{ + Translator.R("APPEXTSECguiPanelDeleteMenuSelected"), + Translator.R("APPEXTSECguiPanelDeleteMenuAllA"), + Translator.R("APPEXTSECguiPanelDeleteMenuAllN"), + Translator.R("APPEXTSECguiPanelDeleteMenuAlly"), + Translator.R("APPEXTSECguiPanelDeleteMenuAlln"), + Translator.R("APPEXTSECguiPanelDeleteMenuAllAll")})); + + viewFilter.setModel(new javax.swing.DefaultComboBoxModel(new String[]{ + Translator.R("APPEXTSECguiPanelShowOnlyPermanent"), + Translator.R("APPEXTSECguiPanelShowOnlyTemporal"), + Translator.R("APPEXTSECguiPanelShowAll"), + Translator.R("APPEXTSECguiPanelShowOnlyPermanentA"), + Translator.R("APPEXTSECguiPanelShowOnlyPermanentN"), + Translator.R("APPEXTSECguiPanelShowOnlyTemporalY"), + Translator.R("APPEXTSECguiPanelShowOnlyTemporalN")})); + + deleteButton.setText(Translator.R("APPEXTSECguiPanelDeleteButton")); + deleteButton.setToolTipText(Translator.R("APPEXTSECguiPanelDeleteButtonToolTip")); + deleteButton.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + deleteButtonActionPerformed(evt); + } + }); + + testUrlButton.setText(Translator.R("APPEXTSECguiPanelTestUrlButton")); + testUrlButton.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + testUrlButtonActionPerformed(evt); + } + }); + + addRowButton.setText(Translator.R("APPEXTSECguiPanelAddRowButton")); + addRowButton.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + addRowButtonActionPerformed(evt); + } + }); + + validateTableButton.setText(Translator.R("APPEXTSECguiPanelValidateTableButton")); + validateTableButton.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + validateTableButtonActionPerformed(evt); + } + }); + + askBeforeActionCheckBox.setSelected(true); + askBeforeActionCheckBox.setText(Translator.R("APPEXTSECguiPanelAskeforeActionBox")); + + filterRegexesCheckBox.setText(Translator.R("APPEXTSECguiPanelShowRegExesBox")); + filterRegexesCheckBox.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + filterRegexesCheckBoxActionPerformed(evt); + } + }); + + invertSelectionButton.setText(Translator.R("APPEXTSECguiPanelInverSelection")); + invertSelectionButton.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + invertSelectionButtonActionPerformed(evt); + } + }); + + moveRowUpButton.setText(Translator.R("APPEXTSECguiPanelMoveRowUp")); + moveRowUpButton.setEnabled(false); + moveRowUpButton.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + moveRowUpButtonActionPerformed(evt); + } + }); + + moveRowDownButton.setText(Translator.R("APPEXTSECguiPanelMoveRowDown")); + moveRowDownButton.setEnabled(false); + moveRowDownButton.addActionListener(new java.awt.event.ActionListener() { + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + moveRowDownButtonActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(mainTabPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 583, Short.MAX_VALUE) + .addComponent(globalBehaviourLabel, javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addComponent(securityLevelLabel).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(mainPolicyComboBox, 0, 474, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addComponent(addRowButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(validateTableButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(testUrlButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE) + .addComponent(moveRowDownButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(moveRowUpButton)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(deleteButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deleteTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(invertSelectionButton)) + .addGroup(layout.createSequentialGroup() + .addComponent(askBeforeActionCheckBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(filterRegexesCheckBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 93, Short.MAX_VALUE) + .addComponent(viewFilter))).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(helpButton, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE))).addContainerGap())); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup().addContainerGap() + .addComponent(globalBehaviourLabel).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(securityLevelLabel) + .addComponent(mainPolicyComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(deleteButton) + .addComponent(deleteTypeComboBox) + .addComponent(invertSelectionButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(askBeforeActionCheckBox) + .addComponent(filterRegexesCheckBox) + .addComponent(viewFilter))) + .addComponent(helpButton, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(mainTabPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(addRowButton) + .addComponent(validateTableButton) + .addComponent(testUrlButton) + .addComponent(moveRowUpButton) + .addComponent(moveRowDownButton)).addContainerGap())); + + JPanel userPanel = new JPanel(new BorderLayout()); + JPanel globalPanel = new JPanel(new BorderLayout()); + userPanel.add(userTableScrollPane); + globalPanel.add(globalTableScrollPane); + mainTabPanel.add(userPanel); + mainTabPanel.add(globalPanel); + mainTabPanel.setTitleAt(0, Translator.R("APPEXTSECguiPanelCustomDefs")); + mainTabPanel.setTitleAt(1, Translator.R("APPEXTSECguiPanelGlobalDefs")); + mainTabPanel.setToolTipTextAt(0, DeploymentConfiguration.getAppletTrustUserSettingsPath().getAbsolutePath()); + mainTabPanel.setToolTipTextAt(1, DeploymentConfiguration.getAppletTrustGlobalSettingsPath().getAbsolutePath()); + mainTabPanel.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + switch (mainTabPanel.getSelectedIndex()) { + case 0: + currentModel = customModel; + currentTable = userTable; + break; + case 1: + currentModel = globalModel; + currentTable = globalTable; + break; + } + setButtons((!currentModel.back.isReadOnly())); + } + }); + } + + private void mainPolicyComboBoxActionPerformed(java.awt.event.ActionEvent evt) { + try { + conf.setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, ((AppletSecurityLevel) mainPolicyComboBox.getSelectedItem()).toChars()); + conf.save(); + } catch (Exception ex) { + ex.printStackTrace(); + JOptionPane.showMessageDialog(this, ex); + } + } + + private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) { + + if (deleteTypeComboBox.getSelectedIndex() == 0) { + removeSelectedFromTable(currentTable); + } + if (deleteTypeComboBox.getSelectedIndex() == 1) { + removeByBehaviour(ExecuteUnsignedApplet.ALWAYS); + } + if (deleteTypeComboBox.getSelectedIndex() == 2) { + removeByBehaviour(ExecuteUnsignedApplet.NEVER); + } + if (deleteTypeComboBox.getSelectedIndex() == 3) { + removeByBehaviour(ExecuteUnsignedApplet.YES); + } + if (deleteTypeComboBox.getSelectedIndex() == 4) { + removeByBehaviour(ExecuteUnsignedApplet.NO); + } + if (deleteTypeComboBox.getSelectedIndex() == 5) { + removeAllItemsFromTable(currentTable, customModel); + } + } + + private void testUrlButtonActionPerformed(java.awt.event.ActionEvent evt) { + + String s1 = JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelDocTest"), lastDoc); + String s2 = JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelCodeTest"), lastCode); + lastDoc = s1; + lastCode = s2; + try { + List i = currentModel.back.getMatchingItems(s1, s2, null); + if (i == null || i.isEmpty()) { + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelNoMatch")); + } else { + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelMatchingNote") + "\n" + appletItemsToCaption(i, Translator.R("APPEXTSECguiPanelMatched") + ": ")); + } + } catch (Exception ex) { + ex.printStackTrace(); + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelMatchingError", ex)); + } + + } + + private void addRowButtonActionPerformed(java.awt.event.ActionEvent evt) { + + currentModel.addRow(); + } + + private void validateTableButtonActionPerformed(java.awt.event.ActionEvent evt) { + + File f = null; + try { + f = File.createTempFile("appletTable", "validation"); + } catch (Exception ex) { + ex.printStackTrace(); + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelCanNOtValidate", ex.toString())); + return; + } + try { + currentModel.back.writeContentsLocked(); + BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), "UTF-8")); + currentModel.back.writeContent(bw); + bw.flush(); + bw.close(); + UnsignedAppletActionStorageExtendedImpl copy = new UnsignedAppletActionStorageExtendedImpl(f); + UnsignedAppletActionEntry[] items = copy.toArray(); + for (int i = 0; i < items.length; i++) { + UnsignedAppletActionEntry unsignedAppletActionEntry = items[i]; + if (unsignedAppletActionEntry.getDocumentBase() != null && !unsignedAppletActionEntry.getDocumentBase().getRegEx().trim().isEmpty()) { + Pattern p = Pattern.compile(unsignedAppletActionEntry.getDocumentBase().getRegEx()); + p.matcher("someInput").find(); + } else { + throw new RuntimeException(Translator.R("APPEXTSECguiPanelEmptyDoc")); + } + if (unsignedAppletActionEntry.getCodeBase() != null && !unsignedAppletActionEntry.getCodeBase().getRegEx().trim().isEmpty()) { + Pattern p = Pattern.compile(unsignedAppletActionEntry.getCodeBase().getRegEx()); + p.matcher("someInput").find(); + } else { + throw new RuntimeException(Translator.R("APPEXTSECguiPanelEmptyCode")); + } + UnsignedAppletActionEntry.createArchivesString(UnsignedAppletActionEntry.createArchivesList(UnsignedAppletActionEntry.createArchivesString(unsignedAppletActionEntry.getArchives()))); + + } + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelTableValid")); + } catch (Exception ex) { + ex.printStackTrace(); + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelTableInvalid ", ex.toString())); + } finally { + f.delete(); + } + + } + + private void filterRegexesCheckBoxActionPerformed(java.awt.event.ActionEvent evt) { + + reloadTable(); + } + + private void invertSelectionButtonActionPerformed(java.awt.event.ActionEvent evt) { + int[] selectedIndexs = currentTable.getSelectedRows(); + currentTable.selectAll(); + + for (int i = 0; i < currentTable.getRowCount(); i++) { + for (int selectedIndex : selectedIndexs) { + if (selectedIndex == i) { + currentTable.removeRowSelectionInterval(i, i); + break; + } + } + } + } + + private void moveRowUpButtonActionPerformed(java.awt.event.ActionEvent evt) { + int orig = currentTable.getSelectedRow(); + if (orig < 0 || orig >= currentTable.getRowCount()) { + return; + } + int nw = 0; + while (true) { + int i = currentTable.convertRowIndexToModel(orig); + int nwx = currentModel.moveUp(i); + reloadTable(); + nw = currentTable.convertRowIndexToView(nwx); + if (i == nwx) { + break; + } + if (nw != orig) { + break; + } + } + //System.out.println(+orig+" "+i+" "+nwx+" "+nw+" "); + if (nw != orig) { + if (orig >= 1) { + currentTable.getSelectionModel().setSelectionInterval(orig - 1, orig - 1); + } + } else { + currentTable.getSelectionModel().setSelectionInterval(orig, orig); + } + } + + private void moveRowDownButtonActionPerformed(java.awt.event.ActionEvent evt) { + int orig = currentTable.getSelectedRow(); + if (orig < 0 || orig >= currentTable.getRowCount()) { + return; + } + int nw = 0; + while (true) { + int i = currentTable.convertRowIndexToModel(orig); + int nwx = currentModel.moveDown(i); + reloadTable(); + nw = currentTable.convertRowIndexToView(nwx); + if (i == nwx) { + break; + } + if (nw != orig) { + break; + } + } + // System.out.println(+orig+" "+i+" "+nwx+" "+nw+" "); + if (nw != orig) { + if (orig < currentModel.getRowCount()) { + currentTable.getSelectionModel().setSelectionInterval(orig + 1, orig + 1); + } + } else { + currentTable.getSelectionModel().setSelectionInterval(orig, orig); + } + } + + private void helpButtonActionPerformed(java.awt.event.ActionEvent evt) { + JDialog d = new ExtendedAppletSecurityHelp(null, false); + ScreenFinder.centerWindowsToCurrentScreen(d); + d.setVisible(true); + } + + private void setButtons(boolean b) { + deleteButton.setEnabled(b); + addRowButton.setEnabled(b); + invertSelectionButton.setEnabled(b); + moveRowUpButton.setEnabled(b); + moveRowDownButton.setEnabled(b); + } + + private JTable createTbale(final TableModel model) { + JTable jt = new JTable() { + @Override + public TableCellEditor getCellEditor(int row, int column) { + int columnx = convertColumnIndexToModel(column); + if (columnx == 0) { + return new DefaultCellEditor(new JComboBox(new ExecuteUnsignedApplet[]{ExecuteUnsignedApplet.ALWAYS, ExecuteUnsignedApplet.NEVER, ExecuteUnsignedApplet.YES, ExecuteUnsignedApplet.NO})); + } + if (columnx == 2) { + column = convertColumnIndexToModel(column); + row = convertRowIndexToModel(row); + return new DefaultCellEditor(new MyTextField((UrlRegEx) (model.getValueAt(row, column)))); + } + if (columnx == 3) { + column = convertColumnIndexToModel(column); + row = convertRowIndexToModel(row); + return new DefaultCellEditor(new MyTextField((UrlRegEx) (model.getValueAt(row, column)))); + } + return super.getCellEditor(row, column); + } + + @Override + public TableCellRenderer getCellRenderer(int row, int column) { + int columnx = convertColumnIndexToModel(column); + if (columnx == 1) { + column = convertColumnIndexToModel(column); + row = convertRowIndexToModel(row); + return new UrlRegexCellRenderer.MyDateCellRenderer((Date) (model.getValueAt(row, column))); + } + if (columnx == 2) { + if (!filterRegexesCheckBox.isSelected()) { + column = convertColumnIndexToModel(column); + row = convertRowIndexToModel(row); + return new UrlRegexCellRenderer((UrlRegEx) (model.getValueAt(row, column))); + } + } + if (columnx == 3) { + if (!filterRegexesCheckBox.isSelected()) { + column = convertColumnIndexToModel(column); + row = convertRowIndexToModel(row); + return new UrlRegexCellRenderer((UrlRegEx) (model.getValueAt(row, column))); + } + } + return super.getCellRenderer(row, column); + } + }; + jt.setRowHeight(jt.getRowHeight() + jt.getRowHeight() / 2); + jt.setModel(model); + return jt; + + } + + private void reloadTable() { + List l = currentTable.getRowSorter().getSortKeys(); + currentTable.setModel(new DefaultTableModel()); + currentTable.setModel(currentModel); + { + currentTable.getRowSorter().setSortKeys(l); + + } + + } + + private void removeByBehaviour(ExecuteUnsignedApplet unsignedAppletAction) { + UnsignedAppletActionEntry[] items = currentModel.back.toArray(); + if (askBeforeActionCheckBox.isSelected()) { + List toBeDeleted = new ArrayList(); + for (int i = 0; i < items.length; i++) { + UnsignedAppletActionEntry unsignedAppletActionEntry = items[i]; + if (unsignedAppletActionEntry.getUnsignedAppletAction() == unsignedAppletAction) { + toBeDeleted.add(unsignedAppletActionEntry); + } + + } + String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", toBeDeleted.size()) + ": \n"; + for (int i = 0; i < toBeDeleted.size(); i++) { + s += appletItemToCaption(toBeDeleted.get(i), " ") + "\n"; + } + int a = JOptionPane.showConfirmDialog(this, s); + if (a != JOptionPane.OK_OPTION) { + return; + } + } + currentModel.removeByBehaviour(unsignedAppletAction); + } + + public static final class MyTextField extends JTextField { + + private final UrlRegEx keeper; + + private MyTextField(UrlRegEx urlRegEx) { + if (urlRegEx == null) { + keeper = new UrlRegEx(""); + } else { + this.keeper = urlRegEx; + } + setText(keeper.getFilteredRegEx()); + } + + @Override + public void setText(String t) { + super.setText(keeper.getRegEx()); + } + } + + public static final class UrlRegexCellRenderer extends DefaultTableCellRenderer { + + private final UrlRegEx keeper; + + private UrlRegexCellRenderer(UrlRegEx urlRegEx) { + if (urlRegEx == null) { + keeper = new UrlRegEx(""); + } else { + this.keeper = urlRegEx; + } + setText(keeper.getFilteredRegEx()); + } + + @Override + public void setText(String t) { + if (keeper == null) { + super.setText(""); + } else { + super.setText(keeper.getFilteredRegEx()); + } + } + + public static final class MyDateCellRenderer extends DefaultTableCellRenderer { + + private final Date keeper; + + private MyDateCellRenderer(Date d) { + this.keeper = d; + setText(DateFormat.getInstance().format(d)); + } + + @Override + public void setText(String t) { + if (keeper == null) { + super.setText(""); + } else { + super.setText(DateFormat.getInstance().format(keeper)); + } + } + } + } + + private final class SingleSelectionListenerImpl implements ListSelectionListener { + + private final JTable table; + + public SingleSelectionListenerImpl(JTable table) { + this.table = table; + } + + @Override + public void valueChanged(ListSelectionEvent e) { + if (table.getSelectedRows().length == 1 && !currentModel.back.isReadOnly()) { + moveRowUpButton.setEnabled(true); + moveRowDownButton.setEnabled(true); + } else { + moveRowUpButton.setEnabled(false); + moveRowDownButton.setEnabled(false); + } + } + } + + private final class DeleteAdapter implements KeyListener { + + private final JTable table; + + public DeleteAdapter(JTable table) { + this.table = table; + } + + @Override + public void keyTyped(KeyEvent e) { + } + + @Override + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_DELETE && !currentModel.back.isReadOnly()) { + removeSelectedFromTable(table, askBeforeActionCheckBox.isSelected(), (UnsignedAppletActionTableModel) table.getModel(), self); + } + } + + @Override + public void keyReleased(KeyEvent e) { + } + } + + private abstract static class MyCommonSorter extends RowFilter { + + + } + private static final class ByPermanencyFilter extends TableRowSorter { + + private static final class ShowAll extends MyCommonSorter { + + @Override + public boolean include(Entry entry) { + return true; + } + } + + private static final class ShowPermanents extends MyCommonSorter { + + @Override + public boolean include(Entry entry) { + ExecuteUnsignedApplet o = (ExecuteUnsignedApplet) entry.getModel().getValueAt(entry.getIdentifier(), 0); + return (o.equals(ExecuteUnsignedApplet.ALWAYS) || o.equals(ExecuteUnsignedApplet.NEVER)); + } + } + + private static final class ShowPermanentA extends MyCommonSorter { + @Override + public boolean include(Entry entry) { + ExecuteUnsignedApplet o = (ExecuteUnsignedApplet) entry.getModel().getValueAt(entry.getIdentifier(), 0); + return (o.equals(ExecuteUnsignedApplet.ALWAYS)); + } + } + + private static final class ShowPermanentN extends MyCommonSorter { + + @Override + public boolean include(Entry entry) { + ExecuteUnsignedApplet o = (ExecuteUnsignedApplet) entry.getModel().getValueAt(entry.getIdentifier(), 0); + return (o.equals(ExecuteUnsignedApplet.NEVER)); + } + } + + private static final class ShowTemporarilyDecisions extends MyCommonSorter { + + @Override + public boolean include(Entry entry) { + ExecuteUnsignedApplet o = (ExecuteUnsignedApplet) entry.getModel().getValueAt(entry.getIdentifier(), 0); + return (o.equals(ExecuteUnsignedApplet.YES) || o.equals(ExecuteUnsignedApplet.NO)); + } + } + + private static final class ShowHasChosenYes extends MyCommonSorter { + + @Override + public boolean include(Entry entry) { + ExecuteUnsignedApplet o = (ExecuteUnsignedApplet) entry.getModel().getValueAt(entry.getIdentifier(), 0); + return (o.equals(ExecuteUnsignedApplet.YES)); + } + + + } + + private static final class ShowHasChosenNo extends MyCommonSorter { + + @Override + public boolean include(Entry entry) { + ExecuteUnsignedApplet o = (ExecuteUnsignedApplet) entry.getModel().getValueAt(entry.getIdentifier(), 0); + return (o.equals(ExecuteUnsignedApplet.NO)); + } + + } + public static final ShowAll showAll = new ShowAll(); + public static final ShowPermanents showPermanents = new ShowPermanents(); + public static final ShowPermanentA showPermanentA = new ShowPermanentA(); + public static final ShowPermanentN showPermanentN = new ShowPermanentN(); + public static final ShowTemporarilyDecisions showTemporarilyDecisions = new ShowTemporarilyDecisions(); + public static final ShowHasChosenYes showHasChosenYes = new ShowHasChosenYes(); + public static final ShowHasChosenNo showHasChosenNo = new ShowHasChosenNo(); + + public ByPermanencyFilter(UnsignedAppletActionTableModel model) { + super(model); + setRowFilter(showPermanents); + } + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/GuiLaunchHandler.java icedtea-web-1.4/netx/net/sourceforge/jnlp/GuiLaunchHandler.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/GuiLaunchHandler.java 2013-04-10 11:40:23.848668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/GuiLaunchHandler.java 2013-05-03 19:08:24.202520725 +0000 @@ -1,5 +1,5 @@ /* GuiLaunchHandler.java - Copyright (C) 2011 Red Hat, Inc. + Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. @@ -54,7 +54,7 @@ */ public class GuiLaunchHandler extends AbstractLaunchHandler { - private JNLPSplashScreen splashScreen = null; + private volatile JNLPSplashScreen splashScreen = null; private final Object mutex = new Object(); private UpdatePolicy policy = UpdatePolicy.ALWAYS; @@ -80,10 +80,11 @@ } private void closeSplashScreen() { - synchronized(mutex) { + synchronized (mutex) { if (splashScreen != null) { if (splashScreen.isSplashScreenValid()) { splashScreen.setVisible(false); + splashScreen.stopAnimation(); } splashScreen.dispose(); } @@ -102,40 +103,56 @@ @Override public void launchInitialized(final JNLPFile file) { - + int preferredWidth = 500; int preferredHeight = 400; final URL splashImageURL = file.getInformation().getIconLocation( IconDesc.SPLASH, preferredWidth, preferredHeight); + final ResourceTracker resourceTracker = new ResourceTracker(true); if (splashImageURL != null) { - final ResourceTracker resourceTracker = new ResourceTracker(true); resourceTracker.addResource(splashImageURL, file.getFileVersion(), null, policy); - synchronized(mutex) { - try { - SwingUtilities.invokeAndWait(new Runnable() { - @Override - public void run() { - splashScreen = new JNLPSplashScreen(resourceTracker, null, null); - } - }); - } catch (InterruptedException ie) { - // Wait till splash screen is created - while (splashScreen == null); - } catch (InvocationTargetException ite) { - ite.printStackTrace(); - } + } + synchronized (mutex) { + try { + SwingUtilities.invokeAndWait(new Runnable() { + + @Override + public void run() { + splashScreen = new JNLPSplashScreen(resourceTracker, file); + } + }); + } catch (InterruptedException ie) { + // Wait till splash screen is created + while (splashScreen == null); + } catch (InvocationTargetException ite) { + ite.printStackTrace(); + } + try { + SwingUtilities.invokeAndWait(new Runnable() { - splashScreen.setSplashImageURL(splashImageURL); + @Override + public void run() { + splashScreen.setSplashImageURL(splashImageURL); + } + }); + } catch (InterruptedException ie) { + // Wait till splash screen is created + while (!splashScreen.isSplashImageLoaded()); + } catch (InvocationTargetException ite) { + ite.printStackTrace(); } + + } - + SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { - if (splashImageURL != null) { - synchronized(mutex) { + if (splashScreen != null) { + synchronized (mutex) { if (splashScreen.isSplashScreenValid()) { splashScreen.setVisible(true); } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/InformationDesc.java icedtea-web-1.4/netx/net/sourceforge/jnlp/InformationDesc.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/InformationDesc.java 2013-04-10 11:40:23.849668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/InformationDesc.java 2013-05-03 19:08:24.203520713 +0000 @@ -34,7 +34,8 @@ // specification name. /** one-line description */ - public static final Object ONE_LINE = "oneline"; + /**http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html**/ + public static final Object ONE_LINE = "one-line"; /** short description */ public static final Object SHORT = "short"; @@ -110,13 +111,24 @@ * Information.TOOLTIP, Information.DEFAULT */ public String getDescription(Object kind) { - String result = (String) getItem("description-" + kind); + String result = getDescriptionStrict(kind); if (result == null) return (String) getItem("description-" + DEFAULT); else return result; } + /** + * Returns the application's description of the specified type. + * + * @param kind one of Information.SHORT, Information.ONE_LINE, + * Information.TOOLTIP, Information.DEFAULT + */ + public String getDescriptionStrict(Object kind) { + return (String) getItem("description-" + kind); + + } + /** * Returns the icons specified by the JNLP file. * diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/JNLPFile.java icedtea-web-1.4/netx/net/sourceforge/jnlp/JNLPFile.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/JNLPFile.java 2013-04-10 11:40:23.850668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/JNLPFile.java 2013-05-03 19:08:24.205520688 +0000 @@ -251,7 +251,20 @@ * @throws ParseException if the JNLP file was invalid */ public JNLPFile(InputStream input, boolean strict) throws ParseException { - parse(Parser.getRootNode(input), strict, null, null); + this(input, null, strict); + } + + /** + * Create a JNLPFile from an input stream. + * + * @param input input stream of JNLP file. + * @param codebase codebase to use if not specified in JNLP file.. + * @param strict whether to enforce the spec rules + * @throws IOException if an IO exception occurred + * @throws ParseException if the JNLP file was invalid + */ + public JNLPFile(InputStream input, URL codebase, boolean strict) throws ParseException { + parse(Parser.getRootNode(input), strict, null, codebase); } /** @@ -780,7 +793,7 @@ * jars it finds through getResourcesDescs(). If ever the implementation * of that function should change to return copies of JARDescs objects, * then the "jar == aJar" comparison below should change accordingly. - * @param jar: the jar whose download options to get. + * @param jar the jar whose download options to get. * @return the download options. */ public DownloadOptions getDownloadOptionsForJar(JARDesc jar) { diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/JNLPMatcherException.java icedtea-web-1.4/netx/net/sourceforge/jnlp/JNLPMatcherException.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/JNLPMatcherException.java 2013-04-10 11:40:23.850668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/JNLPMatcherException.java 2013-05-03 19:08:24.206520675 +0000 @@ -1,3 +1,40 @@ +/* JNLPMatcherException.java + Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + package net.sourceforge.jnlp; public class JNLPMatcherException extends Exception diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/JNLPSplashScreen.java icedtea-web-1.4/netx/net/sourceforge/jnlp/JNLPSplashScreen.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/JNLPSplashScreen.java 2013-04-10 11:40:23.851668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/JNLPSplashScreen.java 2013-05-03 19:08:24.206520675 +0000 @@ -1,33 +1,75 @@ +/* JNLPSplashScreen.java + Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + package net.sourceforge.jnlp; +import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Insets; -import java.awt.Toolkit; +import java.awt.Rectangle; import java.io.IOException; import java.net.URL; - import javax.imageio.ImageIO; import javax.swing.JDialog; - import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.splashscreen.SplashPanel; +import net.sourceforge.jnlp.splashscreen.SplashUtils; +import net.sourceforge.jnlp.splashscreen.parts.InformationElement; import net.sourceforge.jnlp.util.ImageResources; +import net.sourceforge.jnlp.util.ScreenFinder; public class JNLPSplashScreen extends JDialog { - String applicationTitle; - String applicationVendor; ResourceTracker resourceTracker; URL splashImageUrl; Image splashImage; + private final JNLPFile file; + public static final int DEF_WIDTH=635; + public static final int DEF_HEIGHT=480; + private SplashPanel componetSplash; + private boolean splashImageLoaded=false; - public JNLPSplashScreen(ResourceTracker resourceTracker, - String applicationTitle, String applicationVendor) { + public JNLPSplashScreen(ResourceTracker resourceTracker, final JNLPFile file) { setIconImages(ImageResources.INSTANCE.getApplicationImages()); @@ -36,61 +78,82 @@ // JNLP file. this.resourceTracker = resourceTracker; - this.applicationTitle = applicationTitle; - this.applicationVendor = applicationVendor; + this.file=file; } public void setSplashImageURL(URL url) { - splashImageUrl = url; - splashImage = null; + splashImageLoaded = false; try { - splashImage = ImageIO.read(resourceTracker - .getCacheFile(splashImageUrl)); - if (splashImage == null) { - if (JNLPRuntime.isDebug()) { - System.err.println("Error loading splash image: " + url); + if (url != null) { + splashImageUrl = url; + splashImage = null; + try { + splashImage = ImageIO.read(resourceTracker.getCacheFile(splashImageUrl)); + if (splashImage == null) { + if (JNLPRuntime.isDebug()) { + System.err.println("Error loading splash image: " + url); + } + } + } catch (IOException e) { + if (JNLPRuntime.isDebug()) { + System.err.println("Error loading splash image: " + url); + } + splashImage = null; + } catch (IllegalArgumentException argumentException) { + if (JNLPRuntime.isDebug()) { + System.err.println("Error loading splash image: " + url); + } + splashImage = null; } - return; } - } catch (IOException e) { - if (JNLPRuntime.isDebug()) { - System.err.println("Error loading splash image: " + url); - } - splashImage = null; - return; - } catch (IllegalArgumentException argumentException) { - if (JNLPRuntime.isDebug()) { - System.err.println("Error loading splash image: " + url); + + if (splashImage == null) { + this.setLayout(new BorderLayout()); + SplashPanel splash = SplashUtils.getSplashScreen(DEF_WIDTH, DEF_HEIGHT); + if (splash != null) { + splash.startAnimation(); + splash.setInformationElement(InformationElement.createFromJNLP(file)); + this.add(splash.getSplashComponent()); + this.componetSplash = splash; + } } - splashImage = null; - return; + correctSize(); + } finally { + splashImageLoaded = true; } + } - correctSize(); + public boolean isSplashImageLoaded() { + return splashImageLoaded; } + public boolean isSplashScreenValid() { - return (splashImage != null); + return (splashImage != null) || (componetSplash != null); } private void correctSize() { - - Insets insets = getInsets(); - int minimumWidth = splashImage.getWidth(null) + insets.left - + insets.right; - int minimumHeight = splashImage.getHeight(null) + insets.top - + insets.bottom; - setMinimumSize(new Dimension(minimumWidth, minimumHeight)); - - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - setLocation((screenSize.width - minimumWidth) / 2, - (screenSize.height - minimumHeight) / 2); + int minimumWidth = DEF_WIDTH; + int minimumHeight = DEF_HEIGHT; + if (splashImage != null) { + Insets insets = getInsets(); + minimumWidth = splashImage.getWidth(null) + insets.left + + insets.right; + minimumHeight = splashImage.getHeight(null) + insets.top + + insets.bottom; + } + setMinimumSize(new Dimension(0, 0)); + setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)); + setSize(new Dimension(minimumWidth, minimumHeight)); + setPreferredSize(new Dimension(minimumWidth, minimumHeight)); + ScreenFinder.centerWindowsToCurrentScreen(this); } @Override public void paint(Graphics g) { if (splashImage == null) { + super.paint(g); return; } @@ -99,4 +162,12 @@ g2.drawImage(splashImage, getInsets().left, getInsets().top, null); } + + public boolean isCustomSplashscreen() { + return (componetSplash!=null); + } + + public void stopAnimation() { + if (isCustomSplashscreen()) componetSplash.stopAnimation(); + } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Launcher.java icedtea-web-1.4/netx/net/sourceforge/jnlp/Launcher.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Launcher.java 2013-04-10 14:30:03.340821000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/Launcher.java 2013-05-03 19:08:24.209520636 +0000 @@ -20,7 +20,11 @@ import java.applet.Applet; import java.awt.Container; +import java.awt.EventQueue; +import java.awt.SplashScreen; +import java.awt.Toolkit; import java.io.File; +import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.InetAddress; import java.net.URL; @@ -42,7 +46,10 @@ import javax.swing.SwingUtilities; import javax.swing.text.html.parser.ParserDelegator; +import net.sourceforge.jnlp.runtime.AppletEnvironment; +import net.sourceforge.jnlp.splashscreen.SplashUtils; +import sun.awt.AppContext; import sun.awt.SunToolkit; /** @@ -543,6 +550,12 @@ } if (JNLPRuntime.getForksAllowed() && file.needsNewVM()) { + if (!JNLPRuntime.isHeadless()){ + SplashScreen sp = SplashScreen.getSplashScreen(); + if (sp!=null) { + sp.close(); + } + } List netxArguments = new LinkedList(); netxArguments.add("-Xnofork"); netxArguments.addAll(JNLPRuntime.getInitialArguments()); @@ -652,25 +665,42 @@ * @param enableCodeBase whether to add the codebase URL to the classloader */ protected ApplicationInstance launchApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException { - if (!file.isApplet()) + if (!file.isApplet()) { throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplet"), R("LNotAppletInfo"))); - + } + + if (JNLPRuntime.getForksAllowed() && file.needsNewVM()) { + if (!JNLPRuntime.isHeadless()) { + SplashScreen sp = SplashScreen.getSplashScreen(); + if (sp != null) { + sp.close(); + } + } + } + if (handler != null) { + handler.launchInitialized(file); + } + + AppletInstance applet = null; try { ServiceUtil.checkExistingSingleInstance(file); - AppletInstance applet = createApplet(file, enableCodeBase, cont); + applet = createApplet(file, enableCodeBase, cont); applet.initialize(); - applet.getAppletEnvironment().startApplet(); // this should be a direct call to applet instance return applet; } catch (InstanceExistsException ieex) { if (JNLPRuntime.isDebug()) { System.out.println("Single instance applet is already running."); } - throw launchError(new LaunchException(file, ieex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LSingleInstanceExists"))); + throw launchError(new LaunchException(file, ieex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LSingleInstanceExists")), applet); } catch (LaunchException lex) { - throw launchError(lex); + throw launchError(lex, applet); } catch (Exception ex) { - throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo"))); + throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")), applet); + }finally{ + if (handler != null) { + handler.launchStarting(applet); + } } } @@ -678,13 +708,13 @@ * Gets an ApplicationInstance, but does not launch the applet. */ protected ApplicationInstance getApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException { - if (!file.isApplet()) + if (!file.isApplet()) { throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplet"), R("LNotAppletInfo"))); - + } + AppletInstance applet = null; try { ServiceUtil.checkExistingSingleInstance(file); - - AppletInstance applet = createApplet(file, enableCodeBase, cont); + applet = createApplet(file, enableCodeBase, cont); applet.initialize(); return applet; @@ -692,11 +722,11 @@ if (JNLPRuntime.isDebug()) { System.out.println("Single instance applet is already running."); } - throw launchError(new LaunchException(file, ieex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LSingleInstanceExists"))); + throw launchError(new LaunchException(file, ieex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LSingleInstanceExists")), applet); } catch (LaunchException lex) { - throw launchError(lex); + throw launchError(lex, applet); } catch (Exception ex) { - throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo"))); + throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")), applet); } } @@ -715,9 +745,15 @@ * * @param enableCodeBase whether to add the code base URL to the classloader */ - protected AppletInstance createApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException { - try { + //FIXME - when multiple applets are on one page, this method is visited simultaneously + //and then appelts creates in little bit strange manner. This issue is visible with + //randomly showing/notshowing spalshscreens. + //See also PluginAppletViewer.framePanel + protected AppletInstance createApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException { + AppletInstance appletInstance = null; + try { JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy); + forceContextClassLoaderHack(loader); if (enableCodeBase) { loader.enableCodeBase(); @@ -730,7 +766,6 @@ // appletInstance is needed by ServiceManager when looking up // services. This could potentially be done in applet constructor // so initialize appletInstance before creating applet. - AppletInstance appletInstance; if (cont == null) appletInstance = new AppletInstance(file, group, loader, null); else @@ -751,7 +786,7 @@ return appletInstance; } catch (Exception ex) { - throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCInit"), R("LInitApplet"), R("LInitAppletInfo"))); + throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCInit"), R("LInitApplet"), R("LInitAppletInfo")), appletInstance); } } @@ -764,6 +799,7 @@ protected Applet createAppletObject(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException { try { JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy); + forceContextClassLoaderHack(loader); if (enableCodeBase) { loader.enableCodeBase(); @@ -787,6 +823,7 @@ protected ApplicationInstance createApplication(JNLPFile file) throws LaunchException { try { JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy); + forceContextClassLoaderHack(loader); ThreadGroup group = Thread.currentThread().getThreadGroup(); ApplicationInstance app = new ApplicationInstance(file, group, loader); @@ -822,6 +859,13 @@ * caller. */ private LaunchException launchError(LaunchException ex) { + return launchError(ex, null); + } + + private LaunchException launchError(LaunchException ex, AppletInstance applet) { + if (applet != null) { + SplashUtils.showErrorCaught(ex, applet); + } if (handler != null) handler.launchError(ex); @@ -861,7 +905,27 @@ new ParserDelegator(); } - /** + /* + * This is necessary to ensure the AppContext context-classloader is correctly set to our JNLPClassLoader. + * This is unfortunately necessary until it is possible to create a JNLPClassLoader -before- we create our AppContext. + */ + private void forceContextClassLoaderHack(ClassLoader classLoader) { + try { + Field appContextClassLoaderField = AppContext.class.getDeclaredField("contextClassLoader"); + appContextClassLoaderField.setAccessible(true); + appContextClassLoaderField.set(AppContext.getAppContext(), classLoader); + + Field eventQueueClassLoaderField = EventQueue.class.getDeclaredField("classLoader"); + eventQueueClassLoaderField.setAccessible(true); + eventQueueClassLoaderField.set(Toolkit.getDefaultToolkit().getSystemEventQueue(), classLoader); + + } catch (Exception e) { + System.err.println("Problem occurred while setting the AppContext context-classloader using reflection:"); + e.printStackTrace(); + } + } + + /** * This runnable is used to call the appropriate launch method * for the application, applet, or installer in its thread group. */ diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/LaunchException.java icedtea-web-1.4/netx/net/sourceforge/jnlp/LaunchException.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/LaunchException.java 2013-04-10 11:40:23.851668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/LaunchException.java 2013-05-03 19:08:24.207520662 +0000 @@ -16,6 +16,11 @@ package net.sourceforge.jnlp; +import java.util.Collections; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + /** * Thrown when a JNLP application, applet, or installer could not * be created. @@ -25,6 +30,29 @@ */ public class LaunchException extends Exception { + + public static class LaunchExceptionWithStamp{ + private final LaunchException ex; + private final Date stamp; + + private LaunchExceptionWithStamp(LaunchException ex) { + this.ex=ex; + this.stamp=new Date(); + } + + public LaunchException getEx() { + return ex; + } + + public Date getStamp() { + return stamp; + } + + + + } + private static final List launchExceptionChain = Collections.synchronizedList(new LinkedList()); + private static final long serialVersionUID = 7283827853612357423L; /** the file being launched */ @@ -54,6 +82,7 @@ this.summary = summary; this.description = description; this.severity = severity; + saveLaunchException(this); } /** @@ -61,6 +90,7 @@ */ public LaunchException(Throwable cause) { super(cause); + saveLaunchException(this); } /** @@ -68,6 +98,7 @@ */ public LaunchException(String message, Throwable cause) { super(message, cause); + saveLaunchException(this); } /** @@ -78,6 +109,7 @@ */ public LaunchException(String message) { super(message); + saveLaunchException(this); } /** @@ -117,4 +149,15 @@ return severity; } + private synchronized void saveLaunchException(LaunchException ex) { + launchExceptionChain.add(new LaunchExceptionWithStamp(ex)); + + } + + public synchronized static List getLaunchExceptionChain() { + return launchExceptionChain; + } + + + } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/LaunchHandler.java icedtea-web-1.4/netx/net/sourceforge/jnlp/LaunchHandler.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/LaunchHandler.java 2013-04-10 11:40:23.852668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/LaunchHandler.java 2013-05-03 19:08:24.208520649 +0000 @@ -61,7 +61,7 @@ * but do not have everything required. This is a nice point to show the * splash screen. * - * @param application the application instance that is starting + * @param file the JNLP file of the instance that is starting */ public void launchInitialized(JNLPFile file); diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Log.java icedtea-web-1.4/netx/net/sourceforge/jnlp/Log.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Log.java 2013-04-10 11:40:23.852668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/Log.java 2013-05-03 19:08:24.209520636 +0000 @@ -1,3 +1,40 @@ +/* Log.java + Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + package net.sourceforge.jnlp; import java.io.File; diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/NetxPanel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/NetxPanel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/NetxPanel.java 2013-04-11 10:26:30.474898000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/NetxPanel.java 2013-05-03 19:08:24.211520612 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2007 Red Hat, Inc. + * Copyright 2012 Red Hat, Inc. * This file is part of IcedTea, http://icedtea.classpath.org * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -22,32 +22,33 @@ package net.sourceforge.jnlp; -import net.sourceforge.jnlp.AppletLog; import net.sourceforge.jnlp.runtime.AppletInstance; import net.sourceforge.jnlp.runtime.JNLPRuntime; import java.net.URL; import java.util.HashMap; -import java.util.Hashtable; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import net.sourceforge.jnlp.splashscreen.SplashController; +import net.sourceforge.jnlp.splashscreen.SplashPanel; +import net.sourceforge.jnlp.splashscreen.SplashUtils; import sun.applet.AppletViewerPanel; import sun.awt.SunToolkit; /** * This panel calls into netx to run an applet, and pipes the display - * into a panel from gcjwebplugin. + * into a panel from the icedtea-web browser plugin. * * @author Francis Kung */ -public class NetxPanel extends AppletViewerPanel { +public class NetxPanel extends AppletViewerPanel implements SplashController { + private final PluginParameters parameters; private PluginBridge bridge = null; - private boolean exitOnFailure = true; private AppletInstance appInst = null; - private boolean appletAlive; - private final String uKey; + private SplashController splashController; + private volatile boolean initialized; // We use this so that we can create exactly one thread group // for all panels with the same uKey. @@ -65,50 +66,21 @@ private static final ConcurrentMap appContextCreated = new ConcurrentHashMap(); - public NetxPanel(URL documentURL, Hashtable atts) { - super(documentURL, atts); + public NetxPanel(URL documentURL, PluginParameters params) { + super(documentURL, params.getUnderlyingHashtable()); - /* According to http://download.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/applet-compatibility.html, - * classloaders are shared iff these properties match: - * codebase, cache_archive, java_archive, archive - * - * To achieve this, we create the uniquekey based on those 4 values, - * always in the same order. The initial "=" parts ensure a - * bad tag cannot trick the loader into getting shared with another. - */ - - String cache_archiveAttr = atts.get("cache_archive") != null ? - atts.get("cache_archive") : ""; - - String java_archiveAttr = atts.get("java_archive") != null ? - atts.get("java_archive") : ""; - - String archiveAttr = atts.get("archive") != null ? - atts.get("archive") : ""; + this.parameters = params; + this.initialized = false; - this.uKey = "codebase=" + getCodeBase().toExternalForm() + - "cache_archive=" + cache_archiveAttr + - "java_archive=" + java_archiveAttr + - "archive=" + archiveAttr; - - // when this was being done (incorrectly) in Launcher, the call was - // new AppThreadGroup(mainGroup, file.getTitle()); + String uniqueKey = params.getUniqueKey(getCodeBase()); synchronized(TGMapMutex) { - if (!uKeyToTG.containsKey(this.uKey)) { + if (!uKeyToTG.containsKey(uniqueKey)) { ThreadGroup tg = new ThreadGroup(Launcher.mainGroup, this.documentURL.toString()); - uKeyToTG.put(this.uKey, tg); + uKeyToTG.put(uniqueKey, tg); } } } - // overloaded constructor, called when initialized via plugin - public NetxPanel(URL documentURL, Hashtable atts, - boolean exitOnFailure) { - this(documentURL, atts); - this.exitOnFailure = exitOnFailure; - this.appletAlive = true; - } - @Override protected void showAppletException(Throwable t) { /* @@ -121,6 +93,7 @@ //Overriding to use Netx classloader. You might need to relax visibility //in sun.applet.AppletPanel for runLoader(). + @Override protected void runLoader() { try { @@ -130,34 +103,18 @@ getCode(), getWidth(), getHeight(), - atts, uKey); + parameters); doInit = true; dispatchAppletEvent(APPLET_LOADING, null); status = APPLET_LOAD; - Launcher l = new Launcher(exitOnFailure); + Launcher l = new Launcher(false); - try { - appInst = (AppletInstance) l.launch(bridge, this); - } catch (LaunchException e) { - // Assume user has indicated he does not trust the - // applet. - if (exitOnFailure) - System.exit(1); - } + // May throw LaunchException: + appInst = (AppletInstance) l.launch(bridge, this); applet = appInst.getApplet(); - //On the other hand, if you create an applet this way, it'll work - //fine. Note that you might to open visibility in sun.applet.AppletPanel - //for this to work (the loader field, and getClassLoader). - //loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey()); - //applet = createApplet(loader); - - // This shows that when using NetX's JNLPClassLoader, keyboard input - // won't make it to the applet, whereas using sun.applet.AppletClassLoader - // works just fine. - if (applet != null) { // Stick it in the frame applet.setStub(this); @@ -167,15 +124,17 @@ validate(); } } catch (Exception e) { - this.appletAlive = false; + status = APPLET_ERROR; e.printStackTrace(); + replaceSplash(SplashUtils.getErrorSplashScreen(getWidth(), getHeight(), e)); } finally { // PR1157: This needs to occur even in the case of an exception // so that the applet's event listeners are signaled. - // Once PluginAppletViewer.AppletEventListener is signaled PluginAppletViewer it can properly stop waiting + // Once PluginAppletViewer.AppletEventListener is signaled PluginAppletViewer can properly stop waiting // in PluginAppletViewer.waitForAppletInit + this.initialized = true; dispatchAppletEvent(APPLET_LOADING_COMPLETED, null); - } + } } /** @@ -183,6 +142,7 @@ * the applet */ // Reminder: Relax visibility in sun.applet.AppletPanel + @Override protected synchronized void createAppletThread() { // initialize JNLPRuntime in the main threadgroup synchronized (JNLPRuntime.initMutex) { @@ -203,21 +163,20 @@ } public void updateSizeInAtts(int height, int width) { - this.atts.put("height", Integer.toString(height)); - this.atts.put("width", Integer.toString(width)); + parameters.updateSize(width, height); } public ClassLoader getAppletClassLoader() { return appInst.getClassLoader(); } - public boolean isAlive() { - return handler != null && handler.isAlive() && this.appletAlive; + public boolean isInitialized() { + return initialized; } public ThreadGroup getThreadGroup() { synchronized(TGMapMutex) { - return uKeyToTG.get(uKey); + return uKeyToTG.get(parameters.getUniqueKey(getCodeBase())); } } @@ -227,8 +186,33 @@ } // only create a new context if one hasn't already been created for the // applets with this unique key. - if (null == appContextCreated.putIfAbsent(uKey, Boolean.TRUE)) { + if (null == appContextCreated.putIfAbsent(parameters.getUniqueKey(getCodeBase()), Boolean.TRUE)) { SunToolkit.createNewAppContext(); } } + + public void setAppletViewerFrame(SplashController framePanel) { + splashController=framePanel; + } + + @Override + public void removeSplash() { + splashController.removeSplash(); + } + + @Override + public void replaceSplash(SplashPanel r) { + splashController.replaceSplash(r); + } + + @Override + public int getSplashWidth() { + return splashController.getSplashWidth(); + } + + @Override + public int getSplashHeigth() { + return splashController.getSplashHeigth(); + } + } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Node.java icedtea-web-1.4/netx/net/sourceforge/jnlp/Node.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Node.java 2013-04-10 11:40:23.854668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/Node.java 2013-05-03 19:08:24.212520600 +0000 @@ -1,3 +1,40 @@ +/* Node.java + Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + package net.sourceforge.jnlp; import java.util.ArrayList; diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/NullJnlpFileException.java icedtea-web-1.4/netx/net/sourceforge/jnlp/NullJnlpFileException.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/NullJnlpFileException.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/NullJnlpFileException.java 2013-05-03 19:08:24.212520600 +0000 @@ -0,0 +1,50 @@ +package net.sourceforge.jnlp; + +/* +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +public class NullJnlpFileException extends NullPointerException { + + public NullJnlpFileException() { + super(); + } + + public NullJnlpFileException(String s) { + super(s); + } + +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Parser.java icedtea-web-1.4/netx/net/sourceforge/jnlp/Parser.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Parser.java 2013-04-10 11:40:23.855668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/Parser.java 2013-05-03 19:08:24.214520574 +0000 @@ -143,9 +143,16 @@ // JNLP tag information this.spec = getVersion(root, "spec", "1.0+"); - this.codebase = addSlash(getURL(root, "codebase", base)); - if (this.codebase == null) // We only override it if it is not specified. + + try { + this.codebase = addSlash(getURL(root, "codebase", base)); + } catch (ParseException e) { + //If parsing fails, continue by overriding the codebase with the one passed in + } + + if (this.codebase == null) // Codebase is overwritten if codebase was not specified in file or if parsing of it failed this.codebase = codebase; + this.base = (this.codebase != null) ? this.codebase : base; // if codebase not specified use default codebase fileLocation = getURL(root, "href", this.base); diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/PluginBridge.java icedtea-web-1.4/netx/net/sourceforge/jnlp/PluginBridge.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/PluginBridge.java 2013-04-10 11:40:23.856668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/PluginBridge.java 2013-05-03 19:08:24.215520561 +0000 @@ -22,7 +22,10 @@ package net.sourceforge.jnlp; +import java.io.ByteArrayInputStream; import java.io.File; +import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.net.MalformedURLException; import java.util.HashSet; @@ -32,6 +35,8 @@ import java.util.Map; import java.util.Set; +import sun.misc.BASE64Decoder; + import net.sourceforge.jnlp.runtime.JNLPRuntime; /** @@ -40,26 +45,23 @@ */ public class PluginBridge extends JNLPFile { - private String name; + private PluginParameters params; private Set jars = new HashSet(); //Folders can be added to the code-base through the archive tag private List codeBaseFolders = new ArrayList(); private String[] cacheJars = new String[0]; private String[] cacheExJars = new String[0]; - private Map atts; private boolean usePack; private boolean useVersion; - private boolean codeBaseLookup; private boolean useJNLPHref; /** * Creates a new PluginBridge using a default JNLPCreator. */ public PluginBridge(URL codebase, URL documentBase, String jar, String main, - int width, int height, Map atts, - String uKey) + int width, int height, PluginParameters params) throws Exception { - this(codebase, documentBase, jar, main, width, height, atts, uKey, new JNLPCreator()); + this(codebase, documentBase, jar, main, width, height, params, new JNLPCreator()); } /** @@ -81,28 +83,38 @@ } public PluginBridge(URL codebase, URL documentBase, String archive, String main, - int width, int height, Map atts, - String uKey, JNLPCreator jnlpCreator) + int width, int height, PluginParameters params, JNLPCreator jnlpCreator) throws Exception { specVersion = new Version("1.0"); fileVersion = new Version("1.1"); this.codeBase = codebase; this.sourceLocation = documentBase; - this.atts = atts; + this.params = params; - if (atts.containsKey("jnlp_href")) { + if (params.getJNLPHref() != null) { useJNLPHref = true; try { // Use codeBase as the context for the URL. If jnlp_href's // value is a complete URL, it will replace codeBase's context. - URL jnlp = new URL(codeBase, atts.get("jnlp_href")); - JNLPFile jnlpFile = jnlpCreator.create(jnlp, null, false, JNLPRuntime.getDefaultUpdatePolicy(), codeBase); + URL jnlp = new URL(codeBase, params.getJNLPHref()); + JNLPFile jnlpFile = null; + + if (params.getJNLPEmbedded() != null) { + InputStream jnlpInputStream = new ByteArrayInputStream(decodeBase64String(params.getJNLPEmbedded())); + jnlpFile = new JNLPFile(jnlpInputStream, codeBase, false); + } else { + jnlpFile = jnlpCreator.create(jnlp, null, false, JNLPRuntime.getDefaultUpdatePolicy(), codeBase); + } + + if (jnlpFile.isApplet()) + main = jnlpFile.getApplet().getMainClass(); + Map jnlpParams = jnlpFile.getApplet().getParameters(); info = jnlpFile.info; // Change the parameter name to lowercase to follow conventions. for (Map.Entry entry : jnlpParams.entrySet()) { - this.atts.put(entry.getKey().toLowerCase(), entry.getValue()); + this.params.put(entry.getKey().toLowerCase(), entry.getValue()); } JARDesc[] jarDescs = jnlpFile.getResources().getJARs(); for (JARDesc jarDesc : jarDescs) { @@ -112,7 +124,7 @@ } catch (MalformedURLException e) { // Don't fail because we cannot get the jnlp file. Parameters are optional not required. // it is the site developer who should ensure that file exist. - System.err.println("Unable to get JNLP file at: " + atts.get("jnlp_href") + System.err.println("Unable to get JNLP file at: " + params.getJNLPHref() + " with context of URL as: " + codeBase.toExternalForm()); } } else { @@ -122,14 +134,14 @@ } // also, see if cache_archive is specified - String cacheArchive = atts.get("cache_archive"); - if (cacheArchive != null && cacheArchive.length() > 0) { + String cacheArchive = params.getCacheArchive(); + if (!cacheArchive.isEmpty()) { String[] versions = new String[0]; // are there accompanying versions? - String cacheVersion = atts.get("cache_version"); - if (cacheVersion != null) { + String cacheVersion = params.getCacheVersion(); + if (!cacheVersion.isEmpty()) { versions = cacheVersion.split(","); } @@ -146,8 +158,8 @@ } } - String cacheArchiveEx = atts.get("cache_archive_ex"); - if (cacheArchiveEx != null && cacheArchiveEx.length() > 0) { + String cacheArchiveEx = params.getCacheArchiveEx(); + if (!cacheArchiveEx.isEmpty()) { cacheExJars = cacheArchiveEx.split(","); } @@ -162,19 +174,13 @@ } } - name = atts.get("name"); - if (name == null) - name = "Applet"; - else - name = name + " applet"; - if (main.endsWith(".class")) main = main.substring(0, main.length() - 6); // the class name should be of the form foo.bar.Baz not foo/bar/Baz String mainClass = main.replace('/', '.'); - launchType = new AppletDesc(name, mainClass, documentBase, width, - height, atts); + launchType = new AppletDesc(params.getAppletTitle(), mainClass, documentBase, width, + height, params.getUnmodifiableMap()); if (main.endsWith(".class")) //single class file only security = new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, @@ -182,11 +188,11 @@ else security = null; - this.uniqueKey = uKey; + this.uniqueKey = params.getUniqueKey(codebase); usePack = false; useVersion = false; - String jargs = atts.get("java_arguments"); - if (jargs != null) { + String jargs = params.getJavaArguments(); + if (!jargs.isEmpty()) { for (String s : jargs.split(" ")) { String[] parts = s.trim().split("="); if (parts.length == 2 && Boolean.valueOf(parts[1])) { @@ -198,12 +204,14 @@ } } } - String cbl = atts.get("codebase_lookup"); - codeBaseLookup = cbl == null || (Boolean.valueOf(cbl)); + } + + public List getArchiveJars() { + return new ArrayList(jars); } public boolean codeBaseLookup() { - return codeBaseLookup; + return params.useCodebaseLookup(); } public boolean useJNLPHref() { @@ -211,7 +219,7 @@ } /** - * {@inheritdoc } + * {@inheritDoc } */ @Override public DownloadOptions getDownloadOptionsForJar(JARDesc jar) { @@ -219,7 +227,7 @@ } public String getTitle() { - return name; + return params.getAppletTitle(); } public ResourcesDesc getResources(final Locale locale, final String os, @@ -242,9 +250,7 @@ } boolean cacheable = true; - - String cacheOption = atts.get("cache_option"); - if (cacheOption != null && cacheOption.equalsIgnoreCase("no")) + if (params.getCacheOption().equalsIgnoreCase("no")) cacheable = false; for (String cacheJar : cacheJars) { @@ -349,4 +355,12 @@ public boolean isInstaller() { return false; } + + /** + * Returns the decoded BASE64 string + */ + static byte[] decodeBase64String(String encodedString) throws IOException { + BASE64Decoder base64 = new BASE64Decoder(); + return base64.decodeBuffer(encodedString); + } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/PluginParameterException.java icedtea-web-1.4/netx/net/sourceforge/jnlp/PluginParameterException.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/PluginParameterException.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/PluginParameterException.java 2013-05-03 19:08:24.215520561 +0000 @@ -0,0 +1,43 @@ +/* Copyright (C) 2012 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package net.sourceforge.jnlp; + +public class PluginParameterException extends RuntimeException { + public PluginParameterException(String detail) { + super(detail); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/PluginParameters.java icedtea-web-1.4/netx/net/sourceforge/jnlp/PluginParameters.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/PluginParameters.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/PluginParameters.java 2013-05-03 19:08:24.216520548 +0000 @@ -0,0 +1,238 @@ +/* PluginAppletAttributes -- Provides parsing for applet attributes + Copyright (C) 2012 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package net.sourceforge.jnlp; + +import java.net.URL; +import java.util.Collections; +import java.util.Hashtable; +import java.util.Map; + +import static net.sourceforge.jnlp.runtime.Translator.R; + +/** + * Represents plugin applet parameters, backed by a Hashtable. + */ + +public class PluginParameters { + private final Hashtable parameters; + + public PluginParameters(Map params) { + this.parameters = createParameterTable(params); + + if (this.parameters.get("code") == null + && this.parameters.get("object") == null + //If code/object parameters are missing, we can still determine the main-class name from the jnlp file passed using jnlp_href + && this.parameters.get("jnlp_href") == null) { + throw new PluginParameterException(R("BNoCodeOrObjectApplet")); + } + } + + // Note, lower-case key expected + public String get(String key) { + return this.parameters.get(key); + } + + public void put(String key, String value) { + parameters.put(key.toLowerCase(), value); + } + + public Map getUnmodifiableMap() { + return Collections.unmodifiableMap(parameters); + } + + /** + * Used for compatibility with Hashtable-expecting classes. + * + * @return the underlying hashtable. + */ + Hashtable getUnderlyingHashtable() { + return parameters; + } + + public String getDefaulted(String key, String defaultStr) { + String value = get(key); + return (value != null) ? value : defaultStr; + } + + public String getAppletTitle() { + String name = get("name"); + if (name == null) { + return "Applet"; + } else { + return name + " applet"; + } + } + + public boolean useCodebaseLookup() { + return Boolean.valueOf(getDefaulted("codebase_lookup", "true")); + } + + public String getArchive() { + return getDefaulted("archive", ""); + } + + public String getJavaArchive() { + return getDefaulted("java_archive", ""); + } + + public String getJavaArguments() { + return getDefaulted("java_arguments", ""); + } + + public String getCacheArchive() { + return getDefaulted("cache_archive", ""); + } + + public String getCacheArchiveEx() { + return getDefaulted("cache_archive_ex", ""); + } + + public String getCacheOption() { + return getDefaulted("cache_option", ""); + } + + public String getCacheVersion() { + return getDefaulted("cache_version", ""); + } + + public String getCode() { + return getDefaulted("code", ""); + } + + public String getJNLPHref() { + return get("jnlp_href"); + } + + public String getJNLPEmbedded() { + return get("jnlp_embedded"); + } + + public String getJarFiles() { + return getDefaulted("archive", ""); + } + + public int getWidth() { + String widthStr = getDefaulted("width", "0"); + return Integer.valueOf(widthStr); + } + + public int getHeight() { + String heightStr = getDefaulted("height", "0"); + return Integer.valueOf(heightStr); + } + + public void updateSize(int width, int height) { + parameters.put("width", Integer.toString(width)); + parameters.put("height", Integer.toString(height)); + } + + public String getUniqueKey(URL codebase) { + /* According to http://download.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/applet-compatibility.html, + * classloaders are shared iff these properties match: + * codebase, cache_archive, java_archive, archive + * + * To achieve this, we create the uniquekey based on those 4 values, + * always in the same order. The initial "=" parts ensure a + * bad tag cannot trick the loader into getting shared with another. + */ + return "codebase=" + codebase.toExternalForm() + "cache_archive=" + + getCacheArchive() + "java_archive=" + getJavaArchive() + + "archive=" + getArchive(); + } + + /** + * Replace an attribute with its 'java_'-prefixed version. + * Note that java_* aliases override older names: + * http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-nav + */ + static void ensureJavaPrefixTakesPrecedence(Map params, + String attribute) { + String javaPrefixAttribute = params.get("java_" + attribute); + if (javaPrefixAttribute != null) { + params.put(attribute, javaPrefixAttribute); + } + } + + /** + * Creates the underlying hash table with the proper overrides. Ensure all + * keys are lowercase consistently. + * + * @param params + * the properties, before parameter aliasing rules. + * @return the resulting parameter table + */ + static Hashtable createParameterTable( + Map rawParams) { + Hashtable params = new Hashtable(); + + for (Map.Entry entry : rawParams.entrySet()) { + String key = entry.getKey().toLowerCase(); + String value = entry.getValue(); + params.put(key, value); + } + + String codeTag = params.get("code"); + String classID = params.get("classid"); + + // If there is a classid and no code tag present, transform it to code tag + if (codeTag == null && classID != null && !classID.startsWith("clsid:")) { + codeTag = classID; + params.put("code", codeTag); + } + + // remove java: from code tag + if (codeTag != null && codeTag.startsWith("java:")) { + codeTag = codeTag.substring("java:".length()); + params.put("code", codeTag); + } + + // java_* aliases override older names: + // http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-nav + ensureJavaPrefixTakesPrecedence(params, "code"); + ensureJavaPrefixTakesPrecedence(params, "codebase"); + ensureJavaPrefixTakesPrecedence(params, "archive"); + ensureJavaPrefixTakesPrecedence(params, "object"); + ensureJavaPrefixTakesPrecedence(params, "type"); + + return params; + } + + public String toString() { + return parameters.toString(); + } +} \ No newline at end of file Binary files /tmp/NuT9CcZAiZ/icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png and /tmp/WZlglBfzlP/icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png differ diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/Messages_cs.properties icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/Messages_cs.properties --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/Messages_cs.properties 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/Messages_cs.properties 2013-05-03 19:08:24.252520097 +0000 @@ -0,0 +1,574 @@ +# Czech UI messages for netx +# L=Launcher, B=Boot, P=Parser, C=cache S=security +# +# General +NullParameter=Pr\u00e1zdn\u00fd parametr +ButAllow=Povolit +ButBrowse=Proch\u00e1zet... +ButCancel=\ Zru\u0161it +ButClose=Zav\u0159\u00edt +ButCopy=Kop\u00edrovat do schr\u00e1nky +ButMoreInformation=Dal\u0161\u00ed informace... +ButOk=OK +ButProceed=Pokra\u010dovat +ButRun=Spustit +ButApply=Pou\u017e\u00edt +ButDone=Hotovo +ButShowDetails=Zobrazit podrobnosti +ButHideDetails=Skr\u00fdt podrobnosti + +AFileOnTheMachine=soubor v po\u010d\u00edta\u010di +AlwaysAllowAction=V\u017edy povolit tuto akci +Usage=Pou\u017eit\u00ed: +Error=Chyba + +Continue=Chcete pokra\u010dovat? +Field=Pole +From=Od +Name=Jm\u00e9no +Password=Heslo: +Publisher=Vydavatel +Unknown= +Username=U\u017eivatelsk\u00e9 jm\u00e9no: +Value=Hodnota +Version=Verze + +# LS - Severity +LSMinor=Mal\u00e1 +LSFatal=Z\u00e1va\u017en\u00e1 + +# LC - Category +LCSystem=Syst\u00e9mov\u00e1 chyba +LCExternalLaunch=Chyba extern\u00edho spu\u0161t\u011bn\u00ed +LCFileFormat=Chybn\u00fd form\u00e1t souboru +LCReadError=Chyba p\u0159i \u010dten\u00ed +LCClient=Chyba aplikace +LCLaunching=Chyba p\u0159i spou\u0161t\u011bn\u00ed +LCNotSupported=Nepodporovan\u00e1 funkce +LCInit=Chyba inicializace + +LAllThreadGroup=V\u0161echny aplikace JNLP +LNullUpdatePolicy=Pravidla pro aktualizaci nesm\u00ed b\u00fdt pr\u00e1zdn\u00e1. + +LThreadInterrupted=Vl\u00e1kno bylo p\u0159eru\u0161eno p\u0159i \u010dek\u00e1n\u00ed na spu\u0161t\u011bn\u00ed souboru. +LThreadInterruptedInfo=To m\u016f\u017ee v\u00e9st k zablokov\u00e1n\u00ed nebo v\u00e9st k jin\u00e9mu po\u0161kozen\u00ed p\u0159i spou\u0161t\u011bn\u00ed. Restartujte aplikaci/prohl\u00ed\u017ee\u010d. +LCouldNotLaunch=Nelze spustit soubor JNLP. +LCouldNotLaunchInfo=Aplikace nebyla inicializov\u00e1na. V\u00edce informac\u00ed z\u00edsk\u00e1te spu\u0161t\u011bn\u00edm p\u0159\u00edkazu javaws/prohl\u00ed\u017ee\u010de z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky. +LCantRead=Nelze \u010d\u00edst nebo analyzovat soubor JNLP. +LCantReadInfo=M\u016f\u017eete se pokusit st\u00e1hnout tento soubor ru\u010dn\u011b a poslat ho jako hl\u00e1\u0161en\u00ed o chyb\u011b t\u00fdmu IcedTea-Web. +LNullLocation=Nelze ur\u010dit um\u00edst\u011bn\u00ed souboru JNLP. +LNullLocationInfo=Byl u\u010din\u011bn pokus o spu\u0161t\u011bn\u00ed souboru JNLP v jin\u00e9m prost\u0159ed\u00ed JVM, av\u0161ak soubor nebyl nalezen. Chcete-li spustit extern\u00ed prost\u0159ed\u00ed JVM, modul runtime mus\u00ed b\u00fdt schopen nal\u00e9zt soubor .jnlp v lok\u00e1ln\u00edm souborov\u00e9m syst\u00e9mu nebo na serveru. +LNetxJarMissing=Nelze ur\u010dit um\u00edst\u011bn\u00ed souboru netx.jar. +LNetxJarMissingInfo=Byl u\u010din\u011bn pokus o spu\u0161t\u011bn\u00ed souboru JNLP v jin\u00e9m prost\u0159ed\u00ed JVM, av\u0161ak nebyl nalezen soubor netx.jar. Chcete-li spustit extern\u00ed prost\u0159ed\u00ed JVM, modul runtime mus\u00ed b\u00fdt schopen nal\u00e9zt soubor netx.jar. +LNotToSpec=Soubor JNLP p\u0159esn\u011b neodpov\u00edd\u00e1 specifikaci. +LNotToSpecInfo=Soubor JNLP obsahuje data, kter\u00e1 jsou zak\u00e1z\u00e1na v r\u00e1mci specifikace JNLP. Modul runtime se m\u016f\u017ee pokusit ignorovat neplatn\u00e9 informace a pokra\u010dovat ve spou\u0161t\u011bn\u00ed souboru. +LNotApplication=Nejedn\u00e1 se o soubor aplikace. +LNotApplicationInfo=Byl u\u010din\u011bn pokus o na\u010dten\u00ed souboru, kter\u00fd nen\u00ed aplikac\u00ed, jako soubor aplikace. +LNotApplet=Nejedn\u00e1 se o soubor appletu. +LNotAppletInfo=Byl u\u010din\u011bn pokus o na\u010dten\u00ed souboru, kter\u00fd nen\u00ed appletem, jako soubor appletu. +LNoInstallers=Instal\u00e1tory nejsou podporov\u00e1ny. +LNoInstallersInfo=Instal\u00e1tory JNLP je\u0161t\u011b nejsou podporov\u00e1ny. +LInitApplet=Nelze inicializovat applet. +LInitAppletInfo=Chcete-li v\u00edce informac\u00ed, klikn\u011bte na tla\u010d\u00edtko Dal\u0161\u00ed informace... +LInitApplication=Nelze inicializovat aplikaci. +LInitApplicationInfo=Aplikace nebyla inicializov\u00e1na. V\u00edce informac\u00ed z\u00edsk\u00e1te spu\u0161t\u011bn\u00edm p\u0159\u00edkazu javaws z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky. +LNotLaunchable=Nejedn\u00e1 se o spustiteln\u00fd soubor JNLP. +LNotLaunchableInfo=Soubor mus\u00ed b\u00fdt aplikac\u00ed, appletem nebo instal\u00e1torem JNLP. +LCantDetermineMainClass=Nezn\u00e1m\u00e1 t\u0159\u00edda Main-Class. +LCantDetermineMainClassInfo=Nelze ur\u010dit t\u0159\u00eddu main class pro tuto aplikaci. +LUnsignedJarWithSecurity=Nelze ud\u011blit opr\u00e1vn\u011bn\u00ed nepodepsan\u00fdm soubor\u016fm JAR. +LUnsignedJarWithSecurityInfo=Aplikace po\u017e\u00e1dala o bezpe\u010dnostn\u00ed opr\u00e1vn\u011bn\u00ed, av\u0161ak soubory JAR nejsou podeps\u00e1ny. +LSignedJNLPAppDifferentCerts=Aplikace JNLP nen\u00ed kompletn\u011b podepsan\u00e1 jednou certifika\u010dn\u00ed autoritou. +LSignedJNLPAppDifferentCertsInfo=Jednotliv\u00e9 komponenty aplikace JNLP jsou individu\u00e1ln\u011b podeps\u00e1ny, nicm\u00e9n\u011b pro v\u0161echny polo\u017eky mus\u00ed b\u00fdt jeden spole\u010dn\u00fd podepisovatel. +LUnsignedApplet=Applet nebyl podepsan\u00fd. +LUnsignedAppletPolicyDenied=Applet nebyl podepsan\u00fd a bezpe\u010dnostn\u00ed pravidla zabr\u00e1nila jeho spu\u0161t\u011bn\u00ed. +LUnsignedAppletUserDenied=Applet nebyl podepsan\u00fd a byl vyhodnocen jako ned\u016fv\u011bryhodn\u00fd. +LSignedAppJarUsingUnsignedJar=Podepsan\u00e1 aplikace pou\u017e\u00edvaj\u00edc\u00ed nepodepsan\u00e9 soubory JAR. +LSignedAppJarUsingUnsignedJarInfo=Hlavn\u00ed soubor JAR aplikace je podepsan\u00fd, av\u0161ak n\u011bkter\u00e9 z dal\u0161\u00edch pou\u017e\u00edvan\u00fdch soubor\u016f JAR nejsou podeps\u00e1ny. +LSignedJNLPFileDidNotMatch=Podepsan\u00fd soubor JNLP se neshoduje se spou\u0161t\u011bn\u00fdm souborem JNLP. +LNoSecInstance=Chyba: Neexistuje bezpe\u010dnostn\u00ed instance pro aplikaci {0}. Aplikace m\u016f\u017ee m\u00edt pot\u00ed\u017ee pokra\u010dovat. +LCertFoundIn=Certifik\u00e1t {0} byl nalezen v arch\u00edvu cacerts ({1}). +LSingleInstanceExists=Ji\u017e existuje jin\u00e1 instance tohoto appletu. Nelze provozovat v\u00edce instanc\u00ed appletu z\u00e1rove\u0148. + +JNotApplet=Soubor nen\u00ed applet. +JNotApplication=Soubor nen\u00ed aplikace. +JNotComponent=Soubor nen\u00ed komponenta. +JNotInstaller=Soubor nen\u00ed instal\u00e1tor. +JInvalidExtensionDescriptor=P\u0159\u00edpona souboru neodkazuje na komponentu nebo instal\u00e1tor (n\u00e1zev={1}, um\u00edst\u011bn\u00ed={2}). + +LNotVerified=Soubory JAR nebyly ov\u011b\u0159eny. +LCancelOnUserRequest=Zru\u0161eno u\u017eivatelem. +LFatalVerification=P\u0159i ov\u011b\u0159ov\u00e1n\u00ed soubor\u016f JAR do\u0161lo k z\u00e1va\u017en\u00e9 chyb\u011b. +LFatalVerificationInfo=Do\u0161lo k v\u00fdjimce ve t\u0159\u00edd\u011b JarCertVerifier. P\u0159\u00ed\u010dinou t\u00e9to v\u00fdjimky m\u016f\u017ee b\u00fdt neschopnost \u010d\u00edst soubory cacerts nebo trusted.certs. + +LNotVerifiedDialog=Nemohly b\u00fdt ov\u011b\u0159eny v\u0161echny soubory JAR. +LAskToContinue=Chcete p\u0159esto pokra\u010dovat ve spou\u0161t\u011bn\u00ed t\u00e9to aplikace? + +# Parser +PInvalidRoot=Element \u201eroot\u201c nen\u00ed elementem jnlp. +PNoResources=Nen\u00ed definov\u00e1n element \u201eresources\u201c. +PUntrustedNative=Nelze deklarovat element \u201enativelib\u201c, ani\u017e by bylo po\u017e\u00e1d\u00e1no o p\u0159\u00edslu\u0161n\u00e1 opr\u00e1vn\u011bn\u00ed. +PExtensionHasJ2SE=V souboru roz\u0161\u00ed\u0159en\u00ed nelze deklarovat element \u201ej2se\u201c. +PInnerJ2SE=Uvnit\u0159 elementu \u201ej2se\u201c nelze deklarovat dal\u0161\u00ed element \u201ej2se\u201c. +PTwoMains=V elementu \u201eresources\u201c je duplicitn\u011b definov\u00e1n atribut \u201emain\u201c (lze definovat pouze jeden). +PNativeHasMain=V r\u00e1mci elementu \u201enativelib\u201c nelze deklarovat atribut \u201emain\u201c. +PNoInfoElement=Nen\u00ed definov\u00e1n element \u201einformation\u201c. +PMissingTitle=N\u00e1zev +PMissingVendor=Dodavatel +PMissingElement=Pro va\u0161e n\u00e1rodn\u00ed prost\u0159ed\u00ed nebyla zad\u00e1na sekce {0}, ani neexistuje v\u00fdchoz\u00ed hodnota v souboru JNLP. +PTwoDescriptions=Duplicitn\u00ed elementy \u201edescription\u201c typu {0} jsou neplatn\u00e9. +PSharing=Element \u201esharing-allowed\u201c je neplatn\u00fd ve standardn\u00edm souboru JNLP. +PTwoSecurity=V ka\u017ed\u00e9m souboru JNLP m\u016f\u017ee b\u00fdt pouze jeden element \u201esecurity\u201c. +PEmptySecurity=Element \u201esecurity\u201c je definov\u00e1n, av\u0161ak neobsahuje element \u201epermissions\u201c. +PTwoDescriptors=V ka\u017ed\u00e9m souboru JNLP m\u016f\u017ee b\u00fdt pouze jeden element \u201eapplication-desc\u201c. +PTwoDesktops=Je povolen pouze jeden element \u201edesktop\u201c. +PTwoMenus=Je povolen pouze jeden element \u201emenu\u201c. +PTwoTitles=Je povolen pouze jeden element \u201etitle\u201c. +PTwoIcons=Je povolen pouze jeden element \u201eicon\u201c. +PTwoUpdates=Je povolen pouze jeden element \u201eupdate\u201c. +PUnknownApplet=Nezn\u00e1m\u00fd applet +PBadWidth=Neplatn\u00e1 \u0161\u00ed\u0159ka appletu +PBadHeight=Neplatn\u00e1 v\u00fd\u0161ka appletu +PUrlNotInCodebase=Relativn\u00ed adresa URL neuv\u00e1d\u00ed podadres\u00e1\u0159 se z\u00e1kladnou k\u00f3du (codebase). (uzel (node)={0}, odkaz (href)={1}, z\u00e1kladna k\u00f3du (codebase)={2}) +PBadRelativeUrl=Neplatn\u00e1 relativn\u00ed adresa URL (uzel (node)={0}, odkaz (href)={1}, z\u00e1kladna k\u00f3du (codebase)={2}) +PBadNonrelativeUrl=Neplatn\u00e1 absolutn\u00ed adresa URL (uzel (node)={0}, odkaz (href)={1}) +PNeedsAttribute=Element {0} mus\u00ed deklarovat atribut {1}. +PBadXML=Neplatn\u00e1 syntax dokumentu XML +PBadHeapSize=Neplatn\u00e1 hodnota pro velikost haldy (heap size) ({0}) + +# Runtime +BLaunchAbout=Prob\u00edh\u00e1 spou\u0161t\u011bn\u00ed okna O aplikaci IcedTea-Web... +BNeedsFile=Je nutn\u00e9 zadat soubor JNLP. +RNoAboutJnlp=Nelze nal\u00e9zt soubor about.jnlp. +BFileLoc=Um\u00edst\u011bn\u00ed souboru JNLP +BBadProp=Neplatn\u00fd form\u00e1t vlastnosti {0} (platn\u00fd form\u00e1t: kl\u00ed\u010d=hodnota) +BBadParam=Neplatn\u00fd form\u00e1t parametru {0} (platn\u00fd form\u00e1t: n\u00e1zev=hodnota) +BNoDir=Adres\u00e1\u0159 {0} neexistuje. +BNoCodeOrObjectApplet=Zna\u010dka appletu mus\u00ed deklarovat atribut \u201ecode\u201c nebo \u201eobject\u201c. +RNoResource=Chyb\u011bj\u00edc\u00ed zdroj: {0} +RShutdown=Tato v\u00fdjimka zabra\u0148uje ukon\u010den\u00ed prost\u0159ed\u00ed JVM, av\u0161ak proces byl ukon\u010den. +RExitTaken=T\u0159\u00edda exit class m\u016f\u017ee b\u00fdt nastavena pouze jednou a pouze ta pak m\u016f\u017ee ukon\u010dit prost\u0159ed\u00ed JVM. +RCantReplaceSM=Nen\u00ed dovoleno vym\u011bnit t\u0159\u00eddu SecurityManager. +RCantCreateFile=Nelze vytvo\u0159it soubor {0}. +RCantDeleteFile=Nelze smazat soubor {0}. +RRemoveRPermFailed=Selhalo odstra\u0148ov\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed ke \u010dten\u00ed u souboru {0}. +RRemoveWPermFailed=Selhalo odstra\u0148ov\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed k z\u00e1pisu u souboru {0}. +RRemoveXPermFailed=Selhalo odstra\u0148ov\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed ke spou\u0161t\u011bn\u00ed u souboru {0}. +RGetRPermFailed=Selhalo z\u00edsk\u00e1v\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed ke \u010dten\u00ed u souboru {0}. +RGetWPermFailed=Selhalo z\u00edsk\u00e1v\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed k z\u00e1pisu u souboru {0}. +RGetXPermFailed=Selhalo z\u00edsk\u00e1v\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed ke spou\u0161t\u011bn\u00ed u souboru {0}. +RCantCreateDir=Nelze vytvo\u0159it adres\u00e1\u0159 {0}. +RCantRename=Nelze prov\u00e9st p\u0159ejmenov\u00e1n\u00ed z {0} na {1}. +RDenyStopped=Pozastaven\u00e1 aplikace nem\u00e1 pat\u0159i\u010dn\u00e1 opr\u00e1vn\u011bn\u00ed. +RExitNoApp=Nelze ukon\u010dit prost\u0159ed\u00ed JVM, proto\u017ee sou\u010dasn\u00e1 aplikace neodpov\u00edd\u00e1. +RNoLockDir=Nelze vytvo\u0159it uzamykac\u00ed adres\u00e1\u0159 ({0}). +RNestedJarExtration=Nelze extrahovat vno\u0159en\u00fd soubor JAR. +RUnexpected=Neo\u010dek\u00e1van\u00e1 v\u00fdjimka {0} v n\u00e1sleduj\u00edc\u00ed \u010d\u00e1sti v\u00fdpisu trasov\u00e1n\u00ed: {1} +RConfigurationError=P\u0159i \u010dten\u00ed konfigurace do\u0161lo k z\u00e1va\u017en\u00e9 chyb\u011b. +RConfigurationFatal=CHYBA: P\u0159i na\u010d\u00edt\u00e1n\u00ed konfigurace do\u0161lo k z\u00e1va\u017en\u00e9 chyb\u011b. Mo\u017en\u00e1 je nutn\u00e9 pou\u017e\u00edt glob\u00e1ln\u00ed konfiguraci, kter\u00e1 v\u0161ak nebyla nalezena. +RPRoxyPacNotSupported=Pou\u017eit\u00ed soubor\u016f PAC (Proxy Auto Config) nen\u00ed podporov\u00e1no. +RProxyFirefoxNotFound=Nelze pou\u017e\u00edt nastaven\u00ed proxy server\u016f prohl\u00ed\u017ee\u010de Firefox. Je pou\u017eito nastaven\u00ed bez proxy serveru (DIRECT). +RProxyFirefoxOptionNotImplemented=Mo\u017enost nastaven\u00ed proxy serveru prohl\u00ed\u017ee\u010de {0} ({1}) je\u0161t\u011b nen\u00ed podporov\u00e1na. +RBrowserLocationPromptTitle=Um\u00edst\u011bn\u00ed prohl\u00ed\u017ee\u010de +RBrowserLocationPromptMessage=Zadejte um\u00edst\u011bn\u00ed prohl\u00ed\u017ee\u010de. +RBrowserLocationPromptMessageWithReason=Zadejte um\u00edst\u011bn\u00ed prohl\u00ed\u017ee\u010de (p\u0159\u00edkaz prohl\u00ed\u017ee\u010de {0} je neplatn\u00fd). + +# Boot options, message should be shorter than this ----------------> +BOUsage=javaws [-volby-spu\u0161t\u011bn\u00ed] +BOUsage2=javaws [-volby-ovl\u00e1d\u00e1n\u00ed] +BOJnlp= Um\u00edst\u011bn\u00ed souboru JNLP ke spu\u0161t\u011bn\u00ed (URL nebo soubor) +BOArg= P\u0159id\u00e1 p\u0159ed spu\u0161t\u011bn\u00edm parametr aplikace. +BOParam= P\u0159id\u00e1 p\u0159ed spu\u0161t\u011bn\u00edm parametr appletu. +BOProperty= P\u0159ed spu\u0161t\u011bn\u00edm nastav\u00ed syst\u00e9movou vlastnost. +BOUpdate= Zkontroluje aktualizace. +BOLicense= Zobraz\u00ed licenci GPL a ukon\u010d\u00ed aplikaci. +BOVerbose= Zapne podrobn\u00fd v\u00fdstup. +BOAbout= Uk\u00e1\u017ee vzorovou aplikaci. +BONosecurity= Vypne zabezpe\u010den\u00e9 b\u011bhov\u00e9 prost\u0159ed\u00ed. +BONoupdate= Vypne kontrolu aktualizac\u00ed. +BOHeadless= Vypne ve\u0161ker\u00e9 grafick\u00e9 prvky u\u017eiv. rozhran\u00ed IcedTea-Web. +BOStrict= Zapne striktn\u00ed kontrolu souborov\u00e9ho form\u00e1tu JNLP. +BOViewer= Zobraz\u00ed prohl\u00ed\u017ee\u010d d\u016fv\u011bryhodn\u00fdch certifik\u00e1t\u016f. +BXnofork= Zak\u00e1\u017ee vytv\u00e1\u0159en\u00ed jin\u00fdch prost\u0159ed\u00ed JVM. +BXclearcache= Vy\u010dist\u00ed vyrovn\u00e1vac\u00ed pam\u011b\u0165 aplikace JNLP. +BXignoreheaders= Vynech\u00e1 ov\u011b\u0159ov\u00e1n\u00ed hlavi\u010dky souboru JAR. +BOHelp= Vyp\u00ed\u0161e zadanou zpr\u00e1vu do konzole a ukon\u010d\u00ed aplikaci. + +# Cache +CAutoGen=vygenerov\u00e1no automaticky \u2013 nem\u011bnit +CNotCacheable={0} nen\u00ed zdroj, kter\u00fd lze zapsat do vyrovn\u00e1vac\u00ed pam\u011bti. +CDownloading=Prob\u00edh\u00e1 stahov\u00e1n\u00ed. +CComplete=Dokon\u010deno +CChooseCache=Zvolit adres\u00e1\u0159 pro vyrovn\u00e1vac\u00ed pam\u011b\u0165... +CChooseCacheInfo=Netx pot\u0159ebuje um\u00edst\u011bn\u00ed pro uchov\u00e1v\u00e1n\u00ed soubor\u016f vyrovn\u00e1vac\u00ed pam\u011bti. +CChooseCacheDir=Adres\u00e1\u0159 vyrovn\u00e1vac\u00ed pam\u011bti +CCannotClearCache=Moment\u00e1ln\u011b nelze vy\u010distit vyrovn\u00e1vac\u00ed pam\u011b\u0165. +CFakeCache=Vyrovn\u00e1vac\u00ed pam\u011b\u0165 je po\u0161kozena. Prob\u00edh\u00e1 oprava. +CFakedCache=Po\u0161kozen\u00e1 vyrovn\u00e1vac\u00ed pam\u011b\u0165 byla opravena. D\u016frazn\u011b doporu\u010dujeme co nejd\u0159\u00edve spustit p\u0159\u00edkaz \u201ejavaws -Xclearcache\u201c a pak znovu spustit aplikaci. + +# Security +SFileReadAccess=Aplikace vy\u017eaduje p\u0159\u00edstup ke \u010dten\u00ed souboru {0}. Chcete tuto akci povolit? +SFileWriteAccess=Aplikace vy\u017eaduje p\u0159\u00edstup k zapisov\u00e1n\u00ed do souboru {0}. Chcete tuto akci povolit? +SDesktopShortcut=Aplikace vy\u017eaduje opr\u00e1vn\u011bn\u00ed k vytvo\u0159en\u00ed spou\u0161t\u011bc\u00edho souboru na plo\u0161e. Chcete tuto akci povolit? +SSigUnverified=Digit\u00e1ln\u00ed podpis aplikace nelze ov\u011b\u0159it. Chcete aplikaci spustit? +SSigVerified=Digit\u00e1ln\u00ed podpis aplikace byl ov\u011b\u0159en. Chcete aplikaci spustit? +SSignatureError=Digit\u00e1ln\u00ed podpis aplikace obsahuje chybu. Chcete aplikaci spustit? +SUntrustedSource=Digit\u00e1ln\u00ed podpis nelze ov\u011b\u0159it pomoc\u00ed d\u016fv\u011bryhodn\u00e9ho zdroje. Aplikaci spus\u0165te, pouze pokud v\u011b\u0159\u00edte p\u016fvodu aplikace. +SWarnFullPermissionsIgnorePolicy=Spou\u0161t\u011bn\u00e9mu k\u00f3du budou ud\u011blena pln\u00e1 opr\u00e1vn\u011bn\u00ed bez ohledu na p\u0159\u00edpadn\u00e1 va\u0161e vlastn\u00ed pravidla chov\u00e1n\u00ed prost\u0159ed\u00ed Java. +STrustedSource=Digit\u00e1ln\u00ed podpis byl ov\u011b\u0159en pomoc\u00ed d\u016fv\u011bryhodn\u00e9ho zdroje. +SClipboardReadAccess=Aplikace po\u017eaduje p\u0159\u00edstup ke \u010dten\u00ed syst\u00e9mov\u00e9 schr\u00e1nky. Chcete tuto akci povolit? +SClipboardWriteAccess=Aplikace vy\u017eaduje p\u0159\u00edstup k zapisov\u00e1n\u00ed do syst\u00e9mov\u00e9 schr\u00e1nky. Chcete tuto akci povolit? +SPrinterAccess=Aplikace vy\u017eaduje p\u0159\u00edstup k tisk\u00e1rn\u011b. Chcete tuto akci povolit? +SNetworkAccess=Aplikace vy\u017eaduje povolen\u00ed k vytvo\u0159en\u00ed spojen\u00ed s {0}. Chcete tuto akci povolit? +SNoAssociatedCertificate=<\u017e\u00e1dn\u00fd p\u0159idru\u017een\u00fd certifik\u00e1t> +SUnverified=(neov\u011b\u0159eno) +SAlwaysTrustPublisher=V\u017edy d\u016fv\u011b\u0159ovat obsahu od tohoto vydavatele +SHttpsUnverified=Certifik\u00e1t HTTPS webu nelze ov\u011b\u0159it. +SRememberOption=Zapamatovat si tuto volbu? +SRememberAppletOnly=Pro applet +SRememberCodebase=Pro web {0} +SUnsignedSummary=Do\u0161lo k pokusu o spu\u0161t\u011bn\u00ed nepodepsan\u00e9 aplikace Java. +SUnsignedDetail=Do\u0161lo k pokusu o spu\u0161t\u011bn\u00ed nepodepsan\u00e9 aplikace z n\u00e1sleduj\u00edc\u00edho um\u00edst\u011bn\u00ed:
\u00a0\u00a0{0}
Str\u00e1nka, kter\u00e1 p\u0159edala tento po\u017eadavek:
\u00a0\u00a0{1}

Doporu\u010dujeme, abyste spou\u0161t\u011bli aplikace pouze z web\u016f, kter\u00fdm d\u016fv\u011b\u0159ujete. +SUnsignedAllowedBefore=Tento applet jste ji\u017e d\u0159\u00edve povolili. +SUnsignedRejectedBefore=Tento applet jste ji\u017e d\u0159\u00edve odm\u00edtli. +SUnsignedQuestion=Povolit spu\u0161t\u011bn\u00ed appletu? +SNotAllSignedSummary=Podeps\u00e1ny jsou jen \u010d\u00e1sti k\u00f3du t\u00e9to aplikace. +SNotAllSignedDetail=Tato aplikace obsahuje podepsan\u00fd i nepodepsan\u00fd k\u00f3d. Podepsan\u00fd k\u00f3d je bezpe\u010dn\u00fd, pokud d\u016fv\u011b\u0159ujete poskytovateli tohoto k\u00f3du. Nepodepsan\u00e9 \u010d\u00e1sti mohou obsahovat k\u00f3d, kter\u00fd nen\u00ed pod kontrolou d\u016fv\u011bryhodn\u00e9ho poskytovatele. +SNotAllSignedQuestion=Chcete p\u0159esto pokra\u010dovat a spustit aplikaci? +SAuthenticationPrompt=Server {0} na adrese {1} vy\u017eaduje ov\u011b\u0159en\u00ed. Zpr\u00e1va: \u201e{2}\u201c +SJNLPFileIsNotSigned=Tato aplikace obsahuje digit\u00e1ln\u00ed podpis, v r\u00e1mci kter\u00e9ho v\u0161ak nen\u00ed podeps\u00e1n spou\u0161t\u011bn\u00fd soubor JNLP. + +# Security - used for the More Information dialog +SBadKeyUsage=Zdroj obsahuje polo\u017eky, u nich\u017e roz\u0161\u00ed\u0159en\u00ed pou\u017eit\u00ed kl\u00ed\u010de KeyUsage certifik\u00e1tu podepisovatele nedovoluje podeps\u00e1n\u00ed k\u00f3du. +SBadExtendedKeyUsage=Zdroj obsahuje polo\u017eky, u nich\u017e roz\u0161\u00ed\u0159en\u00ed pou\u017eit\u00ed kl\u00ed\u010de ExtendedKeyUsage certifik\u00e1tu podepisovatele nedovoluje podeps\u00e1n\u00ed k\u00f3du. +SBadNetscapeCertType=Zdroj obsahuje polo\u017eky, u nich\u017e roz\u0161\u00ed\u0159en\u00ed pou\u017eit\u00ed kl\u00ed\u010de NetscapeCertType certifik\u00e1tu podepisovatele nedovoluje podeps\u00e1n\u00ed k\u00f3du. +SHasExpiredCert=Platnost digit\u00e1ln\u00edho podpisu vypr\u0161ela. +SHasExpiringCert=Zdroje obsahuj\u00ed polo\u017eky, u nich\u017e vypr\u0161\u00ed platnost certifik\u00e1tu jejich podepisovatele do \u0161esti m\u011bs\u00edc\u016f. +SNotYetValidCert=Zdroje obsahuj\u00ed polo\u017eky, u nich\u017e je\u0161t\u011b nen\u00ed platn\u00fd certifik\u00e1t podepisovatele. +SUntrustedCertificate=Digit\u00e1ln\u00ed podpis byl vytvo\u0159en pomoc\u00ed ned\u016fv\u011bryhodn\u00e9ho certifik\u00e1tu. +STrustedCertificate=Digit\u00e1ln\u00ed podpis byl vytvo\u0159en pomoc\u00ed d\u016fv\u011bryhodn\u00e9ho certifik\u00e1tu. +SCNMisMatch=O\u010dek\u00e1van\u00fd n\u00e1zev hostitele pro tento certifik\u00e1t je: {0}.
Adresa, ke kter\u00e9 se navazuje p\u0159ipojen\u00ed: {1}. +SRunWithoutRestrictions=Tato aplikace bude spu\u0161t\u011bna bez obvykl\u00fdch bezpe\u010dnostn\u00edch omezen\u00ed aplikovan\u00fdch platformou Java. +SCertificateDetails=Podrobnosti certifik\u00e1tu + +# Security - certificate information +SIssuer=Vydavatel +SSerial=S\u00e9riov\u00e9 \u010d\u00edslo +SMD5Fingerprint=Otisk MD5 +SSHA1Fingerprint=Otisk SHA1 +SSignature=Podpis +SSignatureAlgorithm=Algoritmus podpisu +SSubject=Subjekt +SValidity=Platnost + +# Certificate Viewer +CVCertificateViewer=Certifik\u00e1ty +CVCertificateType=Typ certifik\u00e1tu +CVDetails=Podrobnosti +CVExport=Exportovat +CVExportPasswordMessage=Zadejte heslo pro ochranu souboru s kl\u00ed\u010di: +CVImport=Importovat +CVImportPasswordMessage=Zadejte heslo pro p\u0159\u00edstup k souboru: +CVIssuedBy=Vydavatel: +CVIssuedTo=P\u0159\u00edjemce: +CVPasswordTitle=Vy\u017eadov\u00e1no ov\u011b\u0159en\u00ed +CVRemove=Odstranit +CVRemoveConfirmMessage=Skute\u010dn\u011b chcete odstranit vybran\u00fd certifik\u00e1t? +CVRemoveConfirmTitle=Potvrzen\u00ed odstran\u011bn\u00ed certifik\u00e1tu +CVUser=U\u017eivatel +CVSystem=Syst\u00e9m + +#KeyStores: see KeyStores.java +KS=\u00dalo\u017ei\u0161t\u011b kl\u00ed\u010d\u016f +KSCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty +KSJsseCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty JSSE +KSCaCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty Root CA +KSJsseCaCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty JSSE Root CA +KSClientCerts=Certifik\u00e1ty pro ov\u011b\u0159en\u00ed klienta + +# Deployment Configuration messages +DCIncorrectValue=Vlastnost {0} m\u00e1 nespr\u00e1vnou hodnotu {1}. Mo\u017en\u00e9 hodnoty {2}. +DCInternal=Vnit\u0159n\u00ed chyba: {0} +DCSourceInternal= +DCUnknownSettingWithName=Vlastnost {0} je nezn\u00e1m\u00e1. + +# Value Validator messages. Messages should follow "Possible values ..." +VVPossibleValues=Mo\u017en\u00e9 hodnoty {0} +VVPossibleBooleanValues=jsou {0} nebo {1}. +VVPossibleFileValues=obsahuj\u00ed absolutn\u00ed um\u00edst\u011bn\u00ed souboru. +VVPossibleRangedIntegerValues=jsou v rozmez\u00ed {0} a\u017e {1} (v\u010detn\u011b). +VVPossibleUrlValues=obsahuj\u00ed jakoukoliv platnou adresu URL (nap\u0159. http://icedtea.classpath.org/hg/). + +# Control Panel - Main +CPMainDescriptionShort=Nastaven\u00ed aplikace IcedTea-Web +CPMainDescriptionLong=Nastaven\u00ed fungov\u00e1n\u00ed z\u00e1suvn\u00e9ho modulu prohl\u00ed\u017ee\u010de (IcedTeaNPPlugin) a rozhran\u00ed javaws (NetX) + +# Control Panel - Tab Descriptions +CPAboutDescription=Zobrazen\u00ed informace o verzi ovl\u00e1dac\u00edho panelu IcedTea +CPNetworkSettingsDescription=Nastaven\u00ed s\u00edt\u011b v\u010detn\u011b zp\u016fsobu p\u0159ipojen\u00ed aplikace IcedTea-Web k Internetu a p\u0159\u00edpadn\u00e9ho pou\u017eit\u00ed proxy server\u016f +CPTempInternetFilesDescription=Ukl\u00e1d\u00e1n\u00ed dat aplikac\u00ed prost\u0159ed\u00edm Java, aby bylo p\u0159i p\u0159\u00ed\u0161t\u00edm spu\u0161t\u011bn\u00ed umo\u017en\u011bno rychlej\u0161\u00ed na\u010dten\u00ed +CPJRESettingsDescription=Zobrazen\u00ed a spravov\u00e1n\u00ed verze a nastaven\u00ed prost\u0159ed\u00ed Java Runtime Environment pro aplikace a applety Java +CPCertificatesDescription=Pou\u017eit\u00ed certifik\u00e1t\u016f k pozitivn\u00ed identifikaci v\u00e1s, certifikac\u00ed, certifika\u010dn\u00edch autorit a vydavatel\u016f +CPSecurityDescription=Konfigurace nastaven\u00ed zabezpe\u010den\u00ed +CPDebuggingDescription=Zapnut\u00ed mo\u017enost\u00ed pom\u00e1haj\u00edc\u00edch p\u0159i lad\u011bn\u00ed +CPDesktopIntegrationDescription=Nastaven\u00ed, zda m\u00e1 b\u00fdt povoleno vytvo\u0159en\u00ed z\u00e1stupce na plo\u0161e +CPJVMPluginArguments=Nastaven\u00ed parametr\u016f prost\u0159ed\u00ed JVM pro z\u00e1suvn\u00fd modul. +CPJVMitwExec=Nastaven\u00ed prost\u0159ed\u00ed JVM pro aplikaci IcedTea-Web (pracuje nejl\u00e9pe s prost\u0159ed\u00edm OpenJDK) +CPJVMitwExecValidation=Ov\u011b\u0159en\u00ed prost\u0159ed\u00ed JVM pro aplikaci IcedTea-Web +CPJVMPluginSelectExec=Volba prost\u0159ed\u00ed JVM pro aplikaci IcedTea-Web +CPJVMnone=\u017d\u00e1dn\u00e9 v\u00fdsledky ov\u011b\u0159en\u00ed pro cestu +CPJVMvalidated=V\u00fdsledky ov\u011b\u0159en\u00ed pro cestu +CPJVMvalueNotSet=Hodnota nen\u00ed nastavena. Bude pou\u017eito p\u0159edvolen\u00e9 prost\u0159ed\u00ed JVM. +CPJVMnotLaunched=Chyba: proces nebyl spu\u0161t\u011bn. V\u00edce informac\u00ed naleznete ve v\u00fdstupu konzole. +CPJVMnoSuccess=Chyba: proces nebyl \u00fasp\u011b\u0161n\u011b ukon\u010den. Podrobnosti naleznete ve v\u00fdstupu konzole, av\u0161ak va\u0161e prost\u0159ed\u00ed Java nen\u00ed spr\u00e1vn\u011b nastaveno. +CPJVMopenJdkFound=Excelentn\u00ed! Bylo detekov\u00e1no prost\u0159ed\u00ed OpenJDK. +CPJVMoracleFound=V\u00fdborn\u011b! Bylo detekov\u00e1no prost\u0159ed\u00ed Oracle Java. +CPJVMibmFound=Dob\u0159e! Bylo detekov\u00e1no prost\u0159ed\u00ed IBM Java. +CPJVMgijFound=Varov\u00e1n\u00ed! Bylo detekov\u00e1no prost\u0159ed\u00ed gij. +CPJVMstrangeProcess=Zadan\u00e1 cesta je spustiteln\u00fd proces, ov\u0161em nebyl rozpozn\u00e1n jako aplikace Java. Ve v\u00fdstupu konzole ov\u011b\u0159te verzi prost\u0159ed\u00ed Java. +CPJVMnotDir=Chyba: cesta, kterou jste vybrali, nen\u00ed adres\u00e1\u0159. +CPJVMisDir=OK, cesta, kterou jste vybrali, je adres\u00e1\u0159. +CPJVMnoJava=Chyba: adres\u00e1\u0159, kter\u00fd jste vybrali, neobsahuje podadres\u00e1\u0159 a soubor \u201ebin/java\u201c. +CPJVMjava=OK, adres\u00e1\u0159, kter\u00fd jste vybrali, obsahuje podadres\u00e1\u0159 a soubor \u201ebin/java\u201c. +CPJVMnoRtJar=Chyba: adres\u00e1\u0159, kter\u00fd jste vybrali, neobsahuje podadres\u00e1\u0159 a soubor \u201elib/rt.jar\u201c. +CPJVMrtJar=OK, adres\u00e1\u0159, kter\u00fd jste vybrali, obsahuje podadres\u00e1\u0159 a soubor \u201elib/rt.jar\u201c. +CPJVMPluginAllowTTValidation=Povolit ov\u011b\u0159ov\u00e1n\u00ed v pr\u016fb\u011bhu psan\u00ed +CPJVMNotokMessage1=Zadali jste neplatnou hodnotu ({0}) prost\u0159ed\u00ed JDK. Chybov\u00e1 zpr\u00e1va: +CPJVMNotokMessage2=Tuto zpr\u00e1vu vid\u00edte pravd\u011bpodobn\u011b proto\u017ee:
* V\u00e1\u0161 syst\u00e9m nepro\u0161el n\u011bkter\u00fdm z ov\u011b\u0159ovac\u00edch test\u016f
* Bylo detekov\u00e1no jin\u00e9 prost\u0159ed\u00ed ne\u017e OpenJDK
S neplatn\u00fdm prost\u0159ed\u00edm JDK nebude se pravd\u011bpodobn\u011b nebude aplikace IcedTea-Web schopna spustit.
Budete muset upravit nebo odstranit vlastnost {0} ve va\u0161em konfigura\u010dn\u00edm souboru {1}.
M\u011bli byste ve sv\u00e9m syst\u00e9mu nal\u00e9zt prost\u0159ed\u00ed OpenJDK, nebo byste m\u011bli dob\u0159e v\u011bd\u011bt, co d\u011bl\u00e1te. +CPJVMconfirmInvalidJdkTitle=Potvrzen\u00ed neplatn\u00e9ho prost\u0159ed\u00ed JDK +CPJVMconfirmReset=Obnovit v\u00fdchoz\u00ed nastaven\u00ed? + +# Control Panel - Buttons +CPButAbout=O aplikaci IcedTea-Web +CPButNetworkSettings=Nastaven\u00ed s\u00edt\u011b... +CPButSettings=Nastaven\u00ed... +CPButView=Zobrazit... +CPButCertificates=Certifik\u00e1ty... + +# Control Panel - Headers +CPHead=Ovl\u00e1dac\u00ed panel IcedTea-Web +CPHeadAbout=\u00a0O aplikaci IcedTea-Web\u00a0 +CPHeadNetworkSettings=\u00a0Nastaven\u00ed proxy server\u016f s\u00edt\u011b\u00a0 +CPHeadTempInternetFiles=\u00a0Do\u010dasn\u00e9 soubory Internetu\u00a0 +CPHeadJRESettings=\u00a0Nastaven\u00ed prost\u0159ed\u00ed Java Runtime Environment\u00a0 +CPHeadCertificates=\u00a0Certifik\u00e1ty\u00a0 +CPHeadDebugging=\u00a0Nastaven\u00ed lad\u011bn\u00ed\u00a0 +CPHeadDesktopIntegration=\u00a0Integrace s pracovn\u00ed plochou\u00a0 +CPHeadSecurity=\u00a0Nastaven\u00ed zabezpe\u010den\u00ed\u00a0 +CPHeadJVMSettings=\u00a0Nastaven\u00ed JVM\u00a0 + +# Control Panel - Tabs +CPTabAbout=O aplikaci IcedTea-Web +CPTabCache=Vyrovn\u00e1vac\u00ed pam\u011b\u0165 +CPTabCertificate=Certifik\u00e1ty +CPTabClassLoader=Zavad\u011b\u010de t\u0159\u00edd +CPTabDebugging=Lad\u011bn\u00ed +CPTabDesktopIntegration=Integrace s pracovn\u00ed plochou +CPTabNetwork=S\u00ed\u0165 +CPTabRuntimes=Moduly runtime +CPTabSecurity=Zabezpe\u010den\u00ed +CPTabJVMSettings=Nastaven\u00ed JVM + +# Control Panel - AboutPanel +CPAboutInfo=Toto je ovl\u00e1dac\u00ed panel umo\u017e\u0148uj\u00edc\u00ed nastavit deployment.properties.
Dokud nebudou implementov\u00e1ny v\u0161echny funkce, n\u011bkter\u00e9 z nich nebudou \u00fa\u010dinn\u00e9.
V sou\u010dasnosti nen\u00ed podporov\u00e1no pou\u017e\u00edv\u00e1n\u00ed v\u00edce prost\u0159ed\u00ed JRE.
+ +# Control Panel - AdvancedProxySettings +APSDialogTitle=Nastaven\u00ed s\u00edt\u011b +APSServersPanel=Servery +APSProxyTypeLabel=Typ +APSProxyAddressLabel=Adresa proxy serveru +APSProxyPortLabel=Port proxy serveru +APSLabelHTTP=HTTP +APSLabelSecure=Zabezpe\u010den\u00fd +APSLabelFTP=FTP +APSLabelSocks=Socks +APSSameProxyForAllProtocols=Pou\u017e\u00edt stejn\u00fd proxy server pro v\u0161echny protokoly +APSExceptionsLabel=V\u00fdjimky +APSExceptionsDescription=Nepou\u017e\u00edvat proxy server pro adresy za\u010d\u00ednaj\u00edc\u00ed na +APSExceptionInstruction=Odd\u011blte ka\u017edou polo\u017eku st\u0159edn\u00edkem. + +# Control Panel - DebugginPanel +DPEnableTracing=Zapnout trasov\u00e1n\u00ed +DPEnableLogging=Zapnout protokolov\u00e1n\u00ed +DPDisable=Vypnout +DPHide=Skr\u00fdt p\u0159i spou\u0161t\u011bn\u00ed +DPShow=Zobrazit p\u0159i spou\u0161t\u011bn\u00ed +DPJavaConsole=Konzola Java + +# Control Panel - DesktopShortcutPanel +DSPNeverCreate=Nikdy nevytv\u00e1\u0159et +DSPAlwaysAllow=V\u017edy povolit +DSPAskUser=Dot\u00e1zat se u\u017eivatele +DSPAskIfHinted=Dot\u00e1zat se v p\u0159\u00edpad\u011b pot\u0159eby +DSPAlwaysIfHinted=V\u017edy v p\u0159\u00edpad\u011b pot\u0159eby + +# Control Panel - NetworkSettingsPanel +NSDescription-1=Nezn\u00e1m\u00e9 nastaven\u00ed +NSDescription0=Pou\u017eit\u00ed p\u0159\u00edm\u00e9ho spojen\u00ed +NSDescription1=Potla\u010den\u00ed nastaven\u00ed proxy server\u016f v prohl\u00ed\u017ee\u010di +NSDescription2=Pou\u017eit\u00ed skriptu pro automatickou konfiguraci proxy serveru v zadan\u00e9m um\u00edst\u011bn\u00ed +NSDescription3=Pou\u017eit\u00ed nastaven\u00ed proxy server\u016f ve v\u00fdchoz\u00edm prohl\u00ed\u017ee\u010di k p\u0159ipojen\u00ed k Internetu +NSAddress=Adresa +NSPort=Port +NSAdvanced=Pokro\u010dil\u00e9 +NSBypassLocal=Obej\u00edt proxy server pro m\u00edstn\u00ed adresy +NSDirectConnection=P\u0159\u00edm\u00e9 spojen\u00ed +NSManualProxy=Ru\u010dn\u00ed nastaven\u00ed proxy serveru +NSAutoProxy=Skript pro automatickou konfiguraci proxy serveru +NSBrowserProxy=Pou\u017e\u00edt nastaven\u00ed v prohl\u00ed\u017ee\u010di +NSScriptLocation=Um\u00edst\u011bn\u00ed skriptu + +# Control Panel - SecurityGeneralPanel +SGPAllowUserGrantSigned=Povolit u\u017eivatel\u016fm ud\u011blovat opr\u00e1vn\u011bn\u00ed podepsan\u00e9mu obsahu +SGPAllowUserGrantUntrust=Povolit u\u017eivatel\u016fm ud\u011blovat opr\u00e1vn\u011bn\u00ed obsahu z ned\u016fv\u011bryhodn\u00e9ho zdroje +SGPUseBrowserKeystore=Pou\u017e\u00edt certifik\u00e1ty a kl\u00ed\u010de v \u00falo\u017ei\u0161ti kl\u00ed\u010d\u016f prohl\u00ed\u017ee\u010de (nen\u00ed podporov\u00e1no) +SGPUsePersonalCertOneMatch=Pou\u017e\u00edt osobn\u00ed certifik\u00e1t automaticky, pokud dotazu serveru odpov\u00edd\u00e1 pouze jeden certifik\u00e1t (nen\u00ed podporov\u00e1no) +SGPWarnCertHostMismatch=Zobrazit varov\u00e1n\u00ed, pokud certifik\u00e1t webu neodpov\u00edd\u00e1 n\u00e1zvu hostitele +SGPShowValid=Zobrazit certifik\u00e1t webu, i kdy\u017e je certifik\u00e1t platn\u00fd (nen\u00ed podporov\u00e1no) +SGPShowSandboxWarning=Zobrazit varovn\u00fd prou\u017eek izolovan\u00e9ho prostoru (sandbox) +SGPAllowUserAcceptJNLPSecurityRequests=Povolit u\u017eivatel\u016fm p\u0159ij\u00edmat bezpe\u010dnostn\u00ed po\u017eadavky JNLP +SGPCheckCertRevocationList=Zkontrolovat zneplatn\u011bn\u00ed certifik\u00e1t\u016f pomoc\u00ed seznamu zneplatn\u011bn\u00ed certifik\u00e1t\u016f (CRL) (nen\u00ed podporov\u00e1no) +SGPEnableOnlineCertValidate=Zapnout online ov\u011b\u0159en\u00ed certifik\u00e1tu (nen\u00ed podporov\u00e1no) +SGPEnableTrustedPublisherList=Zapnout seznam d\u016fv\u011bryhodn\u00fdch vydavatel\u016f (nen\u00ed podporov\u00e1no) +SGPEnableBlacklistRevocation=Zapnout kontrolu zneplatn\u011bn\u00ed oproti \u010dern\u00e9 listin\u011b (nen\u00ed podporov\u00e1no) +SGPEnableCachingPassword=Zapnout ukl\u00e1d\u00e1n\u00ed ov\u011b\u0159ovac\u00edch hesel do vyrovn\u00e1vac\u00ed pam\u011bti (nen\u00ed podporov\u00e1no) +SGPUseSSL2=Pou\u017e\u00edt form\u00e1t ClientHello kompatibiln\u00ed se \u0161ifrov\u00e1n\u00edm SSL 2.0 (nen\u00ed podporov\u00e1no) +SGPUseSSL3=Pou\u017e\u00edt \u0161ifrov\u00e1n\u00ed SSL 3.0 (nen\u00ed podporov\u00e1no) +SGPUseTLS1=Pou\u017e\u00edt \u0161ifrov\u00e1n\u00ed TLS 1.0 (nen\u00ed podporov\u00e1no) + +# Control Panel - TemporaryInternetFilesPanel +TIFPEnableCache=Uchov\u00e1vat do\u010dasn\u00e9 soubory v po\u010d\u00edta\u010di +TIFPLocation=\u00a0Um\u00edst\u011bn\u00ed\u00a0 +TIFPLocationLabel=Vyberte um\u00edst\u011bn\u00ed, kde maj\u00ed b\u00fdt do\u010dasn\u00e9 soubory uchov\u00e1v\u00e1ny. +TIFPChange=Zm\u011bnit +TIFPDiskSpace=\u00a0M\u00edsto na disku\u00a0 +TIFPCompressionLevel=Vyberte \u00farove\u0148 komprese pro soubory JAR +TIFPNone=\u017d\u00e1dn\u00e1 +TIFPMax=Maxim\u00e1ln\u00ed +TIFPCacheSize=Nastavte velikost m\u00edsta na disku ur\u010den\u00e9ho pro do\u010dasn\u00e9 soubory. +TIFPDeleteFiles=Smazat soubory +TIFPViewFiles=Zobrazit soubory... + +# Control Panel - Cache Viewer +CVCPDialogTitle=Prohl\u00ed\u017ee\u010d vyrovn\u00e1vac\u00ed pam\u011bti +CVCPButRefresh=Obnovit +CVCPButDelete=Vymazat +CVCPColLastModified=Posledn\u00ed zm\u011bna +CVCPColSize=Velikost (v bajtech) +CVCPColDomain=Dom\u00e9na +CVCPColType=Typ +CVCPColPath=Cesta +CVCPColName=N\u00e1zev + +# Control Panel - Misc. +CPJRESupport=Aplikace IcedTea-Web v sou\u010dasnosti nepodporuje pou\u017eit\u00ed v\u00edce prost\u0159ed\u00ed JRE. +CPInvalidPort=Zad\u00e1no neplatn\u00e9 \u010d\u00edslo portu\n[Platn\u00e1 \u010d\u00edsla port\u016f: 1 \u2013 65535] +CPInvalidPortTitle=Chyba na vstupu + +# command line control panel +CLNoInfo=Nejsou dostupn\u00e9 \u017e\u00e1dn\u00e9 informace (je pou\u017eit\u00e1 volba platn\u00e1?). +CLValue=Hodnota: {0} +CLValueSource=Zdroj: {0} +CLDescription=Popis: {0} +CLUnknownCommand=Nezn\u00e1m\u00fd p\u0159\u00edkaz {0} +CLUnknownProperty=Nezn\u00e1m\u00fd n\u00e1zev vlastnosti {0} +CLWarningUnknownProperty=VAROV\u00c1N\u00cd: Nezn\u00e1m\u00fd n\u00e1zev vlastnosti {0}. Prob\u00edh\u00e1 vytv\u00e1\u0159en\u00ed nov\u00e9 vlastnosti. +CLNoIssuesFound=Nebyly zaznamen\u00e1ny \u017e\u00e1dn\u00e9 pot\u00ed\u017ee. +CLIncorrectValue=Vlastnost {0} m\u00e1 nespr\u00e1vnou hodnotu {1}. Mo\u017en\u00e9 hodnoty {2}. +CLListDescription=Zobraz\u00ed seznam v\u0161ech n\u00e1zv\u016f vlastnost\u00ed a hodnot, kter\u00e9 jsou vyu\u017e\u00edv\u00e1ny aplikac\u00ed IcedTea-Web. +CLGetDescription=Zobraz\u00ed hodnoty pro n\u00e1zev vlastnosti. +CLSetDescription=P\u0159i\u0159ad\u00ed hodnotu k n\u00e1zvu vlastnosti (pokud je to mo\u017en\u00e9). Kontrola platnosti hodnoty - pokud spr\u00e1vce vlastnost uzamkl, tato funkce nebude m\u00edt \u017e\u00e1dn\u00fd efekt. +CLResetDescription=Resetuje hodnotu n\u00e1zvu vlastnosti na v\u00fdchoz\u00ed hodnotu.\nVolba \u201eall\u201c resetuje v\u0161echny vlastnosti rozpoznan\u00e9 aplikac\u00ed IcedTea-Web na jejich v\u00fdchoz\u00ed hodnoty. +CLInfoDescription=Zobraz\u00ed dal\u0161\u00ed informace o dan\u00e9 vlastnosti. +CLCheckDescription=Zobraz\u00ed v\u0161echny vlastnosti, kter\u00e9 byly definov\u00e1ny, av\u0161ak nebyly rozpozn\u00e1ny aplikac\u00ed IcedTea-Web. +CLHelpDescription=N\u00e1stroj itweb-setting umo\u017e\u0148uje u\u017eivateli upravovat, prohl\u00ed\u017eet a kontrolovat nastaven\u00ed.\nChcete-li pou\u017e\u00edt grafick\u00e9 rozhran\u00ed, nezad\u00e1vejte \u017e\u00e1dn\u00e9 parametry. Chcete-li pou\u017e\u00edt p\u0159\u00edkazovou \u0159\u00e1dku, zadejte pat\u0159i\u010dn\u00fd p\u0159\u00edkaz a parametry. Pot\u0159ebujete-li pomoc s konkr\u00e9tn\u00edm p\u0159\u00edkazem, zkuste zadat p\u0159\u00edkaz {0} s parametrem help. + +# splash screen related +SPLASHerror= Podrobnosti z\u00edsk\u00e1te kliknut\u00edm zde. Do\u0161lo k z\u00e1va\u017en\u00e9 v\u00fdjimce. +SPLASH_ERROR= CHYBA +SPLASHtitle= N\u00e1zev +SPLASHvendor= Dodavatel +SPLASHhomepage= Domovsk\u00e1 str\u00e1nka +SPLASHdescription= Popis +SPLASHClose= Zav\u0159\u00edt +SPLASHclosewAndCopyException= Zav\u0159\u00edt a zkop\u00edrovat v\u00fdpis trasov\u00e1n\u00ed z\u00e1sobn\u00edku do schr\u00e1nky +SPLASHexOccured= Do\u0161lo k z\u00e1va\u017en\u00e9 v\u00fdjimce... +SPLASHHome= Dom\u016f +SPLASHcantCopyEx= Nelze kop\u00edrovat v\u00fdjimku. +SPLASHnoExRecorded= Nebyla zaznamen\u00e1na \u017e\u00e1dn\u00e1 v\u00fdjimka. +SPLASHmainL1= Je\u0161t\u011b v\u00edce informac\u00ed naleznete na webu {0}. Postupujte dle uveden\u00fdch krok\u016f, abyste z\u00edskali informace nebo nahl\u00e1sili chybu. +SPLASHurl= http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs +SPLASHurlLooks= http://icedtea.classpath.org/wiki/IcedTea-Web +SPLASHmainL3= Nejsou dostupn\u00e9 \u017e\u00e1dn\u00e9 dal\u0161\u00ed informace. Zkuste spustit prohl\u00ed\u017ee\u010d z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky a analyzovat v\u00fdstup. +SPLASHcloseAndCopyShorter= Zav\u0159\u00edt a kop\u00edrovat do schr\u00e1nky +SPLASHmainL4= Do\u0161lo k n\u00e1sleduj\u00edc\u00ed v\u00fdjimce. Chcete-li v\u00edce informac\u00ed, zkuste spustit prohl\u00ed\u017ee\u010d z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky a analyzovat v\u00fdstup. +SPLASHexWas= Zaznamenan\u00e1 v\u00fdjimka: +SPLASHcfl= Nelze \u010d\u00edst odkaz +SPLASHvendorsInfo= Informace od dodavatele va\u0161\u00ed aplikace +SPLASHanotherInfo= Dal\u0161\u00ed dostupn\u00e9 informace +SPLASHdefaultHomepage= Nen\u00ed definov\u00e1n atribut \u201ehomepage\u201c, rad\u011bji ov\u011b\u0159te zdroj. +SPLASHerrorInInformation= Chyba p\u0159i na\u010d\u00edt\u00e1n\u00ed elementu \u201einformation\u201c, rad\u011bji ov\u011b\u0159te zdroj. +SPLASHmissingInformation= Chyb\u00ed element \u201einformation\u201c, rad\u011bji ov\u011b\u0159te zdroj. +SPLASHchainWas= Toto je seznam v\u00fdjimek, ke kter\u00fdm do\u0161lo p\u0159i spou\u0161t\u011bn\u00ed appletu. Vezm\u011bte na v\u011bdom\u00ed, \u017ee zdroji uveden\u00fdch v\u00fdjimek m\u016f\u017ee b\u00fdt v\u00edce r\u016fzn\u00fdch applet\u016f. Abyste mohli vytvo\u0159it u\u017eite\u010dn\u00e9 hl\u00e1\u0161en\u00ed o chyb\u011b, ujist\u011bte se, \u017ee b\u011b\u017e\u00ed pouze jeden applet. + +APPEXTSECappletSecurityLevelExtraHighId=Vypn\u011bte b\u011bh v\u0161ech applet\u016f prost\u0159ed\u00ed Java. +APPEXTSECappletSecurityLevelVeryHighId=Velmi vysok\u00e1 \u00farove\u0148 zabezpe\u010den\u00ed +APPEXTSECappletSecurityLevelHighId=Vysok\u00e1 \u00farove\u0148 zabezpe\u010den\u00ed +APPEXTSECappletSecurityLevelLowId=N\u00edzk\u00e1 \u00farove\u0148 zabezpe\u010den\u00ed +APPEXTSECappletSecurityLevelExtraHighExplanation=Nebude spu\u0161t\u011bn \u017e\u00e1dn\u00fd applet. +APPEXTSECappletSecurityLevelVeryHighExplanation=Nebude spu\u0161t\u011bn \u017e\u00e1dn\u00fd nepodepsan\u00fd applet. +APPEXTSECappletSecurityLevelHighExplanation=U\u017eivatel bude dot\u00e1z\u00e1n na spu\u0161t\u011bn\u00ed ka\u017ed\u00e9ho nepodepsan\u00e9ho appletu. +APPEXTSECappletSecurityLevelLowExplanation=Budou spu\u0161t\u011bny v\u0161echny applety (dokonce i ty nepodepsan\u00e9). +APPEXTSECunsignedAppletActionAlways=V\u017edy d\u016fv\u011b\u0159ovat t\u011bmto (odpov\u00eddaj\u00edc\u00edm) applet\u016fm +APPEXTSECunsignedAppletActionNever=Nikdy ned\u016fv\u011b\u0159ovat t\u011bmto (odpov\u00eddaj\u00edc\u00edm) applet\u016fm +APPEXTSECunsignedAppletActionYes=Tento applet byl zhl\u00e9dnut a povolen. +APPEXTSECunsignedAppletActionNo=Tento applet byl zhl\u00e9dnut a odm\u00edtnut. +APPEXTSECControlPanelExtendedAppletSecurityTitle=Roz\u0161\u00ed\u0159en\u00e9 zabezpe\u010den\u00ed applet\u016f +APPEXTSECguiTableModelTableColumnAction=Akce +APPEXTSECguiTableModelTableColumnDateOfAction=Datum akce +APPEXTSECguiTableModelTableColumnDocumentBase=Z\u00e1kladn\u00ed adresa (document-base) +APPEXTSECguiTableModelTableColumnCodeBase=Z\u00e1kladna k\u00f3du (code-base) +APPEXTSECguiTableModelTableColumnArchives=Arch\u00edvy +APPEXTSECguiPanelAppletInfoHederPart1={0} {1} +APPEXTSECguiPanelAppletInfoHederPart2={0} z {1} +APPEXTSECguiPanelConfirmDeletionOf=Skute\u010dn\u011b chcete odstranit n\u00e1sleduj\u00edc\u00ed po\u010det polo\u017eek: {0}? +APPEXTSECguiPanelHelpButton=N\u00e1pov\u011bda +APPEXTSECguiPanelSecurityLevel=\u00darove\u0148 zabezpe\u010den\u00ed +APPEXTSECguiPanelGlobalBehaviourCaption=Nastaven\u00ed glob\u00e1ln\u00edho chov\u00e1n\u00ed applet\u016f +APPEXTSECguiPanelDeleteMenuSelected=vybran\u00e9 +APPEXTSECguiPanelDeleteMenuAllA=v\u0161echny povolen\u00e9 (A) +APPEXTSECguiPanelDeleteMenuAllN=v\u0161echny zak\u00e1zan\u00e9 (N) +APPEXTSECguiPanelDeleteMenuAlly=v\u0161echny schv\u00e1len\u00e9 (y) +APPEXTSECguiPanelDeleteMenuAlln=v\u0161echny odm\u00edtnut\u00e9 (n) +APPEXTSECguiPanelDeleteMenuAllAll=\u00fapln\u011b v\u0161echny +APPEXTSECguiPanelDeleteButton=Vymazat +APPEXTSECguiPanelDeleteButtonToolTip=V pr\u016fb\u011bhu proch\u00e1zen\u00ed tabulky m\u016f\u017eete stisknout kl\u00e1vesu Delete. T\u00edm provedete akci odstranit vybran\u00e9. +APPEXTSECguiPanelTestUrlButton=Otestovat URL +APPEXTSECguiPanelAddRowButton=P\u0159idat \u0159\u00e1dek +APPEXTSECguiPanelValidateTableButton=Ov\u011b\u0159it tabulku +APPEXTSECguiPanelAskeforeActionBox=P\u0159ed akc\u00ed se dot\u00e1zat +APPEXTSECguiPanelShowRegExesBox=Uk\u00e1zat \u00fapln\u00e9 regul\u00e1rn\u00ed v\u00fdrazy +APPEXTSECguiPanelInverSelection=P\u0159evr\u00e1tit v\u00fdb\u011br +APPEXTSECguiPanelMoveRowUp=Posunout \u0159\u00e1dek nahoru +APPEXTSECguiPanelMoveRowDown=Posunout \u0159\u00e1dek dol\u016f +APPEXTSECguiPanelCustomDefs=Vlastn\u00ed definice +APPEXTSECguiPanelGlobalDefs=Glob\u00e1ln\u00ed definice +APPEXTSECguiPanelDocTest=Zadejte URL z\u00e1kladn\u00ed adresy (document base) +APPEXTSECguiPanelCodeTest=Zadejte URL z\u00e1kladny k\u00f3du (code base) +APPEXTSECguiPanelNoMatch=\u017d\u00e1dn\u00e1 shoda +APPEXTSECguiPanelMatchingNote=Vezm\u011bte na v\u011bdom\u00ed, \u017ee jako v\u00fdsledek bude br\u00e1n pouze prvn\u00ed shodn\u00fd v\u00fdskyt. +APPEXTSECguiPanelMatched=Shody +APPEXTSECguiPanelMatchingError=Chyba p\u0159i hled\u00e1n\u00ed shody: {0} +APPEXTSECguiPanelCanNotValidate=Nelze ov\u011b\u0159it, nebo nelze vytvo\u0159it soubor tmp \u2013 {0}. +APPEXTSECguiPanelEmptyDoc=V\u0161echny z\u00e1kladn\u00ed adresy (document-bases) musej\u00ed b\u00fdt vypln\u011bny. +APPEXTSECguiPanelEmptyCode=V\u0161echny z\u00e1kladny k\u00f3du (code-bases) musej\u00ed b\u00fdt vypln\u011bny. +APPEXTSECguiPanelTableValid=Zd\u00e1 se, \u017ee tabulka je v po\u0159\u00e1dku. +APPEXTSECguiPanelTableInvalid=Tabulka je neplatn\u00e1. Chyba: {0} +APPEXTSECguiPanelShowOnlyPermanent=Zobrazit pouze trval\u00e9 z\u00e1znamy +APPEXTSECguiPanelShowOnlyTemporal=Zobrazit pouze ji\u017e d\u0159\u00edve do\u010dasn\u011b povolen\u00e9 nebo zak\u00e1zan\u00e9 z\u00e1znamy +APPEXTSECguiPanelShowAll=Zobrazit v\u0161echny z\u00e1znamy +APPEXTSECguiPanelShowOnlyPermanentA=Zobrazit pouze povolen\u00e9 trval\u00e9 z\u00e1znamy +APPEXTSECguiPanelShowOnlyPermanentN=Zobrazit pouze zak\u00e1zan\u00e9 trval\u00e9 z\u00e1znamy +APPEXTSECguiPanelShowOnlyTemporalY=Zobrazit pouze d\u0159\u00edve povolen\u00e9 z\u00e1znamy applet\u016f +APPEXTSECguiPanelShowOnlyTemporalN=Zobrazit pouze d\u0159\u00edve zak\u00e1zan\u00e9 z\u00e1znamy applet\u016f +APPEXTSEChelpHomeDialogue=Odstavec o dialogu \ No newline at end of file diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/Messages_de.properties icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/Messages_de.properties --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/Messages_de.properties 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/Messages_de.properties 2013-05-03 19:08:24.252520097 +0000 @@ -0,0 +1,573 @@ +# German UI messages for netx +# L=Launcher, B=Boot, P=Parser, C=cache S=security +# +# General +NullParameter=Nullparameter +ButAllow=Zulassen +ButBrowse=Durchsuchen... +ButCancel=\ Abbrechen +ButClose=Schlie\u00dfen +ButCopy=In die Zwischenablage kopieren +ButMoreInformation=Weitere\u00a0Informationen... +ButOk=OK +ButProceed=Fortfahren +ButRun=Ausf\u00fchren +ButApply=Anwenden +ButDone=Fertig +ButShowDetails=Details zeigen +ButHideDetails=Details verbergen + +AFileOnTheMachine=eine Datei auf dem Rechner +AlwaysAllowAction=Diese Aktion immer zulassen +Usage=Gebrauch: +Error=Fehler + +Continue=Soll fortgefahren werden? +Field=Feld +From=Von +Name=Name +Password=Kennwort: +Publisher=Herausgeber +Unknown= +Username=Benutzername: +Value=Wert +Version=Version + +# LS - Severity +LSMinor=Gering +LSFatal=Fatal + +# LC - Category +LCSystem=Systemfehler +LCExternalLaunch=Externer Startfehler +LCFileFormat=Dateiformatfehler +LCReadError=Lesefehler +LCClient=Anwendungsfehler +LCLaunching=Startfehler +LCNotSupported=Nicht unterst\u00fctztes Feature +LCInit=Initialisierungsfehler +LAllThreadGroup=Alle JNLP Anwendungen +LNullUpdatePolicy=Aktualisierungsrichtlinie darf nicht null sein. + +LThreadInterrupted=Ausf\u00fchrungsstrang unterbrochen, w\u00e4hrend auf den Start der Datei gewartet wird. +LThreadInterruptedInfo=Dies kann zum Einfrieren oder sonstigen Sch\u00e4den w\u00e4hrend der Ausf\u00fchrung f\u00fchren. Bitte die Anwendung oder den Web-Browser neustarten. +LCouldNotLaunch=Konnte JNLP-Datei nicht starten. +LCouldNotLaunchInfo=Die Anwendung war nicht initialisiert. Um detailierte Informationen zu erhalten k\u00f6nnen javaws oder der Web-Browser von der Befehlszeile aus gestartet werden und die Textausgabe in einem Fehlerbericht gesendet werden. +LCantRead=Konnte die JNLP-Datei nicht lesen oder die Syntax analysieren. +LCantReadInfo=Die Datei kann m\u00f6glicherweise manuell heruntergeladen und als Fehlerbericht an das IcedTea-Web Team gesendet werden. +LNullLocation=Konnte den Ort der .jnlp Datei nicht bestimmen. +LNullLocationInfo=Es wurde versucht eine JNLP-Datei in einer anderen JVM zu starten, aber die Datei konnte am Ort nicht ermittelt werden. Um in einer externen JVM zu starten, muss die Laufzeitumgebung in der Lage sein die .jnlp Datei entweder auf dem lokalen Dateisystem oder einem Server zu ermitteln. +LNetxJarMissing=Konnte den Ort von netx.jar nicht bestimmen. +LNetxJarMissingInfo=Ein wurde versucht eine JNLP-Datei in einer anderen JVM zu starten, aber das netx.jar konnte am Ort nicht ermittelt werden. Um in einer externen JVM zu starten, muss die Laufzeitumgebung in der Lage sein das netx.jar zu ermitteln. +LNotToSpec=JNLP-Datei nicht strikt nach Spezifikation. +LNotToSpecInfo=Die JNLP-Datei enth\u00e4lt Daten, die nach JNLP Spezifikation verboten sind. Die Laufzeitumgebung kann versuchen die ung\u00fcltigen Information zu ignorieren und die Datei zu starten fortfahren. +LNotApplication=Keine Anwendungsdatei. +LNotApplicationInfo=Es wurde versucht eine Nichtanwendungsdatei als eine Anwendung zu laden. +LNotApplet=Keine Applet-Datei. +LNotAppletInfo=Es wurde versucht eine Nichtappletdatei als ein Applet zu laden. +LNoInstallers=Installer werden nicht unterst\u00fctzt. +LNoInstallersInfo=JNLP Installerdateien werden noch nicht unterst\u00fctzt. +LInitApplet=Konnte Applet nicht initialisieren. +LInitAppletInfo=Um weitere Information zu erhalten, bitte den Knopf \u201eWeitere Informationen\u201c klicken. +LInitApplication=Konnte Anwendung nicht initialisieren. +LInitApplicationInfo=Die Anwendung war nicht initialisiert. Um weitere Informationen zu erhalten kann javaws von der Befehlszeile aus ausgef\u00fchrt werden. +LNotLaunchable=Keine startbare JNLP-Datei. +LNotLaunchableInfo=Datei muss ein JNLP Anwendungs-, Applet- oder Installertyp sein. +LCantDetermineMainClass=Unbekannte Hauptklasse. +LCantDetermineMainClassInfo=Konnte die Hauptklasse f\u00fcr diese Anwendung nicht bestimmen. +LUnsignedJarWithSecurity=Kann keine Berechtigungen nicht signierten Jars gew\u00e4hren. +LUnsignedJarWithSecurityInfo=Anwendung hat Sicherheitsberechtigungen angefordert, aber Jars sind nicht signiert. +LSignedJNLPAppDifferentCerts=Die JNLP Anwendung ist nicht vollst\u00e4ndig durch ein einzelnes Zertifikat signiert. +LSignedJNLPAppDifferentCertsInfo=Der JNLP Anwendung wurden ihre Komponenten individuell signiert, jedoch muss es einen gemeinsamen Unterzeichner zu allen Eintr\u00e4gen geben. +LUnsignedApplet=Das Applet war nicht signiert. +LUnsignedAppletPolicyDenied=Das Applet war nicht signiert, deshalb wurde es an der Ausf\u00fchrung durch die Sicherheitsrichtlinie gehindert. +LUnsignedAppletUserDenied=Das Applet war nicht signiert und nicht vertrauensw\u00fcrdig. +LSignedAppJarUsingUnsignedJar=Signierte Anwendung nutzt nicht signierte Jars. +LSignedAppJarUsingUnsignedJarInfo=Das Haupt-Jar der Anwendung ist signiert, aber manche Jars, die sie nutzt sind nicht. +LSignedJNLPFileDidNotMatch=Die signierte JNLP-Datei stimmt nicht mit der startenden JNLP-Datei \u00fcberein. +LNoSecInstance=Fehler: Keine Sicherheitsinstanz f\u00fcr {0}. Die Anwendung k\u00f6nnte Schwierigkeiten haben fortzufahren +LCertFoundIn={0} in cacerts gefunden ({1}) +LSingleInstanceExists=Eine andere Instanz dieses Applets existiert bereits und nur eine kann zur selben Zeit ausgef\u00fchrt werden. + +JNotApplet=Datei ist kein Applet. +JNotApplication=Datei ist keine Anwendung. +JNotComponent=Datei ist keine Komponente. +JNotInstaller=Datei ist kein Installer. +JInvalidExtensionDescriptor=Erweiterung verweist nicht auf eine Komponente oder einen Installer (Name={1}, Ort={2}). + +LNotVerified=Jars nicht verifiziert. +LCancelOnUserRequest=Abgebrochen auf Anfrage des Benutzers. +LFatalVerification=W\u00e4hrend des Versuchs Jars zu verifizieren, ist ein fataler Fehler aufgetreten. +LFatalVerificationInfo=Eine Ausnahme in der Klasse JarCertVerifier wurde abgefangen. Die Unlesbarkeit der Dateien cacerts oder trusted.certs k\u00f6nnte eine Ursache dieser Ausnahmen sein. + + +LNotVerifiedDialog=Nicht alle Jars konnten verifiziert werden. +LAskToContinue=Soll die Ausf\u00fchrung dieser Anwendung dennoch fortgesetzt werden? + +# Parser +PInvalidRoot=Der Wurzelknoten ist nicht das Element jnlp +PNoResources=Kein Element resources angeben +PUntrustedNative=Das Element nativelib kann nicht angegeben werden sofern eine vertrauensw\u00fcrdige Umgebung angefordert wird. +PExtensionHasJ2SE=Das Element j2se kann nicht in einer Komponentenerweiterungsdatei angegeben werden. +PInnerJ2SE=Das Element j2se kann nicht innerhalb eines j2se-Elements angegeben werden. +PTwoMains=Doppeltes main JAR in einem resources-Element definiert (es kann nur eins geben) +PNativeHasMain=Das Attribut main darf nicht am Element nativelib angeben werden +PNoInfoElement=Kein Element information angegeben +PMissingTitle=Titel +PMissingVendor=Lieferant +PMissingElement=Der Abschnitt {0} wurde f\u00fcr das aktive Gebietsschema nicht definiert, noch existiert ein Standardwert in der JNLP-Datei. +PTwoDescriptions=Doppelte Elemente description mit Attribut kind {0} sind nicht erlaubt. +PSharing=Das Element \u201esharing-allowed\u201c ist in einer Standard-JNLP-Datei nicht erlaubt +PTwoSecurity=Nur ein Element security pro JNLP-Datei zugelassen. +PEmptySecurity=Security-Element angegeben, enth\u00e4lt aber das Element permissions nicht. +PTwoDescriptors=Nur ein Element application-desc pro JNLP-Datei zugelassen. +PTwoDesktops=Nur ein Element desktop zugelassen +PTwoMenus=Nur ein Element menu zugelassen +PTwoTitles=Nur ein Element title zugelassen +PTwoIcons=Nur ein Element icon zugelassen +PTwoUpdates=Nur ein Element update ist zugelassen +PUnknownApplet=Unbekanntes Applet +PBadWidth=Ung\u00fcltige Appletbreite. +PBadHeight=Ung\u00fcltige Appleth\u00f6he. +PUrlNotInCodebase=Relative URL gibt kein Unterverzeichnis der Codebasis an. (Knoten={0}, href={1}, Basis={2}) +PBadRelativeUrl=Ung\u00fcltige relative URL (Knoten={0}, href={1}, Basis={2}) +PBadNonrelativeUrl=Ung\u00fcltige nicht-relative URL (Knoten={0}, href={1}) +PNeedsAttribute=Das {0} Element muss ein {1} Attribut angeben. +PBadXML=Ung\u00fcltige XML Dokumentsyntax. +PBadHeapSize=Ung\u00fcltiger Wert f\u00fcr die Gr\u00f6\u00dfe des dynamischen Speichers ({0}) + +# Runtime +BLaunchAbout=Das Fenster \u201e\u00dcber IcedTea-Web\u201c wird ge\u00f6ffnet... +BNeedsFile=Muss eine .jnlp Datei angeben +RNoAboutJnlp=Es ist nicht m\u00f6glich about.jnlp zu finden +BFileLoc=JNLP-Dateiort +BBadProp=Falsches Eigenschaftformat {0} (sollte Schl\u00fcssel=Wert sein) +BBadParam=Falsches Parameterformat {0} (sollte Name=Wert sein) +BNoDir=Verzeichnis {0} existiert nicht. +BNoCodeOrObjectApplet=Die Auszeichnung applet muss ein Attribut 'code' oder 'object' angegeben. +RNoResource=Fehlende Ressource: {0} +RShutdown=Diese Ausnahme um Herunterfahren der JVM zu verhindern, aber der Prozess wurde terminiert. +RExitTaken=Ausstiegsklasse bereits gesetzt und Aufrufender ist keine Ausstiegsklasse. +RCantReplaceSM=Wechseln des SecurityManager ist nicht zugelassen. +RCantCreateFile=Kann Datei {0} nicht erstellen +RCantDeleteFile=Kann Datei {0} nicht l\u00f6schen +RRemoveRPermFailed=Entfernen der Leseberechtigung f\u00fcr Datei {0} schlug fehl +RRemoveWPermFailed=Entfernen der Schreibberechtigungen f\u00fcr Datei {0} schlug fehl +RRemoveXPermFailed=Entfernen der Ausf\u00fchrberechtigungen f\u00fcr Datei {0} schlug fehl +RGetRPermFailed=Erwerben der Leseberechtigungen f\u00fcr Datei {0} schlug fehl +RGetWPermFailed=Erwerben der Schreibberechtigungen f\u00fcr Datei {0} schlug fehl +RGetXPermFailed=Erwerben der Ausf\u00fchrberechtigungen f\u00fcr Datei {0} schlug fehl +RCantCreateDir=Kann Verzeichnis {0} nicht erstellen +RCantRename=Kann {0} nicht in {1} umbenennen +RDenyStopped=Angehaltene Anwendungen haben keine Berechtigungen. +RExitNoApp=Kann die JVM nicht beenden, da die gegenw\u00e4rtige Anwendung nicht bestimmt werden kann. +RNoLockDir=Kann Ausschlussverzeichnis nicht erstellen ({0}) +RNestedJarExtration=Kann verschachteltes Jar nicht extrahieren. +RUnexpected=Unerwartetes {0} bei {1} +RConfigurationError=Fataler Fehler beim Lesen der Konfiguration +RConfigurationFatal=FEHLER: Ein fataler Fehler ist beim Laden der Konfiguration aufgetreten. Vielleicht war eine globale Konfiguration erforderlich, konnte jedoch nicht gefunden werden +RPRoxyPacNotSupported=Die Verwendung von Autoproxykonfigurationsdateien (PAC) wird nicht unterst\u00fctzt. +RProxyFirefoxNotFound=Es ist nicht m\u00f6glich Firefoxs Proxyeinstellungen zu verwenden. Nutze \u201eDIRECT\u201c als Proxytyp. +RProxyFirefoxOptionNotImplemented=Browserproxyoption \u201e{0}\u201c ({1}) wird noch nicht unterst\u00fctzt. +RBrowserLocationPromptTitle=Browserort +RBrowserLocationPromptMessage=Bitte den Ort des Browsers angeben +RBrowserLocationPromptMessageWithReason=Bitte den Ort des Browsers angeben (der Browserbefehl \u201e{0}\u201c ist ung\u00fcltig). + +# Boot options, message should be shorter than this ----------------> +BOUsage=javaws [-Ausf\u00fchrungsoptionen] +BOUsage2=javaws [-Steuerungsoptionen] +BOJnlp=Ort der zu startenden JNLP-Datei (URL oder Datei). +BOArg=F\u00fcgt einen Anwendungsparameter vor dem Start hinzu. +BOParam=F\u00fcgt einen Appletparameter vor dem Start hinzu. +BOProperty=Setzt eine Systemeigenschaft vor dem Start. +BOUpdate=Pr\u00fcfe auf Aktualisierungen. +BOLicense=Die GPL Lizenz zeigen und beenden. +BOVerbose=Ausf\u00fchrliche Ausgabe aktivieren. +BOAbout=Zeigt eine Beispielanwendung. +BONosecurity=Deaktiviert die sichere Laufzeitumgebung. +BONoupdate=Deaktiviert die Pr\u00fcfung nach Aktualisierungen. +BOHeadless=Deaktiviert Herunterladefenster, andere Benutzeroberfl\u00e4chen. +BOStrict=Aktiviert die strikte Pr\u00fcfung des JNLP-Dateiformats. +BOViewer=Zeigt die Ansicht der vertrauensw\u00fcrdigen Zertifikate. +BXnofork=Keine weitere JVM erstellen. +BXclearcache=Den JNLP-Anwendungszwischenspeicher s\u00e4ubern. +BXignoreheaders=Die Pr\u00fcfung der Metadaten von Jar-Dateien auslassen. +BOHelp=Diese Meldung ausgeben und beenden. + +# Cache +CAutoGen=Automatisch generiert - Nicht editieren! +CNotCacheable={0} ist keine zwischenspeicherbare Ressource +CDownloading=Herunterladen +CComplete=Vollst\u00e4ndig +CChooseCache=Ein Zwischenspeicherverzeichnis w\u00e4hlen... +CChooseCacheInfo=Netx ben\u00f6tigt einen Ort zur Ablage von Zwischenspeicherdateien. +CChooseCacheDir=Zwischenspeicherverzeichnis +CCannotClearCache=Kann den Zwischenspeicher zur Zeit nicht s\u00e4ubern +CFakeCache=Der Zwischenspeicher ist durcheinander; wird geordnet. +CFakedCache=Der Zwischenspeicher war durcheinander und wurde geordnet. Es wird strengstens empfohlen, dass \u201ejavaws -Xclearcache\u201c und anschlie\u00dfend die Anwendung ausgef\u00fchrt wird. + +# Security +SFileReadAccess=Die Anwendung hat Lesezugriff auf {0} angefordert. Soll diese Aktion zugelassen werden? +SFileWriteAccess=Die Anwendung hat Schreibzugriff auf {0} angefordert. Soll diese Aktion zugelassen werden? +SDesktopShortcut=Die Anwendung hat die Berechtigung eine Verkn\u00fcpfung auf dem Desktop zu erstellen angefordert. Soll diese Aktion zugelassen werden? +SSigUnverified=Die digitale Signatur der Anwendung konnte nicht verifiziert werden. Soll die Anwendung zur Ausf\u00fchrung gebracht werden? +SSigVerified=Die digitale Signatur der Anwendung wurde verifiziert. Soll die Anwendung zur Ausf\u00fchrung gebracht werden? +SSignatureError=Die digitale Signatur der Anwendung hat einen Fehler. Soll die Anwendung zur Ausf\u00fchrung gebracht werden? +SUntrustedSource=Die digitale Signatur konnte nicht durch eine vertrauensw\u00fcrdige Quelle verifiziert werden. Die Anwendung sollte nur zur Ausgef\u00fchrung gebracht werden, wenn der Ursprung der Anwendung vertrauensw\u00fcrdig ist. +SWarnFullPermissionsIgnorePolicy=Dem ausgef\u00fchrten Code werden volle Berechtigungen erteilt, wobei jedwede Java-Richtlinien, die eingerichtet sein k\u00f6nnten, ignoriert werden. +STrustedSource=Die digitale Signatur wurde durch eine vertrauensw\u00fcrdige Quelle best\u00e4tigt. +SClipboardReadAccess=Die Anwendung hat den ausschlie\u00dflichen Lesezugriff auf die Systemzwischenablage angefordert. Soll diese Aktion zugelassen werden? +SClipboardWriteAccess=Die Anwendung hat den ausschlie\u00dflichen Schreibzugriff auf die Systemzwischenablage angefordert. Soll diese Aktion zugelassen werden? +SPrinterAccess=Die Anwendung hat den Druckerzugriff angefordert. Soll diese Aktion zugelassen werden? +SNetworkAccess=Die Anwendung hat die Berechtigung Verbindungen zu {0} herzustellen angefordert. Soll diese Aktion zugelassen werden? +SNoAssociatedCertificate= +SUnverified=(nicht verifiziert) +SAlwaysTrustPublisher=Dem Inhalt von diesem Herausgeber immer vertrauen +SHttpsUnverified=Das HTTPS Zertifikat dieser Website kann nicht verifiziert werden. +SRememberOption=Soll diese Option gespeichert werden? +SRememberAppletOnly=F\u00fcr Applet +SRememberCodebase=F\u00fcr Website {0} +SUnsignedSummary=Eine nicht signierte Java Anwendung m\u00f6chte zur Ausf\u00fchrung gebracht werden. +SUnsignedDetail=Eine nicht signierte Anwendung am folgenden Ort m\u00f6chte zur Ausf\u00fchrung gebracht werden:
  {0}
Seite, welche die Anforderung gestellt hat:
  {1}

Es wird empfohlen ausschlie\u00dflich Anwendungen zur Ausf\u00fchrung zu bringen, die von vertrauensw\u00fcrdigen Websites stammen. +SUnsignedAllowedBefore=Dieses Applet wurde bereits akzeptiert. +SUnsignedRejectedBefore=Dieses Applet wurde bereits abgelehnt. +SUnsignedQuestion=Soll dem Applet die Ausf\u00fchrung erlaubt werden? +SNotAllSignedSummary=Nur Teile des Anwendungscodes sind signiert. +SNotAllSignedDetail=Diese Anwendung enth\u00e4lt sowohl signierten als auch nicht signierten Code. W\u00e4hrend signierter Code sicher ist, wenn Sie dem Anbieter vertrauen, kann nicht signierter Code sich \u00fcber Code erstrecken, der sich der Kontrolle des Anbieters entzieht. +SNotAllSignedQuestion=Soll fortgefahren und diese Anwendung dennoch zur Ausf\u00fchrung gebracht werden? +SAuthenticationPrompt=Der Server {0} von {1} fordert Authentifizierung an. Er sagt: \u201e{2}\u201c +SJNLPFileIsNotSigned=Die Anwendung enth\u00e4lt eine digitale Signatur in der, die startende JNLP-Datei nicht signiert ist. + +# Security - used for the More Information dialog +SBadKeyUsage=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikaterweiterung KeyUsage die Codesignatur nicht zul\u00e4sst. +SBadExtendedKeyUsage=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikaterweiterung ExtendedKeyUsage die Codesignatur nicht zul\u00e4sst. +SBadNetscapeCertType=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikaterweiterung NetscapeCertType die Codesignatur nicht zul\u00e4sst. +SHasExpiredCert=Die digitale Signatur ist abgelaufen. +SHasExpiringCert=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikat innerhalb von 6 Monaten ablaufen wird. +SNotYetValidCert=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikat noch nicht g\u00fcltig ist. +SUntrustedCertificate=Die digitale Signatur wurde mit einem nicht vertrauensw\u00fcrdigen Zertifikat generiert. +STrustedCertificate=Die digitale Signatur wurde mit einem vertrauensw\u00fcrdigen Zertifikat generiert. +SCNMisMatch=Der erwartete Hostname f\u00fcr dieses Zertifikat ist: \u201e{0}\u201c
Die Adresse zu der verbunden wird ist: \u201e{1}\u201c +SRunWithoutRestrictions=Diese Anwendung wird ohne die von Java normalerweise gebotenen Sicherheitsbeschr\u00e4nkungen ausgef\u00fchrt werden. +SCertificateDetails=Zertifikatdetails + +# Security - certificate information +SIssuer=Aussteller +SSerial=Seriennummer +SMD5Fingerprint=MD5 Fingerabdruck +SSHA1Fingerprint=SHA1 Fingerabdruck +SSignature=Signatur +SSignatureAlgorithm=Signaturalgorithmus +SSubject=Inhaber +SValidity=G\u00fcltigkeit + +# Certificate Viewer +CVCertificateViewer=Zertifikate +CVCertificateType=Zertifikattyp +CVDetails=Details +CVExport=Exportieren +CVExportPasswordMessage=Kennwort eingeben, um Schl\u00fcsseldatei zu sch\u00fctzen: +CVImport=Importieren +CVImportPasswordMessage=Kennwort eingeben, um auf Datei zuzugreifen: +CVIssuedBy=Ausgestellt von +CVIssuedTo=Ausgestellt f\u00fcr +CVPasswordTitle=Authentifizierung erforderlich +CVRemove=Entfernen +CVRemoveConfirmMessage=Soll das markierte Zertifikat wirklich entfernt werden? +CVRemoveConfirmTitle=Zertifikat entfernen +CVUser=Benutzer +CVSystem=System + +KS=Schl\u00fcsselspeicher +KSCerts=Vertrauensw\u00fcrdige Zertifikate +KSJsseCerts=Vertrauensw\u00fcrdige JSSE Zertifikate +KSCaCerts=Vertrauensw\u00fcrdige Stammzertifizierungsstellenzertifikate +KSJsseCaCerts=Vertrauensw\u00fcrdige JSSE Stammzertifizierungsstellenzertifikate +KSClientCerts=Clientauthentifizierungszertifikate + +# Deployment Configuration messages +DCIncorrectValue=Die Eigenschaft \u201e{0}\u201c hat den falschen Wert \u201e{1}\u201c. M\u00f6gliche Werte {2}. +DCInternal=Interner Fehler: {0} +DCSourceInternal= +DCUnknownSettingWithName=Die Eigenschaft \u201e{0}\u201c ist unbekannt. + +# Value Validator messages. Messages should follow "Possible values ..." +VVPossibleValues=M\u00f6gliche Werte {0} +VVPossibleBooleanValues=sind {0} oder {1} +VVPossibleFileValues=sind ein absoluter Pfad zu einer Datei oder einem Verzeichnis +VVPossibleRangedIntegerValues=liegen im Bereich von {0} bis {1} (inklusive) +VVPossibleUrlValues=sind jede g\u00fcltige URL (z.B. http://icedtea.classpath.org/hg/) + +# Control Panel - Main +CPMainDescriptionShort=IcedTea-Web Konfigurieren +CPMainDescriptionLong=Konfiguriert, wie das Browser-Plugin (IcedTeaNPPlugin) und javaws (NetX) arbeiten + +# Control Panel - Tab Descriptions +CPAboutDescription=Versionsinformationen \u00fcber die IcedTea Systemsteuerung anzeigen. +CPNetworkSettingsDescription=Netzwerkeinstellungen konfigurieren, inklusive wie IcedTea-Web sich mit dem Internet verbindet und ob Proxys verwendet werden. +CPTempInternetFilesDescription=Java h\u00e4lt Anwendungsdaten f\u00fcr eine schnellere Ausf\u00fchrung beim n\u00e4chsten Start vor. +CPJRESettingsDescription=Java Runtime Environment Versionen und Einstellungen zu Java Anwendungen sowie Applets anzeigen und verwalten. +CPCertificatesDescription=Nutzen Sie Zertifikate um sich erfolgreich auszuweisen sowie die Identit\u00e4t von Zertifikatinhabern, Zertifizierungsstellen und Herausgebern festzustellen. +CPSecurityDescription=Dies zur Konfiguration von Sicherheitseinstellungen nutzen. +CPDebuggingDescription=Hier Optionen aktivieren um bei der Fehlerbeseitigung zu helfen +CPDesktopIntegrationDescription=Die Erstellung von Desktopverkn\u00fcpfungen zulassen oder verhindern. +CPJVMPluginArguments=JVM-Argumente f\u00fcr das Plugin setzen. +CPJVMitwExec=Eine JVM f\u00fcr IcedTea-Web einstellen, welche am besten mit OpenJDK funktioniert +CPJVMitwExecValidation=JVM f\u00fcr IcedTea-Web pr\u00fcfen +CPJVMPluginSelectExec=Nach JVM f\u00fcr IcedTea-Web durchsuchen +CPJVMnone=Kein Pr\u00fcfergebnis f\u00fcr +CPJVMvalidated=Pr\u00fcfergebnis f\u00fcr +CPJVMvalueNotSet=Kein Wert angegeben. Die fest eincodierte JVM wird verwendet. +CPJVMnotLaunched=Fehler: Der Prozess wurde nicht gestartet. F\u00fcr weitere Informationen, bitte die Konsolenausgabe beachten. +CPJVMnoSuccess=Der Prozess wurde mit einem Fehler beendet. Bitte die Ausgabe f\u00fcr weitere Details beachten. Die Java-Laufzeitumgebung ist nicht korrekt eingestellt. +CPJVMopenJdkFound=Exzellent, OpenJDK wurde erkannt +CPJVMoracleFound=Gro\u00dfartig, Oracle Java wurde erkannt +CPJVMibmFound=Gut, IBM Java wurde erkannt +CPJVMgijFound=Warnung, gij wurde erkannt +CPJVMstrangeProcess=Der Pfad hatte einen ausf\u00fchrbaren Prozess, aber dies wurde nicht erkannt. Bitte die Java-Version anhand der Konsolenausgabe \u00fcberpr\u00fcfen. +CPJVMnotDir=Fehler: Der gew\u00e4hlte Pfad ist kein Verzeichnis. +CPJVMisDir=Der gew\u00e4hlte Pfad is ein Verzeichnis. +CPJVMnoJava=Fehler: Das gew\u00e4hlte Verzeichnis enth\u00e4lt bin/java nicht. +CPJVMjava=Das gew\u00e4hlte Verzeichnis enth\u00e4lt bin/java. +CPJVMnoRtJar=Fehler: Das gew\u00e4hlte Verzeichnis enth\u00e4lt lib/rt.jar nicht. +CPJVMrtJar=Das Verzeichnis enth\u00e4lt lib/rt.jar. +CPJVMPluginAllowTTValidation=JRE sofort pr\u00fcfen +CPJVMNotokMessage1=Es wurde der ung\u00fcltige JDK-Wert ({0}) mit folgender Fehlermeldung eingegeben: +CPJVMNotokMessage2=M\u00f6gliche Gr\u00fcnde f\u00fcr diese Meldung sind:
* Einige Pr\u00fcftests wurden nicht bestanden
* Es wurde kein OpenJDK erkannt
Wegen eines ungeeigneten JDKs wird IcedTea-Web wahrscheinlich nicht starten k\u00f6nnen.
Die Eigenschaft {0} in der Konfigurationsdatei {1} m\u00fcsste angepasst oder entfernt werden.
Es wird empfohlen nach OpenJDK auf diesem System zu suchen. +CPJVMconfirmInvalidJdkTitle=Ungeeignetes JDK +CPJVMconfirmReset=Auf Standard zur\u00fccksetzen? + +# Control Panel - Buttons +CPButAbout=\u00dcber... +CPButNetworkSettings=Netzwerkeinstellungen... +CPButSettings=Einstellungen... +CPButView=Anzeigen... +CPButCertificates=Zertifikate... + +# Control Panel - Headers +CPHead=IcedTea-Web Systemsteuerung +CPHeadAbout=\u00a0\u00dcber\u00a0IcedTea-Web\u00a0 +CPHeadNetworkSettings=\u00a0Netzwerkproxyeinstellungen\u00a0 +CPHeadTempInternetFiles=\u00a0Tempor\u00e4re\u00a0Internetdateien\u00a0 +CPHeadJRESettings=\u00a0Java\u00a0Runtime\u00a0Environment\u00a0Einstellungen\u00a0 +CPHeadCertificates=\u00a0Zertifikate\u00a0 +CPHeadDebugging=\u00a0Fehlerbeseitigungseinstellungen\u00a0 +CPHeadDesktopIntegration=\u00a0Desktopintegration\u00a0 +CPHeadSecurity=\u00a0Sicherheitseinstellungen\u00a0 +CPHeadJVMSettings=\u00a0JVM\u00a0Einstellungen\u00a0 + +# Control Panel - Tabs +CPTabAbout=\u00dcber IcedTea-Web +CPTabCache=Zwischenspeicher +CPTabCertificate=Zertifikate +CPTabClassLoader=Klassenlader +CPTabDebugging=Fehlerbeseitigung +CPTabDesktopIntegration=Desktopintegration +CPTabNetwork=Netzwerk +CPTabRuntimes=Laufzeitumgebungen +CPTabSecurity=Sicherheit +CPTabJVMSettings=JVM Einstellungen + +# Control Panel - AboutPanel +CPAboutInfo=Diese Systemsteuerung dient der Einstellung von deployment.properties.
Nicht alle Optionen haben eine Wirkung, bis Sie implementiert wurden.
Die Verwendung mehrerer JREs wird zur Zeit nicht unterst\u00fctzt.
+ +# Control Panel - AdvancedProxySettings +APSDialogTitle=Netzwerkeinstellungen +APSServersPanel=Server +APSProxyTypeLabel=Typ +APSProxyAddressLabel=Proxyadresse +APSProxyPortLabel=Proxyanschluss +APSLabelHTTP=HTTP +APSLabelSecure=Gesichert +APSLabelFTP=FTP +APSLabelSocks=Socks +APSSameProxyForAllProtocols=Denselben Proxyserver f\u00fcr alle Protokolle verwenden. +APSExceptionsLabel=Ausnahmen +APSExceptionsDescription=Keinen Proxyserver f\u00fcr Adressen verwenden, die damit beginnen +APSExceptionInstruction=Trennen Sie jeden Eintrag mit einem Semikolon (;). + +# Control Panel - DebugginPanel +DPEnableTracing=Ablaufverfolgung aktivieren +DPEnableLogging=Protokollierung aktivieren +DPDisable=Deaktivieren +DPHide=Beim Start verbergen +DPShow=Beim Start anzeigen +DPJavaConsole=Javakonsole + +# Control Panel - DesktopShortcutPanel +DSPNeverCreate=Nie erstellen +DSPAlwaysAllow=Immer erlauben +DSPAskUser=Benutzer fragen +DSPAskIfHinted=Fragen wenn angedeutet +DSPAlwaysIfHinted=Immer wenn angedeutet + +# Control Panel - NetworkSettingsPanel +NSDescription-1=Unbekannte Einstellung. +NSDescription0=Direktverbindung verwenden. +NSDescription1=Proxyeinstellungen des Browsers \u00fcbergehen. +NSDescription2=Automatisches Proxykonfigurationsskript am angegebenen Ort verwenden. +NSDescription3=Proxyeinstellungen des Standardbrowsers verwenden, um zum Internet zu verbinden. +NSAddress=Adresse +NSPort=Anschluss +NSAdvanced=Erweitert +NSBypassLocal=Proxyserver f\u00fcr lokale Adressen umgehen +NSDirectConnection=Direktverbindung +NSManualProxy=Manueller Proxyserver +NSAutoProxy=Automatisches Proxykonfigurationsskript +NSBrowserProxy=Browsereinstellungen verwenden +NSScriptLocation=Skriptort + +# Control Panel - SecurityGeneralPanel +SGPAllowUserGrantSigned=Benutzern erlauben, signierten Inhalten Berechtigungen zu gew\u00e4hren +SGPAllowUserGrantUntrust=Benutzern erlauben, Inhalten von einer nicht vertrauensw\u00fcrdigen Stelle Berechtigungen zu gew\u00e4hren +SGPUseBrowserKeystore=Zertifikate und Schl\u00fcssel aus dem Schl\u00fcsselspeicher des Browsers verwenden (nicht unterst\u00fctzt) +SGPUsePersonalCertOneMatch=Eigenes Zertifikat automatisch verwenden, wenn nur eins mit der Serveranfrage \u00fcbereinstimmt (nicht unterst\u00fctzt) +SGPWarnCertHostMismatch=Warnen, wenn Website-Zertifikat mit dem Hostnamen nicht \u00fcbereinstimmt +SGPShowValid=Website-Zertifikat auch anzeigen, wenn es g\u00fcltig ist (nicht unterst\u00fctzt) +SGPShowSandboxWarning=Sandkasten-Warnbanner anzeigen +SGPAllowUserAcceptJNLPSecurityRequests=Benutzer erlauben JNLP Sicherheitsanfragen zu akzeptieren +SGPCheckCertRevocationList=Zertifikate anhand von Zertifikatwiderruflisten (CRLs) auf Widerruf pr\u00fcfen (nicht unterst\u00fctzt) +SGPEnableOnlineCertValidate=Online-Zertifikatvalidierung aktivieren (nicht unterst\u00fctzt) +SGPEnableTrustedPublisherList=Liste der vertrauensw\u00fcrdigen Herausgeber aktivieren (nicht unterst\u00fctzt) +SGPEnableBlacklistRevocation=Pr\u00fcfung anhand schwarzer Widerrufliste aktivieren (nicht unterst\u00fctzt) +SGPEnableCachingPassword=Vorhalten des Kennworts f\u00fcr Authentifizierung aktivieren (nicht unterst\u00fctzt) +SGPUseSSL2=SSL 2.0 kompatibles ClientHello-Format verwenden (nicht unterst\u00fctzt) +SGPUseSSL3=SSL 3.0 verwenden (nicht unterst\u00fctzt) +SGPUseTLS1=TLS 1.0 verwenden (nicht unterst\u00fctzt) + +# Control Panel - TemporaryInternetFilesPanel +TIFPEnableCache=Tempor\u00e4re Dateien auf dem Computer belassen +TIFPLocation=\u00a0Ort\u00a0 +TIFPLocationLabel=Ort an dem tempor\u00e4re Dateien abgelegt werden +TIFPChange=\u00c4ndern +TIFPDiskSpace=\u00a0Plattenplatz\u00a0 +TIFPCompressionLevel=Kompressionsstufe f\u00fcr Jar-Dateien +TIFPNone=Keine +TIFPMax=Maximal +TIFPCacheSize=Menge des Plattenplatzes zur Speicherung tempor\u00e4rer Dateien +TIFPDeleteFiles=Dateien l\u00f6schen +TIFPViewFiles=Dateien anzeigen... + +# Control Panel - Cache Viewer +CVCPDialogTitle=Zwischenspeicheranzeige +CVCPButRefresh=Aktualisieren +CVCPButDelete=Entfernen +CVCPColLastModified=Zuletzt Ge\u00e4ndert +CVCPColSize=Gr\u00f6\u00dfe (Bytes) +CVCPColDomain=Dom\u00e4ne +CVCPColType=Typ +CVCPColPath=Pfad +CVCPColName=Name + +# Control Panel - Misc. +CPJRESupport=IcedTea-Web unterst\u00fctzt die Verwendung mehrerer JREs derzeit nicht. +CPInvalidPort=Ung\u00fcltige Anschlussnummer angegeben.\n[G\u00fcltige Anschlussnummern sind 1-65535] +CPInvalidPortTitle=Fehler bei der Eingabe. + +# command line control panel +CLNoInfo=Keine Informationen verf\u00fcgbar (ist dies eine g\u00fcltige Option?). +CLValue=Wert: {0} +CLValueSource=Herkunft: {0} +CLDescription=Beschreibung: {0} +CLUnknownCommand=Unbekannter Befehl {0} +CLUnknownProperty=Unbekannter Eigenschaftenname \u201e{0}\u201c +CLWarningUnknownProperty=WARNUNG: Unbekannter Eigenschaftenname \u201e{0}\u201c - erstelle neue Eigenschaft +CLNoIssuesFound=Keine Probleme gefunden. +CLIncorrectValue=Die Eigenschaft \u201e{0}\u201c hat den falschen Wert \u201e{1}\u201c. M\u00f6gliche Werte {2}. +CLListDescription=Zeigt eine Liste aller Eigenschaftennamen und Werte an, die durch IcedTea-Web\nverwendet werden +CLGetDescription=Zeigt den Wert der Eigenschaft property-name an +CLSetDescription=Wenn m\u00f6glich, setzt die Eigenschaft property-name auf den Wert value. Der Wert\nwird auf G\u00fcltigkeit gepr\u00fcft. Falls der Administrator die Eigenschaft gesperrt\nhat, wird dies keine Wirkung haben. +CLResetDescription=Setzt den Wert der Eigenschaft property-name auf seinen Standardwert zur\u00fcck.\nall setzt alle durch IcedTea-Web verwendeten Eigenschaften auf ihren Standardwert zur\u00fcck. +CLInfoDescription=Zeigt weitere Informationen \u00fcber die gegebene Eigenschaft an. +CLCheckDescription=Zeigt alle Eigenschaften an, die definiert wurden, aber durch IcedTea-Web nicht\nerkannt werden. +CLHelpDescription=Das Werkzeug itweb-settings erlaubt einem Benutzer die Konfiguration zu \u00e4ndern,\nanzuzeigen und zu pr\u00fcfen. Um die grafische Benutzeroberfl\u00e4che zu nutzen, d\u00fcrfen\nkeine Argumente angegeben werden. Um den Befehlszeilenmodus zu nutzen, m\u00fcssen\ngeeignete Befehle und Parameter angeben werden.\nF\u00fcr Hilfe mit einem bestimmten Befehl, versuche: {0} Befehl help + +# splash screen related +SPLASHerror=Um Details zu erhalten, hier klicken. Schwerwiegende Ausnahme aufgetreten. +SPLASH_ERROR=FEHLER +SPLASHtitle=Titel +SPLASHvendor=Lieferant +SPLASHhomepage=Homepage +SPLASHdescription=Beschreibung +SPLASHClose=Schlie\u00dfen +SPLASHclosewAndCopyException=Schlie\u00dfen und den Stapelverlauf in die Zwischenablage kopieren +SPLASHexOccured=Eine schwerwiegende Ausnahme ist aufgetreten... +SPLASHHome=Seitenanfang +SPLASHcantCopyEx=Kann Ausnahme nicht kopieren +SPLASHnoExRecorded=Keine Ausnahme aufgezeichnet +SPLASHmainL1=Um noch mehr Informationen zu erhalten, kann {0} besucht und die dort beschriebenen Schritte befolgt werden, um notwendige Informationen zu erhalten einen Fehler zu melden +SPLASHurl=http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs +SPLASHurlLooks=http://icedtea.classpath.org/wiki/IcedTea-Web +SPLASHmainL3=Keine weiteren Informationen verf\u00fcgbar. Es kann versucht werden den Web-Browser von der Befehlszeile aus zu starten und die Ausgabe zu untersuchen. +SPLASHcloseAndCopyShorter=Schlie\u00dfen und in die Zwischenablage kopieren +SPLASHmainL4=Die folgende Ausnahme ist aufgetreten. Um weitere Informationen zu erhalten, kann der Web-Browser von der Befehlszeile aus gestartet und die Ausgabe untersucht werden. +SPLASHexWas=Die Ausnahme war: +SPLASHcfl=Kann der Verkn\u00fcpfung zu nicht folgen +SPLASHvendorsInfo=Informationen vom Lieferanten der Anwendung +SPLASHanotherInfo=Eine weitere verf\u00fcgbare Info +SPLASHdefaultHomepage=Homepage nicht angegeben, verifiziere eher Quelle +SPLASHerrorInInformation=Fehler w\u00e4hrend des Ladens des Elements information, verifiziere eher Quelle +SPLASHmissingInformation=Das Element information fehlt, verifiziere eher Quelle +SPLASHchainWas=Dies ist die Liste der Ausnahmen, die w\u00e4hrend des Starts des Applets aufgetreten sind. Hinweis: Diese Ausnahmen k\u00f6nnen von mehreren Applets stammen. Um einen hilfreichen Fehlerbericht zu erstellen, sollte sichergestellt sein, dass nur ein Applet ausgef\u00fchrt wird. + +APPEXTSECappletSecurityLevelExtraHighId=Die Ausf\u00fchrung aller Java-Applets deaktivieren +APPEXTSECappletSecurityLevelVeryHighId=Sehr hohe Sicherheit +APPEXTSECappletSecurityLevelHighId=Hohe Sicherheit +APPEXTSECappletSecurityLevelLowId=Niedrige Sicherheit +APPEXTSECappletSecurityLevelExtraHighExplanation=Kein Applet wird ausgef\u00fchrt werden +APPEXTSECappletSecurityLevelVeryHighExplanation=Keine nicht signierten Applets werden ausgef\u00fchrt werden +APPEXTSECappletSecurityLevelHighExplanation=Benutzer wird bei jedem nicht signierten Applet gefragt werden +APPEXTSECappletSecurityLevelLowExplanation=Alle, sogar nicht signierte Applets werden ausgef\u00fchrt werden +APPEXTSECunsignedAppletActionAlways=Diesem/n (\u00fcbereinstimmenden) Applet/s immer vertrauen +APPEXTSECunsignedAppletActionNever=Diesem/n (\u00fcbereinstimmenden) Applet/s nie vertrauen +APPEXTSECunsignedAppletActionYes=Dieses Applet wurde besucht und zugelassen +APPEXTSECunsignedAppletActionNo=Dieses Applet wurde besucht und verweigert +APPEXTSECControlPanelExtendedAppletSecurityTitle=Erweiterte Applet-Sicherheit +APPEXTSECguiTableModelTableColumnAction=Aktion +APPEXTSECguiTableModelTableColumnDateOfAction=Aktionsdatum +APPEXTSECguiTableModelTableColumnDocumentBase=Dokumentbasis +APPEXTSECguiTableModelTableColumnCodeBase=Codebasis +APPEXTSECguiTableModelTableColumnArchives=Archive +APPEXTSECguiPanelAppletInfoHederPart1={0} {1} +APPEXTSECguiPanelAppletInfoHederPart2={0} von {1} +APPEXTSECguiPanelConfirmDeletionOf=Sollen die folgenden {0} Inhalte wirklich gel\u00f6scht werden? +APPEXTSECguiPanelHelpButton=Hilfe +APPEXTSECguiPanelSecurityLevel=Sicherheitsstufe +APPEXTSECguiPanelGlobalBehaviourCaption=Einstellungen der globalen Verhaltensweise von Applets +APPEXTSECguiPanelDeleteMenuSelected=markiert +APPEXTSECguiPanelDeleteMenuAllA=alle zugelassenen (A) +APPEXTSECguiPanelDeleteMenuAllN=alle verbotenen (N) +APPEXTSECguiPanelDeleteMenuAlly=alle genehmigten (y) +APPEXTSECguiPanelDeleteMenuAlln=alle abgelehnten (n) +APPEXTSECguiPanelDeleteMenuAllAll=absolut alle +APPEXTSECguiPanelDeleteButton=L\u00f6schen +APPEXTSECguiPanelDeleteButtonToolTip=Durch dr\u00fccken der Entf-Taste w\u00e4hrend der Durchsicht der Tabelle wird der markierte Inhalt gel\u00f6scht +APPEXTSECguiPanelTestUrlButton=Teste URL +APPEXTSECguiPanelAddRowButton=Neue\u00a0Zeile\u00a0hinzuf\u00fcgen +APPEXTSECguiPanelValidateTableButton=Tabelle\u00a0\u00fcberpr\u00fcfen +APPEXTSECguiPanelAskeforeActionBox=Vor\u00a0Aktion\u00a0fragen +APPEXTSECguiPanelShowRegExesBox=Regul\u00e4re\u00a0Ausdr\u00fccke\u00a0vollst\u00e4ndig\u00a0zeigen +APPEXTSECguiPanelInverSelection=Markierung umkehren +APPEXTSECguiPanelMoveRowUp=Zeile auf +APPEXTSECguiPanelMoveRowDown=Zeile ab +APPEXTSECguiPanelCustomDefs=Benutzerdefinitionen +APPEXTSECguiPanelGlobalDefs=Systemdefinitionen +APPEXTSECguiPanelDocTest=URL der Dokumentbasis eingeben +APPEXTSECguiPanelCodeTest=URL der Codebasis eingeben +APPEXTSECguiPanelNoMatch=Keine \u00dcbereinstimmung +APPEXTSECguiPanelMatchingNote=HINWEIS: Nur die erste \u00dcbereinstimmung wird als Ergebnis gewertet. +APPEXTSECguiPanelMatched=\u00dcbereinstimmung +APPEXTSECguiPanelMatchingError=Fehler bei der Suche nach \u00dcbereinstimmungen: {0} +APPEXTSECguiPanelCanNotValidate=Keine \u00dcberpr\u00fcfung m\u00f6glich; Die tempor\u00e4re Datei \u201e{0}\u201c kann nicht erstellt werden +APPEXTSECguiPanelEmptyDoc=Alle Dokumentbasen m\u00fcssen ausgef\u00fcllt sein +APPEXTSECguiPanelEmptyCode=Alle Codebasen m\u00fcssen ausgef\u00fcllt sein +APPEXTSECguiPanelTableValid=Tabelle sieht g\u00fcltig aus +APPEXTSECguiPanelTableInvalid=Ung\u00fcltig durch folgenden Fehler: {0} +APPEXTSECguiPanelShowOnlyPermanent=Nur dauerhafte Eintr\u00e4ge zeigen +APPEXTSECguiPanelShowOnlyTemporal=Nur vorher vorr\u00fcbergehend entschiedene Eintr\u00e4ge zeigen +APPEXTSECguiPanelShowAll=Alle Eintr\u00e4ge zeigen +APPEXTSECguiPanelShowOnlyPermanentA=Nur zugelassene dauerhafte Eintr\u00e4ge zeigen +APPEXTSECguiPanelShowOnlyPermanentN=Nur verbotene dauerhafte Eintr\u00e4ge zeigen +APPEXTSECguiPanelShowOnlyTemporalY=Nur vorher zugelassene Applet-Eintr\u00e4ge zeigen +APPEXTSECguiPanelShowOnlyTemporalN=Nur vorher verweigerte Applet-Eintr\u00e4ge zeigen +APPEXTSEChelpHomeDialogue=Dialog diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/Messages_pl.properties icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/Messages_pl.properties --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/Messages_pl.properties 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/Messages_pl.properties 2013-05-03 19:08:24.253520084 +0000 @@ -0,0 +1,573 @@ +# Polish UI messages for netx +# L=Launcher, B=Boot, P=Parser, C=cache S=security +# +# General +NullParameter=Parametr zerowy +ButAllow=Pozw\u00f3l +ButBrowse=Przegl\u0105daj... +ButCancel=\ Anuluj +ButClose=Zamknij +ButCopy=Kopiuj do schowka +ButMoreInformation=Wi\u0119cej\u00a0informacji... +ButOk=OK +ButProceed=Kontynuuj +ButRun=Uruchom +ButApply=Zastosuj +ButDone=Gotowe +ButShowDetails=Poka\u017c szczeg\u00f3\u0142y +ButHideDetails=Chowaj szczeg\u00f3\u0142y + +AFileOnTheMachine=plik na komputerze +AlwaysAllowAction=Zawsze zezwalaj na t\u0105 akcj\u0119 +Usage=Stosowanie: +Error=B\u0142\u0105d + +Continue=Czy chcesz kontynuowa\u0107? +Field=Pole +From=Od +Name=Nazwa +Password=Has\u0142o: +Publisher=Wydawca +Unknown= +Username=U\u017cytkownik: +Value=Warto\u015b\u0107 +Version=Wersja + +# LS - Severity +LSMinor=Mniejszy +LSFatal=Fatalny + +# LC - Category +LCSystem=B\u0142\u0105d systemowy +LCExternalLaunch=Zewn\u0119trzny b\u0142\u0105d startowy +LCFileFormat=B\u0142\u0119dny format pliku +LCReadError=B\u0142\u0105d odczytu +LCClient=B\u0142\u0105d aplikacji +LCLaunching=B\u0142\u0105d startowy +LCNotSupported=Nieobs\u0142ugiwana cecha +LCInit=B\u0142\u0105d inicjalizacyjny + +LAllThreadGroup=Wszystkie aplikacje JNLP +LNullUpdatePolicy=Wytyczna aktualizacji nie mo\u017ce by\u0107 null. + +LThreadInterrupted=W\u0105tek przerwany podczas czekania na wystartowanie pliku. +LThreadInterruptedInfo=To mo\u017ce doprowadzi\u0107 do zablokowania lub innego uszkodzenia w trakcie wykonywania. Prosz\u0119 uruchomi\u0107 ponownie aplikacj\u0119 lub przegl\u0105dark\u0119. +LCouldNotLaunch=Nie mo\u017cna wystartowa\u0107 pliku JNLP. +LCouldNotLaunchInfo=Nie zainicjalizowano aplikacji. Aby uzyska\u0107 wi\u0119cej informacji, uruchom javaws lub przegl\u0105dark\u0119 z wiersza polece\u0144 i wy\u015blij raport o b\u0142\u0119dzie. +LCantRead=Nie mo\u017cna odczyta\u0107 lub przeprowadzi\u0107 analizy sk\u0142adni pliku JNLP. +LCantReadInfo=Mo\u017cesz spr\u00f3bowa\u0107 r\u0119cznie pobra\u0107 ten plik i wys\u0142a\u0107 go razem ze zg\u0142oszeniem b\u0142\u0119du do zespo\u0142u IcedTea-Web. +LNullLocation=Nie mo\u017cna ustali\u0107 lokalizacj\u0119 pliku .jnlp. +LNullLocationInfo=Podj\u0119to pr\u00f3b\u0119 wystartowania pliku JNLP w innej JVM, lecz nie mo\u017cna by\u0142o zlokalizowa\u0107 plik. Aby wystartowa\u0107 w zewn\u0119trznej JVM, uruchomienie programowe musi by\u0107 w stanie zlokalizowa\u0107 plik .jnlp albo w lokalnym systemie plik\u00f3w czy na serwerze. +LNetxJarMissing=Nie mo\u017cna ustali\u0107 lokalizacj\u0119 netx.jar. +LNetxJarMissingInfo=Podj\u0119to pr\u00f3b\u0119 wystartowania pliku JNLP w innej JVM, lecz nie mo\u017cna by\u0142o zlokalizowa\u0107 netx.jar. Aby wystartowa\u0107 w zewn\u0119trznej JVM, uruchomienie programowe musi by\u0107 w stanie zlokalizowa\u0107 plik netx.jar. +LNotToSpec=Plik JNLP nie spe\u0142nia \u015bci\u015ble specyfikacji. +LNotToSpecInfo=Plik JNLP zawiera dane, kt\u00f3re s\u0105 zabronione wed\u0142ug specyfikacji JNLP. Uruchomienie programowe mo\u017ce pr\u00f3bowa\u0107 ignorowa\u0107 niepoprawne informacje i kontynuowa\u0107 startowanie pliku. +LNotApplication=Brak pliku applet-owego. +LNotApplicationInfo=Podj\u0119to pr\u00f3b\u0119 za\u0142adowania innego pliku ni\u017c applet-owego jako aplikacj\u0119. +LNotApplet=Brak pliku applet-owego. +LNotAppletInfo=Podj\u0119to pr\u00f3b\u0119 za\u0142adowania innego pliku ni\u017c applet-owy jako applet. +LNoInstallers=Brak obs\u0142ugi instalator\u00f3w. +LNoInstallersInfo=Pliki instalacyjne JNLP nie s\u0105 jeszcze obs\u0142ugiwane. +LInitApplet=Nie mo\u017cna zainicjalizowa\u0107 applet-u. +LInitAppletInfo=Aby uzyska\u0107 wi\u0119cej informacji kliknij na przycisk \u201eWi\u0119cej\u00a0informacji\u201d. +LInitApplication=Nie mo\u017cna zainicjalizowa\u0107 aplikacj\u0119. +LInitApplicationInfo=Nie zainicjalizowano aplikacji. Aby uzyska\u0107 wi\u0119cej informacji, uruchom javaws z wiersza polece\u0144. +LNotLaunchable=Plik JNLP nie do uruchomienia. +LNotLaunchableInfo=Plik musi by\u0107 typu aplikacja, applet lub instalator JNLP. +LCantDetermineMainClass=Klasa g\u0142\u00f3wna nieznana. +LCantDetermineMainClassInfo=Nie da\u0142o si\u0119 ustali\u0107 klasy g\u0142\u00f3wnej tej aplikacji. +LUnsignedJarWithSecurity=Nie mo\u017cna nada\u0107 uprawnie\u0144 niepodpisanym plikom jar. +LUnsignedJarWithSecurityInfo=Aplikacja za\u017c\u0105da\u0142a uprawnie\u0144 bezpiecze\u0144stwa, lecz pliki jar nie s\u0105 podpisane. +LUnsignedApplet=Applet by\u0142 niepodpisany. +LUnsignedAppletPolicyDenied=Applet by\u0142 niepodpisany, a wytyczna bezpiecze\u0144stwa wstrzyma\u0142a jego uruchomienie. +LUnsignedAppletUserDenied=Applet by\u0142 niepodpisany i nie zaufano mu. +LSignedJNLPAppDifferentCerts=Aplikacja JNLP nie jest w pe\u0142ni podpisana jednym certyfikatem. +LSignedJNLPAppDifferentCertsInfo=Komponenty tej aplikacji JNLP podpisano indywidualnie, jednak musi by\u0107 wsp\u00f3lny podpisuj\u0105cy dla wszystkich wpis\u00f3w. +LSignedAppJarUsingUnsignedJar=Podpisana aplikacja u\u017cywa niepodpisane pliki jar. +LSignedAppJarUsingUnsignedJarInfo=G\u0142\u00f3wny jar aplikacji jest podpisany, lecz niekt\u00f3re pliki jar kt\u00f3re u\u017cywa nie s\u0105. +LSignedJNLPFileDidNotMatch=Podpisany plik JNLP nie pasuje do starowanego pliku JNLP. +LNoSecInstance=B\u0142\u0105d: Brak instancji bezpiecze\u0144stwa dla {0}. Aplikacja mo\u017ce dozna\u0107 problem\u00f3w w kontynuowaniu +LCertFoundIn=Znalezino {0} w cacerts ({1}) +LSingleInstanceExists=Inna instancja tego applet-u ju\u017c istnieje, a wy\u0142\u0105cznie jedna mo\u017ce by\u0107 wykonywana r\u00f3wnocze\u015bnie. + +JNotApplet=Plik nie jest applet-em. +JNotApplication=Plik nie jest aplikacj\u0105. +JNotComponent=Plik nie jest komponentem. +JNotInstaller=Plik nie jest instalatorem. +JInvalidExtensionDescriptor=Rozszerzenie nie odnosi si\u0119 do komponentu lub instalatora (nazwa={1}, lokalizacja={2}). + +LNotVerified=Nie zweryfikowano plik\u00f3w jar. +LCancelOnUserRequest=Anulowano na \u017c\u0105danie u\u017cytkownika. +LFatalVerification=Wyst\u0105pi\u0142 b\u0142\u0105d krytyczny podczas pr\u00f3bowania zweryfikowa\u0107 pliki jar. +LFatalVerificationInfo=Wyrzucono wyj\u0105tek w klasie JarCertVerifier. Brak mo\u017cliwo\u015bci odczytu plik\u00f3w cacerts lub trusted.certs jest jedn\u0105 mo\u017cliw\u0105 przyczyn\u0105 tego wyj\u0105tku. + +LNotVerifiedDialog=Nie wszystkie pliki jar zweryfikowano. +LAskToContinue=Czy mimo to chcesz kontynuowa\u0107 wykonywanie tej aplikacji? + +# Parser +PInvalidRoot=Element bazowy nie jest elementem \u201ejnlp\u201d. +PNoResources=Brak elementu \u201eresources\u201d. +PUntrustedNative=Element \u201enativelib\u201d nie mo\u017ce wyst\u0119powa\u0107 bez za\u017c\u0105dania bezpiecznego \u015brodowiska. +PExtensionHasJ2SE=Element \u201ej2se\u201d nie mo\u017ce wyst\u0119powa\u0107 w pliku rozszerzenia komponentu. +PInnerJ2SE=Element \u201ej2se\u201d nie mo\u017ce wyst\u0119powa\u0107 wewn\u0105trz elementu \u201ej2se\u201d. +PTwoMains=Atrybut \u201emain\u201d wyst\u0119puje podw\u00f3jnie na elemencie \u201eresources\u201d (mo\u017ce wyst\u0119powa\u0107 wy\u0142\u0105cznie jeden raz) +PNativeHasMain=Atrybut \u201emain\u201d nie mo\u017ce wyst\u0119powa\u0107 na elemencie \u201enativelib\u201d. +PNoInfoElement=Brak elementu \u201einformation\u201d. +PMissingTitle=Tytu\u0142 +PMissingVendor=Dostawca +PMissingElement=Brak sekcji \u201e{0}\u201d dla aktywnych ustawie\u0144 regionalnych, jak i warto\u015bci domy\u015blnej w pliku JNLP. +PTwoDescriptions=Podw\u00f3jne elementy \u201edescription\u201d rodzaju \u201e{0}\u201d s\u0105 niedozwolone. +PSharing=Element \u201esharing-allowed\u201d jest niedozwolony w powszechnym pliku JNLP. +PTwoSecurity=Wy\u0142\u0105cznie jeden element \u201esecurity\u201d jest dozwolony w pliku JNLP. +PEmptySecurity=Element \u201esecurity\u201d wyst\u0119puje bez zawierania elementu \u201epermissions\u201d. +PTwoDescriptors=Wy\u0142\u0105cznie jeden element \u201eapplication-desc\u201d jest dozwolony w pliku JNLP. +PTwoDesktops=Wy\u0142\u0105cznie jeden element \u201edesktop\u201d jest dozwolony. +PTwoMenus=Wy\u0142\u0105cznie jeden element \u201emenu\u201d jest dozwolony. +PTwoTitles=Wy\u0142\u0105cznie jeden element \u201etitle\u201d jest dozwolony. +PTwoIcons=Wy\u0142\u0105cznie jeden element \u201eicon\u201d jest dozwolony. +PTwoUpdates=Wy\u0142\u0105cznie jeden element \u201eupdate\u201d jest dozwolony. +PUnknownApplet=Nieznany applet +PBadWidth=Nieprawid\u0142owa szeroko\u015b\u0107 applet-u +PBadHeight=Nieprawid\u0142owa wysoko\u015b\u0107 applet-u +PUrlNotInCodebase=Po\u015bredni URL nie wskazuje na podkatalog bazy kodu. (w\u0119ze\u0142={0}, href={1}, baza={2}) +PBadRelativeUrl=Nieprawid\u0142owy po\u015bredni URL (w\u0119ze\u0142={0}, href={1}, baza={2}) +PBadNonrelativeUrl=Nieprawid\u0142owy bezpo\u015bredni URL (w\u0119ze\u0142={0}, href={1}) +PNeedsAttribute=Na elemencie \u201e{0}\u201d musi wyst\u0119powa\u0107 atrybut \u201e{1}\u201d. +PBadXML=Nieprawid\u0142owa sk\u0142adnia dokumentu XML. +PBadHeapSize=Nieprawid\u0142owa warto\u015b\u0107 wielko\u015bci sterty ({0}) + +# Runtime +BLaunchAbout=Startowanie okna O... +BNeedsFile=Potrzebny plik .jnlp +RNoAboutJnlp=Nie znaleziono pliku about.jnlp +BFileLoc=Lokalizacja pliku JNLP +BBadProp=B\u0142\u0119dny format w\u0142a\u015bciwo\u015bci \u201e{0}\u201d (powinien by\u0107 klucz=warto\u015b\u0107) +BBadParam=B\u0142\u0119dny format parametru \u201e{0}\u201d (powinien by\u0107 nazwa=warto\u015b\u0107) +BNoDir=Katalog \u201e{0}\u201d nie istnieje. +BNoCodeOrObjectApplet=Na znaczniku applet musi wyst\u0119powa\u0107 atrybut \u201ecode\u201d lub \u201eobject\u201d. +RNoResource=Brak zasobu: {0} +RShutdown=Ten wyj\u0105tek aby zapobiec zamkni\u0119ciu JVM, lecz proces ten zako\u0144czono. +RExitTaken=Klasa zako\u0144czenia ju\u017c nastawiona i wywo\u0142uj\u0105cy nie jest klas\u0105 zako\u0144czenia. +RCantReplaceSM=Wymiana SecurityManager jest niedozwolona. +RCantCreateFile=Nie mo\u017cna utworzy\u0107 pliku \u201e{0}\u201d +RCantDeleteFile=Nie mo\u017cna usun\u0105\u0107 pliku \u201e{0}\u201d +RRemoveRPermFailed=Brak powodzenia przy usuwaniu praw odczytu z pliku \u201e{0}\u201d +RRemoveWPermFailed=Brak powodzenia przy usuwaniu praw zapisu z pliku \u201e{0}\u201d +RRemoveXPermFailed=Brak powodzenia przy usuwaniu praw wykonawczych z pliku \u201e{0}\u201d +RGetRPermFailed=Brak powodzenia przy pozyskiwaniu praw odczytu dla pliku \u201e{0}\u201d +RGetWPermFailed=Brak powodzenia przy pozyskiwaniu praw zapisu dla pliku \u201e{0}\u201d +RGetXPermFailed=Brak powodzenia przy pozyskiwaniu praw wykonawczych dla pliku \u201e{0}\u201d +RCantCreateDir=Nie mo\u017cna utworzy\u0107 katalogu \u201e{0}\u201d +RCantRename=Nie mo\u017cna przemianowa\u0107 \u201e{0}\u201d w \u201e{1}\u201d +RDenyStopped=Zatrzymane aplikacje nie posiadaj\u0105 praw dost\u0119pu. +RExitNoApp=Nie mo\u017cna zako\u0144czy\u0107 maszyny wirtualnej Java (JVM) poniewa\u017c nie mo\u017cna ustali\u0107 bie\u017c\u0105cej aplikacji. +RNoLockDir=Nie mo\u017cna utworzy\u0107 katalogu blokuj\u0105cego ({0}) +RNestedJarExtration=Nie mo\u017cna wyodr\u0119bni\u0107 zagnie\u017cd\u017conego jar-a. +RUnexpected=Nie oczekiwano {0} w {1} +RConfigurationError=B\u0142\u0105d fatalny podczas czytania konfiguracji +RConfigurationFatal=B\u0141\u0104D: Wyst\u0105pi\u0142 b\u0142\u0105d fatalny podczas \u0142adowania konfiguracji. By\u0107 mo\u017ce wymagano konfiguracj\u0119 globaln\u0105, ale nie znaleziono jej. +RPRoxyPacNotSupported=U\u017cycie plik\u00f3w automatycznej konfiguracji proxy (PAC) nie jest obs\u0142ugiwane. +RProxyFirefoxNotFound=Nie mo\u017cna u\u017cy\u0107 ustawie\u0144 proxy Firefox-a. Zastosowano \u201eDIRECT\u201d jako typ proxy. +RProxyFirefoxOptionNotImplemented=Opcja proxy \u201e{0}\u201d ({1}) przegl\u0105darki jeszcze nie jest obs\u0142ugiwana. +RBrowserLocationPromptTitle=Lokalizacja przegl\u0105darki +RBrowserLocationPromptMessage=Podaj lokalizacj\u0119 przegl\u0105darki +RBrowserLocationPromptMessageWithReason=Podaj lokalizacj\u0119 przegl\u0105darki (polecenie \u201e{0}\u201d jest nieprawid\u0142owe). + +# Boot options, message should be shorter than this ----------------> +BOUsage=javaws [-opcje-uruchomienia] +BOUsage2=javaws [-opcje-sterowania] +BOJnlp=Lokalizacja pliku JNLP do wystartowania (URL lub plik) +BOArg=Do wiesza argument aplikacji przed wystartowaniem +BOParam=Do wiesza parametr applet-u przed wystartowaniem +BOProperty=Ustawia w\u0142a\u015bciwo\u015b\u0107 systemow\u0105 przed wystartowaniem +BOUpdate=Sprawd\u017a dost\u0119pno\u015b\u0107 aktualizacji +BOLicense=Wy\u015bwietl licencj\u0119 GPL i zako\u0144cz +BOVerbose=W\u0142\u0105cz rozmowne komunikaty +BOAbout=Pokazuje aplikacj\u0119 przyk\u0142adow\u0105 +BONosecurity=Wy\u0142\u0105cza bezpieczne \u015brodowisko uruchomieniowe +BONoupdate=Wy\u0142\u0105cza sprawdzanie dost\u0119pno\u015bci aktualizacji +BOHeadless=Wy\u0142\u0105cza okno pobierania i inne interfejsy graficzne +BOStrict=W\u0142\u0105cza \u015bcis\u0142e sprawdzanie format pliku JNLP +BOViewer=Pokazuje podgl\u0105d zaufanych certyfikat\u00f3w +BXnofork=Nie tw\u00f3rz nast\u0119pnej JVM +BXclearcache=Wyczy\u015b\u0107 pami\u0119\u0107 podr\u0119czn\u0105 aplikacji JNLP +BXignoreheaders=Pomijaj weryfikacj\u0119 nag\u0142\u00f3wk\u00f3w plik\u00f3w jar +BOHelp=Wy\u015bwietl ten komunikat i zako\u0144cz + +# Cache +CAutoGen=Wygenerowano automatycznie - nie edytowa\u0107 +CNotCacheable=Zas\u00f3b \u201e{0}\u201d jest nie do przechowania w pami\u0119ci podr\u0119cznej. +CDownloading=Pobieranie +CComplete=Uko\u0144czono +CChooseCache=Wybierz katalog pami\u0119ci podr\u0119cznej... +CChooseCacheInfo=NetX wymaga lokalizacj\u0119 do sk\u0142adowania plik\u00f3w pami\u0119ci podr\u0119cznej. +CChooseCacheDir=Katalog pami\u0119ci podr\u0119cznej +CCannotClearCache=Nie mo\u017cna wyczy\u015bci\u0107 pami\u0119ci podr\u0119cznej w tej chwili. +CFakeCache=Pami\u0119\u0107 podr\u0119czna jest uszkodzona. Naprawianie. +CFakedCache=Naprawiono uszkodzon\u0105 pami\u0119\u0107 podr\u0119czn\u0105. Stanowczo si\u0119 zaleca uruchomi\u0107 polecenie \u201ejavaws -Xclearcache\u201d wraz z nast\u0119puj\u0105cym ponownym uruchomieniem aplikacji. + +# Security +SFileReadAccess=Aplikacja za\u017c\u0105da\u0142a uprawnienie do odczytu \u201e{0}\u201d. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? +SFileWriteAccess=Aplikacja za\u017c\u0105da\u0142a uprawnienie do zapisu \u201e{0}\u201d. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? +SDesktopShortcut=Aplikacja za\u017c\u0105da\u0142a uprawnienie do utworzenia aktywatora na pulpicie. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? +SSigUnverified=Nie mo\u017cna zweryfikowa\u0107 podpisu cyfrowego aplikacji. Czy chcesz uruchomi\u0107 aplikacj\u0119? +SSigVerified=Zweryfikowano podpis cyfrowy aplikacji. Czy chcesz uruchomi\u0107 aplikacj\u0119? +SSignatureError=Podpis cyfrowy aplikacji zawiera b\u0142\u0105d. Czy chcesz uruchomi\u0107 aplikacj\u0119? +SUntrustedSource=Nie zweryfikowano podpisu cyfrowego przez zaufanego wydawc\u0119. Uruchamiaj wy\u0142\u0105cznie je\u015bli ufasz pochodzeniu aplikacji. +SWarnFullPermissionsIgnorePolicy=Kodowi wykonywalnemu zostan\u0105 wydane pe\u0142ne uprawnienia, ignoruj\u0105c wszelkie wytyczne Java. +STrustedSource=Potwierdzono podpis cyfrowy przez zaufanego wydawc\u0119. +SClipboardReadAccess=Aplikacja za\u017c\u0105da\u0142a wy\u0142\u0105czne uprawnienie do odczytu do schowka. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? +SClipboardWriteAccess=Aplikacja za\u017c\u0105da\u0142a wy\u0142\u0105czne uprawnienie do zapisu do schowka. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? +SPrinterAccess=Aplikacja za\u017c\u0105da\u0142a dost\u0119p do drukarki. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? +SNetworkAccess=Aplikacja za\u017c\u0105da\u0142a zezwolenie na nawi\u0105zywanie po\u0142\u0105cze\u0144 do \u201e{0}\u201d. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? +SNoAssociatedCertificate= +SUnverified=(niezweryfikowany) +SAlwaysTrustPublisher=Zawsze ufaj materia\u0142om od tego wydawcy. +SHttpsUnverified=Nie zweryfikowano certyfikat HTTPS witryny internetowej. +SRememberOption=Czy chcesz zapami\u0119ta\u0107 t\u0105 opcj\u0119? +SRememberAppletOnly=Dla applet-u +SRememberCodebase=Dla witryny {0} +SUnsignedSummary=Niepodpisana aplikacja Java domaga si\u0119 uruchomienia. +SUnsignedDetail=Niepodpisana aplikacja z nast\u0119puj\u0105cej lokalizacji domaga si\u0119 uruchomienia:
  {0}
Strona, kt\u00f3ra postawi\u0142a \u017c\u0105danie:
  {1}

Zaleca si\u0119 uruchamia\u0107 wy\u0142\u0105cznie aplikacje z zaufanych witryn. +SUnsignedAllowedBefore=Zaakceptowa\u0142e\u015b ten applet poprzednio. +SUnsignedRejectedBefore=Odrzuci\u0142e\u015b ten applet poprzednio. +SUnsignedQuestion=Czy chcesz zezwoli\u0107 temu applet-owi na uruchomienie? +SNotAllSignedSummary=Zaledwie cz\u0119\u015bci kodu tej aplikacji s\u0105 podpisane. +SNotAllSignedDetail=Ta aplikacja zawiera zar\u00f3wno podpisany jak i niepodpisany kod. Cho\u0107 kod, kt\u00f3ry jest podpisany przez zaufanego dostawc\u0119 jest bezpieczny, niepodpisany kod mo\u017ce poci\u0105ga\u0107 za sob\u0105 kod, kt\u00f3ry jest poza kontrolnym zasi\u0119giem zaufanego dostawcy. +SNotAllSignedQuestion=Czy chcesz kontynuowa\u0107 i mimo to uruchomi\u0107 t\u0105 aplikacj\u0119? +SAuthenticationPrompt=Serwer {0} w \u201e{1}\u201d \u017c\u0105da uwierzytelnienia. Podaje komunikat: \u201e{2}\u201d +SJNLPFileIsNotSigned=Ta aplikacja zawiera podpis cyfrowy, jednak startowany plik JNLP jest bez podpisu. + +# Security - used for the More Information dialog +SBadKeyUsage=Zasoby zawieraj\u0105 wpisy dla kt\u00f3rych rozszerzenie KeyUsage certyfikatu podpisuj\u0105cego nie zezwala na podpisywanie kodu. +SBadExtendedKeyUsage=Zasoby zawieraj\u0105 wpisy dla kt\u00f3rych rozszerzenie ExtendedKeyUsage certyfikatu podpisuj\u0105cego nie zezwala na podpisywanie kodu. +SBadNetscapeCertType=Zasoby zawieraj\u0105 wpisy dla kt\u00f3rych rozszerzenie NetscapeCertType certyfikatu podpisuj\u0105cego nie zezwala na podpisywanie kodu. +SHasExpiredCert=Podpis cyfrowy wygas\u0142. +SHasExpiringCert=Zasoby zawieraj\u0105 wpisy kt\u00f3rych certyfikat podpisuj\u0105cego wyga\u015bnie za sze\u015b\u0107 miesi\u0119cy. +SNotYetValidCert=Zasoby zawieraj\u0105 wpisy kt\u00f3rych certyfikat podpisuj\u0105cego nie jest jeszcze wa\u017cny. +SUntrustedCertificate=Ten podpis cyfrowy wygenerowano za pomoc\u0105 niezaufanego certyfikatu. +STrustedCertificate=Ten podpis cyfrowy wygenerowano za pomoc\u0105 zaufanego certyfikatu. +SCNMisMatch=Oczekiwana nazwa komputera dla tego certyfikatu to: \u201e{0}\u201d
Adres pod kt\u00f3rym nawi\u0105zywane jesz po\u0142\u0105czenie: \u201e{1}\u201d +SRunWithoutRestrictions=Aplikacja zostanie uruchomiona bez restrykcji bezpieczeniowych zwykle oferowanych przez Java. +SCertificateDetails=Szczeg\u00f3\u0142y certyfikatu + +# Security - certificate information +SIssuer=Wystawca +SSerial=Numer seryjny +SMD5Fingerprint=Odcisk MD5 +SSHA1Fingerprint=Odcisk SHA1 +SSignature=Podpis +SSignatureAlgorithm=Algorytm podpisu +SSubject=Podmiot +SValidity=Wa\u017cno\u015b\u0107 + +# Certificate Viewer +CVCertificateViewer=Certyfikaty +CVCertificateType=Typ certyfikatu +CVDetails=Szczeg\u00f3\u0142y +CVExport=Eksportuj +CVExportPasswordMessage=Wprowad\u017a has\u0142o zabezpieczaj\u0105ce plik z kluczami: +CVImport=Importuj +CVImportPasswordMessage=Wprowad\u017a has\u0142o dost\u0119pu do pliku: +CVIssuedBy=Wystawiono przez +CVIssuedTo=Wystawiono dla +CVPasswordTitle=Uwierzytelnianie +CVRemove=Usu\u0144 +CVRemoveConfirmMessage=Czy na pewno chcesz usun\u0105\u0107 zaznaczony certyfikat? +CVRemoveConfirmTitle=Zatwierdzanie usuni\u0119cia certyfikatu +CVUser=U\u017cytkownik +CVSystem=System + +KS=Baza kluczy +KSCerts=Zaufane certyfikaty +KSJsseCerts=Zaufane certyfikaty JSSE +KSCaCerts=Zaufane certyfikaty bazowe organ\u00f3w certyfikacji +KSJsseCaCerts=Zaufane certyfikaty bazowe JSSE organ\u00f3w certyfikacji +KSClientCerts=Certyfikaty uwierzytelnienia klient\u00f3w + +# Deployment Configuration messages +DCIncorrectValue=W\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d zawiera b\u0142\u0119dn\u0105 warto\u015b\u0107 \u201e{1}\u201d. Mo\u017cliwe warto\u015bci s\u0105 {2}. +DCInternal=B\u0142\u0105d wewn\u0119trzny: {0} +DCSourceInternal= +DCUnknownSettingWithName=W\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d jest nieznana. + +# Value Validator messages. Messages should follow "Possible values ..." +VVPossibleValues=Mo\u017cliwe warto\u015bci {0} +VVPossibleBooleanValues=s\u0105 \u201e{0}\u201d lub \u201e{1}\u201d. +VVPossibleFileValues=to bezpo\u015brednie \u015bcie\u017cki do pliku lub katalogu. +VVPossibleRangedIntegerValues=le\u017c\u0105 \u0142\u0105cznie w przedziale mi\u0119dzy {0} do {1}. +VVPossibleUrlValues=to ka\u017cdy prawid\u0142owy URL, np. http://icedtea.classpath.org/hg/ + +# Control Panel - Main +CPMainDescriptionShort=Konfiguracja IcedTea-Web +CPMainDescriptionLong=Konfiguruje funkcjonowanie wtyczki do przegl\u0105darki (IcedTeaNPPlugin) i javaws (NetX) + +# Control Panel - Tab Descriptions +CPAboutDescription=Przegl\u0105daj informacje o wersji panela sterowania IcedTea. +CPNetworkSettingsDescription=Konfiguruj ustawienia sieciowe, razem ze sposobem \u0142\u0105czenia si\u0119 IcedTea-Web z internetem, czy te\u017c za po\u015brednictwem serwera proxy. +CPTempInternetFilesDescription=Java sk\u0142aduje dane aplikacji dla szybszego wykonywania podczas nast\u0119pnego uruchomienia. +CPJRESettingsDescription=Zarz\u0105dzaj wersjami Java Runtime Environment, jak i ustawieniami aplikacji i applet-\u00f3w Java. +CPCertificatesDescription=Stosuj certyfikaty aby legitymowa\u0107 si\u0119, jak i sprawdza\u0107 to\u017csamo\u015b\u0107 certyfikat\u00f3w, organ\u00f3w certyfikacji i wydawc\u00f3w. +CPSecurityDescription=Konfiguruj t\u0105 mask\u0105 ustawienia bezpiecze\u0144stwa. +CPDebuggingDescription=W\u0142\u0105czaj opcje aby pom\u00f3c w usuwaniu b\u0142\u0119d\u00f3w w programie. +CPDesktopIntegrationDescription=Ustaw czy zezwala\u0107 na tworzenie skr\u00f3tu na pulpicie. +CPJVMPluginArguments=Ustaw argumenty maszyny wirtualnej Java (JVM) dla wtyczki. +CPJVMitwExec=Ustaw maszyn\u0119 wirtualn\u0105 Java (JVM) dla IcedTea-Web \u2014 dzia\u0142aj\u0105c\u0105 najlepiej z OpenJDK +CPJVMitwExecValidation=Sprawd\u017a JVM dla IcedTea-Web +CPJVMPluginSelectExec=Przegl\u0105daj za JVM dla IcedTea-Web +CPJVMnone=Brak wyniku sprawdzianu dla +CPJVMvalidated=Wynik sprawdzianu dla +CPJVMvalueNotSet=Nie ustawiono warto\u015bci. Stosowana b\u0119dzie JVM zakodowana na sztywno. +CPJVMnotLaunched=B\u0142\u0105d: Nie wystartowano procesu. Zobacz komunikaty konsoli, aby uzyska\u0107 wi\u0119cej informacji. +CPJVMnoSuccess=B\u0142\u0105d: Nie zako\u0144czono procesu pomy\u015blnie. Zobacz komunikaty aby uzyska\u0107 szczeg\u00f3\u0142y, przyczym Java jest \u017ale ustawiona. +CPJVMopenJdkFound=Znakomicie, wykryto OpenJDK +CPJVMoracleFound=Wspaniale, wykryto Oracle Java +CPJVMibmFound=Dobrze, wykryto IBM Java +CPJVMgijFound=Ostrze\u017cenie, wykryto gij +CPJVMstrangeProcess=\u015acie\u017cka mia\u0142a proces wykonywalny, lecz go nie rozpoznano. Sprawd\u017a wersj\u0119 Java w komunikatach konsoli. +CPJVMnotDir=B\u0142\u0105d: Wybrana \u015bcie\u017cka nie jest katalogiem. +CPJVMisDir=Wybrana \u015bcie\u017cka jest katalogiem. +CPJVMnoJava=B\u0142\u0105d: Wybrana \u015bcie\u017cka nie zawiera bin/java. +CPJVMjava=Wybrana \u015bcie\u017cka zawiera bin/java. +CPJVMnoRtJar=B\u0142\u0105d: Wybrana \u015bcie\u017cka nie zawiera lib/rt.jar. +CPJVMrtJar=Wybrana \u015bcie\u017cka zawiera lib/rt.jar. +CPJVMPluginAllowTTValidation=Sprawd\u017a JRE bezzw\u0142ocznie +CPJVMNotokMessage1=Wprowadzono nieprawid\u0142ow\u0105 warto\u015b\u0107 JDK ({0}) z nast\u0119puj\u0105cym komunikatem o b\u0142\u0119dzie: +CPJVMNotokMessage2=Przyczyn\u0105 tego komunikatu mog\u0105 by\u0107:
* Nie zaliczono niekt\u00f3trych sprawdzan\u00f3w
* Wykryto inny ni\u017c OpenJDK
Ze wzgl\u0119du na nieprawid\u0142owy JDK IcedTea-Web prawdopodobnie nie b\u0119dzie w stanie wystartowa\u0107.
Trzeba b\u0119dzie dostosowa\u0107 lub usun\u0105\u0107 w\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d w pliku konfiguracyjnym \u201e{1}\u201d.
Przeszukaj system za OpenJDK. +CPJVMconfirmInvalidJdkTitle=Nieprawid\u0142owy JDK +CPJVMconfirmReset=Przywr\u00f3ci\u0107 stan domy\u015blny? + +# Control Panel - Buttons +CPButAbout=O... +CPButNetworkSettings=Ustawienia sieciowe... +CPButSettings=Ustawienia... +CPButView=Przegl\u0105daj... +CPButCertificates=Certyfikaty... + +# Control Panel - Headers +CPHead=Panel sterowania IcedTea-Web +CPHeadAbout=\u00a0O\u00a0IcedTea-Web\u00a0 +CPHeadNetworkSettings=\u00a0Ustawienia\u00a0proxy\u00a0sieciowego\u00a0 +CPHeadTempInternetFiles=\u00a0Internetowe\u00a0pliki\u00a0tymczasowe\u00a0 +CPHeadJRESettings=\u00a0Ustawienia\u00a0\u015brodowiska\u00a0uruchomieniowego\u00a0Java\u00a0 +CPHeadCertificates=\u00a0Certyfikaty\u00a0 +CPHeadDebugging=\u00a0Ustawienia\u00a0analizy\u00a0i\u00a0usuwania\u00a0b\u0142\u0119d\u00f3w\u00a0 +CPHeadDesktopIntegration=\u00a0Integracja\u00a0z\u00a0pulpitem\u00a0 +CPHeadSecurity=\u00a0Ustawienia\u00a0bezpiecze\u0144stwa\u00a0 +CPHeadJVMSettings=\u00a0Ustawienia\u00a0maszyny\u00a0wirtualnej\u00a0Java\u00a0(JVM)\u00a0 + +# Control Panel - Tabs +CPTabAbout=O IcedTea-Web +CPTabCache=Pami\u0119\u0107 podr\u0119czna +CPTabCertificate=Certyfikaty +CPTabClassLoader=\u0141adowarki klas +CPTabDebugging=Usuwanie b\u0142\u0119d\u00f3w +CPTabDesktopIntegration=Integracja z pulpitem +CPTabNetwork=Sie\u0107 +CPTabRuntimes=\u015arodowiska uruchomieniowe +CPTabSecurity=Bezpiecze\u0144stwo +CPTabJVMSettings=Ustawienia JVM + +# Control Panel - AboutPanel +CPAboutInfo=Ten panel sterowania s\u0142u\u017cy do ustawiania pliku deployments.properties.
Nie wszystkie opcje maj\u0105 efekt, dop\u00f3ki nie zostan\u0105 obj\u0119te implementacj\u0105.
Stosowanie wielu \u015brodowisk uruchomieniowych Java (JRE) jest obecnie nieobs\u0142ugiwane.
+ +# Control Panel - AdvancedProxySettings +APSDialogTitle=Ustawienia sieciowe +APSServersPanel=Serwery +APSProxyTypeLabel=Typ +APSProxyAddressLabel=Adres proxy +APSProxyPortLabel=Port proxy +APSLabelHTTP=HTTP +APSLabelSecure=Bezpieczny +APSLabelFTP=FTP +APSLabelSocks=Socks +APSSameProxyForAllProtocols=Stosuj ten sam serwer proxy dla wszystkich protoko\u0142\u00f3w. +APSExceptionsLabel=Wyj\u0105tki +APSExceptionsDescription=Nie stosuj serwera proxy dla adres\u00f3w zaczynaj\u0105cych si\u0119 na: +APSExceptionInstruction=Odgradzaj ka\u017cd\u0105 pozycj\u0119 \u015brednikiem (;). + +# Control Panel - DebugginPanel +DPEnableTracing=W\u0142\u0105cz \u015bledzenie +DPEnableLogging=W\u0142\u0105cz protoko\u0142owanie +DPDisable=Wy\u0142\u0105cz +DPHide=Ukrywaj na starcie +DPShow=Pokazuj na starcie +DPJavaConsole=Konsola Java + +# Control Panel - DesktopShortcutPanel +DSPNeverCreate=Nigdy nie tw\u00f3rz +DSPAlwaysAllow=Zawsze zezwalaj +DSPAskUser=Pytaj u\u017cytkownika +DSPAskIfHinted=Pytaj je\u015bli sugerowane +DSPAlwaysIfHinted=Zawsze je\u015bli sugerowane + +# Control Panel - NetworkSettingsPanel +NSDescription-1=Brak ustawienia +NSDescription0=Stosuj po\u0142\u0105czenia bezpo\u015bredniego. +NSDescription1=Zast\u0105p ustawienia proxy przegl\u0105darki. +NSDescription2=Stosuj skrypt automatycznej konfiguracji proxy z danej lokalizacji. +NSDescription3=Stosuj ustawienia proxy domy\u015blnej przegl\u0105darki do \u0142\u0105czenia si\u0119 z internetem. +NSAddress=Adres +NSPort=Port +NSAdvanced=Zaawansowane +NSBypassLocal=Pomijaj serwer proxy dla adres\u00f3w lokalnych +NSDirectConnection=Bezpo\u015brednie po\u0142\u0105czenie +NSManualProxy=R\u0119czny serwer proxy +NSAutoProxy=Skrypt automatycznej konfiguracji proxy +NSBrowserProxy=Stosuj ustawienia przegl\u0105darki +NSScriptLocation=Lokalizacja skryptu + +# Control Panel - SecurityGeneralPanel +SGPAllowUserGrantSigned=Zezw\u00f3l u\u017cytkownikom udziela\u0107 uprawnienia podpisanemu materia\u0142owi +SGPAllowUserGrantUntrust=Zezw\u00f3l u\u017cytkownikom udziela\u0107 uprawnienia materia\u0142owi od niezaufanego organu +SGPUseBrowserKeystore=U\u017cywaj certyfikaty i klucze z bazy kluczy przegl\u0105darki (nieobs\u0142ugiwane) +SGPUsePersonalCertOneMatch=Automatycznie u\u017cywaj certyfikat osobisty gdy wy\u0142\u0105cznie jeden pasuje do \u017c\u0105dania serwera (nieobs\u0142ugiwane) +SGPWarnCertHostMismatch=Ostrzegaj gdy certyfikat witryny nie odpowiada nazwie komputera +SGPShowValid=Pokazuj certyfikat witryny, nawet gdy jest wa\u017cny (nieobs\u0142ugiwane) +SGPShowSandboxWarning=Pokazuj ostrzegawczy nag\u0142\u00f3wek piaskownicy +SGPAllowUserAcceptJNLPSecurityRequests=Zezw\u00f3l u\u017cytkownikom akceptowa\u0107 \u017c\u0105dania bezpiecze\u0144stwa JNLP +SGPCheckCertRevocationList=Sprawdzaj odwo\u0142anie certyfikat\u00f3w stosuj\u0105c listy odwo\u0142ania certyfikat\u00f3w (CRL) (nieobs\u0142ugiwane) +SGPEnableOnlineCertValidate=W\u0142\u0105cz internetowe potwierdzanie certyfikat\u00f3w (nieobs\u0142ugiwane) +SGPEnableTrustedPublisherList=W\u0142\u0105cz list\u0119 zaufanych wydawc\u00f3w (nieobs\u0142ugiwane) +SGPEnableBlacklistRevocation=W\u0142\u0105cz sprawdzanie odwo\u0142ania czarnej listy (nieobs\u0142ugiwane) +SGPEnableCachingPassword=W\u0142\u0105cz przechowywanie has\u0142a do uwierzytelniania (nieobs\u0142ugiwane) +SGPUseSSL2=U\u017cywaj format ClientHello kompatybilny do SSL 2.0 (nieobs\u0142ugiwane) +SGPUseSSL3=U\u017cywaj SSL 3.0 (nieobs\u0142ugiwane) +SGPUseTLS1=U\u017cywaj TLS 1.0 (nieobs\u0142ugiwane) + +# Control Panel - TemporaryInternetFilesPanel +TIFPEnableCache=Pozostawiaj pliki tymczasowe na moim komputerze. +TIFPLocation=\u00a0Lokalizacja\u00a0 +TIFPLocationLabel=Wybierz lokalizacj\u0119 sk\u0142adowania plik\u00f3w tymczasowych +TIFPChange=Zmie\u0144 +TIFPDiskSpace=\u00a0Miejsce\u00a0na\u00a0dysku\u00a0 +TIFPCompressionLevel=Wybierz poziom kompresji plik\u00f3w JAR +TIFPNone=Brak +TIFPMax=Maksymalny +TIFPCacheSize=Nastaw wielko\u015b\u0107 miejsca na dysku do sk\u0142adowania plik\u00f3w tymczasowych +TIFPDeleteFiles=Usu\u0144 pliki +TIFPViewFiles=Przegl\u0105daj pliki... + +# Control Panel - Cache Viewer +CVCPDialogTitle=Podgl\u0105d pami\u0119ci podr\u0119cznej +CVCPButRefresh=Od\u015bwie\u017c +CVCPButDelete=Usu\u0144 +CVCPColLastModified=Data modyfikacji +CVCPColSize=Wielko\u015b\u0107 (w bajtach) +CVCPColDomain=Domena +CVCPColType=Typ +CVCPColPath=\u015acie\u017cka +CVCPColName=Nazwa + +# Control Panel - Misc. +CPJRESupport=IcedTea-Web obecnie nie obs\u0142uguje stosowania wielu \u015brodowisk uruchomieniowych Java (JRE). +CPInvalidPort=Podano nieprawid\u0142owy numer portu.\n[Prawid\u0142owe numery portu s\u0105 1-65535] +CPInvalidPortTitle=B\u0142\u0105d przy wczytywaniu. + +# command line control panel +CLNoInfo=Brak informacji (czy ta opcja jest prawid\u0142owa?). +CLValue=Warto\u015b\u0107: {0} +CLValueSource=Pochodzi z: {0} +CLDescription=Opis: {0} +CLUnknownCommand=Nie rozpoznano rozkazu \u201e{0}\u201d. +CLUnknownProperty=Nieznana nazwa w\u0142a\u015bciwo\u015bci \u201e{0}\u201d +CLWarningUnknownProperty=UWAGA: W\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d jest nieznana, utworzono now\u0105 w\u0142a\u015bciwo\u015b\u0107 +CLNoIssuesFound=Nie znaleziono \u017cadnych problem\u00f3w. +CLIncorrectValue=W\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d zawiera nieprawid\u0142ow\u0105 warto\u015b\u0107 \u201e{1}\u201d. Mo\u017cliwe warto\u015bci {2} +CLListDescription=Pokazuje list\u0119 z wszystkimi nazwami i warto\u015bciami w\u0142a\u015bciwo\u015bci, kt\u00f3re s\u0105\nprzestrzegane przez IcedTea-Web. +CLGetDescription=Pokazuje warto\u015b\u0107 property-name +CLSetDescription=Ustawia warto\u015b\u0107 w\u0142a\u015bciwo\u015bci property-name, je\u015bli to mo\u017cliwe.\nWarto\u015b\u0107 podlega analizie prawid\u0142owo\u015bci. Je\u015bli administrator zablokowa\u0142 t\u0119\nw\u0142a\u015bciwo\u015b\u0107, ustawianie nie b\u0119dzie mia\u0142o efektu. +CLResetDescription=Przywraca warto\u015b\u0107 domy\u015bln\u0105 dla w\u0142a\u015bciwo\u015bci property-name.\nall przywraca warto\u015bci domy\u015blne dla wszystkich w\u0142a\u015bciwo\u015bci przestrzeganych\nprzez IcedTea-Web. +CLInfoDescription=Pokazuje wi\u0119cej informacji o podanej w\u0142a\u015bciwo\u015bci +CLCheckDescription=Pokazuje w\u0142a\u015bciwo\u015bci kt\u00f3re zdefiniowano, lecz nie s\u0105 przestrzegane przez\nIcedTea-Web. +CLHelpDescription=Za pomoc\u0105 narz\u0119dzia itweb-settings u\u017cytkownik mo\u017ce modyfikowa\u0107, przegl\u0105da\u0107 i\nsprawdza\u0107 konfiguracj\u0119. Aby u\u017cy\u0107 interfejsu graficznego, nie podawaj \u017cadnych\nargument\u00f3w. Aby u\u017cy\u0107 trybu wiersza polece\u0144, podaj w\u0142a\u015bciwy rozkaz i parametry.\n\u201e{0} rozkaz help\u201d udziela pomocy dla szczeg\u00f3lnego rozkazu. + +# splash screen related +SPLASHerror=Kliknij tu aby uzyska\u0107 szczeg\u00f3\u0142y. Wyst\u0105pi\u0142 powa\u017cny wyj\u0105tek. +SPLASH_ERROR=B\u0141\u0104D +SPLASHtitle=Tytu\u0142 +SPLASHvendor=Dostawca +SPLASHhomepage=Witryna +SPLASHdescription=Opis +SPLASHClose=Zamknij +SPLASHclosewAndCopyException=Zamknij i kopiuj \u015blad stosu do schowka +SPLASHexOccured=Wyst\u0105pi\u0142 powa\u017cny wyj\u0105tek... +SPLASHHome=Pocz\u0105tek +SPLASHcantCopyEx=Nie mo\u017cna skopiowa\u0107 wyj\u0105tku +SPLASHnoExRecorded=Nie odnotowano wyj\u0105tku +SPLASHmainL1=Aby uzyska\u0107 wi\u0119cej informacji wejd\u017a na stron\u0119 {0} i zastosuj tam opisane kroki aby pozyska\u0107 informacje niezb\u0119dne do z\u0142o\u017cenia raportu o b\u0142\u0119dzie w programie. +SPLASHurl=http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs +SPLASHurlLooks=http://icedtea.classpath.org/wiki/IcedTea-Web +SPLASHmainL3=Brak dodatkowych informacji, spr\u00f3buj uruchomi\u0107 przegl\u0105dark\u0119 z wiersza polece\u0144 i przeanalizowa\u0107 dane wyj\u015bciowe. +SPLASHcloseAndCopyShorter=Zamknij i kopiuj do schowka +SPLASHmainL4=Wyst\u0105pi\u0142 nast\u0119puj\u0105cy wyj\u0105tek. Aby uzyska\u0107 wi\u0119cej informacji, spr\u00f3buj uruchomi\u0107 przegl\u0105dark\u0119 z wiersza polece\u0144 i przeanalizowa\u0107 dane wyj\u015bciowe. +SPLASHexWas=Wyj\u0105tek: +SPLASHcfl=Brak dost\u0119pu za pomoc\u0105 odno\u015bnika do +SPLASHvendorsInfo=Informacje od dostawcy twojej aplikacji +SPLASHanotherInfo=Inna dost\u0119pna informacja +SPLASHdefaultHomepage=Brak witryny, sprawd\u017a raczej \u017ar\u00f3d\u0142o +SPLASHerrorInInformation=Wyst\u0105pi\u0142 b\u0142\u0105d w trakcie \u0142adowania elementu \u201einformation\u201d, sprawd\u017a raczej \u017ar\u00f3d\u0142o +SPLASHmissingInformation=Brak elementu \u201einformation\u201d, sprawd\u017a raczej \u017ar\u00f3d\u0142o +SPLASHchainWas=To jest lista wyj\u0105tk\u00f3w kt\u00f3re wyst\u0105pi\u0142y w trakcie startowania applet-u. Prosz\u0119 zauwa\u017cy\u0107, \u017ce wyj\u0105tki te mog\u0105 pochodzi\u0107 z r\u00f3\u017cnych applet-\u00f3w. Aby uzyska\u0107 po\u017cyteczny raport o b\u0142\u0119dzie w programie, upewnij si\u0119 aby wykonywano wy\u0142\u0105cznie jeden applet. + +APPEXTSECappletSecurityLevelExtraHighId=Wy\u0142\u0105cz uruchamianie wszystkich applet-\u00f3w Java +APPEXTSECappletSecurityLevelVeryHighId=Bardzo wysokie bezpiecze\u0144stwo +APPEXTSECappletSecurityLevelHighId=Wysokie bezpiecze\u0144stwo +APPEXTSECappletSecurityLevelLowId=Niskie bezpiecze\u0144stwo +APPEXTSECappletSecurityLevelExtraHighExplanation=\u017baden applet nie b\u0119dzie uruchamiany +APPEXTSECappletSecurityLevelVeryHighExplanation=Wy\u0142\u0105cznie podpisane applet-y b\u0119d\u0105 uruchamianie +APPEXTSECappletSecurityLevelHighExplanation=U\u017cytkownik b\u0119dzie pytany dla ka\u017cdego applet-u +APPEXTSECappletSecurityLevelLowExplanation=Wszystkie applet-y b\u0119d\u0105 uruchamianie, nawet niepodpisane +APPEXTSECunsignedAppletActionAlways=Zawsze ufaj tym (zaznaczonym) applet-om +APPEXTSECunsignedAppletActionNever=Nigdy nie ufaj tym (zaznaczonym) applet-om +APPEXTSECunsignedAppletActionYes=Wizytowano i zezwolono temu applet-owi +APPEXTSECunsignedAppletActionNo=Wizytowano i odm\u00f3wiono zezwolenia temu applet-owi +APPEXTSECControlPanelExtendedAppletSecurityTitle=Rozszerzone bezpiecze\u0144stwo applet-\u00f3w +APPEXTSECguiTableModelTableColumnAction=Akcja +APPEXTSECguiTableModelTableColumnDateOfAction=Data akcji +APPEXTSECguiTableModelTableColumnDocumentBase=Baza dokumentu +APPEXTSECguiTableModelTableColumnCodeBase=Baza kodu +APPEXTSECguiTableModelTableColumnArchives=Archiwa +APPEXTSECguiPanelAppletInfoHederPart1={0} {1} +APPEXTSECguiPanelAppletInfoHederPart2={0} od {1} +APPEXTSECguiPanelConfirmDeletionOf=Czy na pewno chcesz usun\u0105\u0107 nast\u0119puj\u0105ce pozycje: {0}? +APPEXTSECguiPanelHelpButton=Pomoc +APPEXTSECguiPanelSecurityLevel=Poziom bezpiecze\u0144stwa +APPEXTSECguiPanelGlobalBehaviourCaption=Ustawienia systemowe post\u0119powania przy obs\u0142udze applet-\u00f3w +APPEXTSECguiPanelDeleteMenuSelected=Zaznaczone +APPEXTSECguiPanelDeleteMenuAllA=Wszystkie dozwolone (A) +APPEXTSECguiPanelDeleteMenuAllN=Wszystkie zabronione (N) +APPEXTSECguiPanelDeleteMenuAlly=Wszystkie zatwierdzone (y) +APPEXTSECguiPanelDeleteMenuAlln=Wszystkie odrzucone (n) +APPEXTSECguiPanelDeleteMenuAllAll=Bezwzgl\u0119dnie wszystkie +APPEXTSECguiPanelDeleteButton=Usu\u0144 +APPEXTSECguiPanelDeleteButtonToolTip=Naciskaj\u0105c klawisz DEL, podczas przegl\u0105dania tabeli, mo\u017cesz usun\u0105\u0107 zaznaczone wpisy +APPEXTSECguiPanelTestUrlButton=Testuj URL +APPEXTSECguiPanelAddRowButton=Dodaj now\u0105 linijk\u0119 +APPEXTSECguiPanelValidateTableButton=Sprawd\u017a tabel\u0119 +APPEXTSECguiPanelAskeforeActionBox=Pytaj przed akcj\u0105 +APPEXTSECguiPanelShowRegExesBox=W pe\u0142ni pokazuj wyra\u017cenia regularne +APPEXTSECguiPanelInverSelection=Odwr\u00f3\u0107 zaznaczenia +APPEXTSECguiPanelMoveRowUp=Przesu\u0144 linijk\u0119 w g\u00f3r\u0119 +APPEXTSECguiPanelMoveRowDown=Przesu\u0144 linijk\u0119 w d\u00f3\u0142 +APPEXTSECguiPanelCustomDefs=Definicje u\u017cytkownika +APPEXTSECguiPanelGlobalDefs=Definicje systemowe +APPEXTSECguiPanelDocTest=Wpisz URL bazy dokumentowej +APPEXTSECguiPanelCodeTest=Wpisz URL bazy kodu +APPEXTSECguiPanelNoMatch=Nie znaleziono hase\u0142 +APPEXTSECguiPanelMatchingNote=Tylko pierwsze znalezione has\u0142o b\u0119dzie uwzgl\u0119dniane w rezultacie. +APPEXTSECguiPanelMatched=Znaleziono +APPEXTSECguiPanelMatchingError=B\u0142\u0105d podczas wyszukiwania: {0} +APPEXTSECguiPanelCanNotValidate=Nie mo\u017cna potwierdzi\u0107, poniewa\u017c nie mo\u017cna utworzy\u0107 pliku tymczasowego \u201e{0}\u201d. +APPEXTSECguiPanelEmptyDoc=Wszystkie bazy dokumentowe musz\u0105 by\u0107 wype\u0142nione +APPEXTSECguiPanelEmptyCode=Wszystkie bazy kodu musz\u0105 by\u0107 wype\u0142nione +APPEXTSECguiPanelTableValid=Tabla wygl\u0105da w porz\u0105dku +APPEXTSECguiPanelTableInvalid=Tabela niepoprawna z powodu nast\u0119puj\u0105cego b\u0142\u0119du: {0} +APPEXTSECguiPanelShowOnlyPermanent=Pokazuj wy\u0142\u0105cznie wpisy sta\u0142e +APPEXTSECguiPanelShowOnlyTemporal=Pokazuj wy\u0142\u0105cznie wpisy tymczasowo zadecydowane +APPEXTSECguiPanelShowAll=Pokazuj wszystkie wpisy +APPEXTSECguiPanelShowOnlyPermanentA=Pokazuj wy\u0142\u0105cznie zezwolone wpisy sta\u0142e +APPEXTSECguiPanelShowOnlyPermanentN=Pokazuj wy\u0142\u0105cznie zabronione wpisy sta\u0142e +APPEXTSECguiPanelShowOnlyTemporalY=Pokazuj poprzednio zezwolone wpisy applet-\u00f3w +APPEXTSECguiPanelShowOnlyTemporalN=Pokazuj poprzednio odm\u00f3wione wpisy applet-\u00f3w +APPEXTSEChelpHomeDialogue=Dialog diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/Messages.properties icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/Messages.properties --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/Messages.properties 2013-04-10 14:30:03.340821000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/Messages.properties 2013-05-03 19:08:24.251520110 +0000 @@ -51,11 +51,11 @@ LNullUpdatePolicy=Update policy cannot be null. LThreadInterrupted=Thread interrupted while waiting for file to launch. -LThreadInterruptedInfo= +LThreadInterruptedInfo=This can lead to deadlock or yield other damage during execution. Please restart your application/browser. LCouldNotLaunch=Could not launch JNLP file. -LCouldNotLaunchInfo= +LCouldNotLaunchInfo=The application has not been initialized, for more information execute javaws/browser from the command line and send a bug report. LCantRead=Could not read or parse the JNLP file. -LCantReadInfo= +LCantReadInfo=You can try to download this file manually and send it as bug report to IcedTea-Web team. LNullLocation=Could not determine .jnlp file location. LNullLocationInfo=An attempt was made to launch a JNLP file in another JVM, but the file could not be located. In order to launch in an external JVM, the runtime must be able to locate the .jnlp file either in the local filesystem or on a server. LNetxJarMissing=Could not determine location of netx.jar. @@ -69,15 +69,20 @@ LNoInstallers=Installers not supported. LNoInstallersInfo=JNLP installer files are not yet supported. LInitApplet=Could not initialize applet. -LInitAppletInfo= +LInitAppletInfo=For more information click "more information button". LInitApplication=Could not initialize application. -LInitApplicationInfo= +LInitApplicationInfo=The application has not been initialized, for more information execute javaws from the command line. LNotLaunchable=Not a launchable JNLP file. LNotLaunchableInfo=File must be a JNLP application, applet, or installer type. LCantDetermineMainClass=Unknown Main-Class. LCantDetermineMainClassInfo=Could not determine the main class for this application. LUnsignedJarWithSecurity=Cannot grant permissions to unsigned jars. LUnsignedJarWithSecurityInfo=Application requested security permissions, but jars are not signed. +LSignedJNLPAppDifferentCerts=The JNLP application is not fully signed by a single cert. +LSignedJNLPAppDifferentCertsInfo=The JNLP application has its components individually signed, however there must be a common signer to all entries. +LUnsignedApplet=The applet was unsigned. +LUnsignedAppletPolicyDenied=The applet was unsigned, and the security policy prevented it from running. +LUnsignedAppletUserDenied=The applet was unsigned, and was not trusted. LSignedAppJarUsingUnsignedJar=Signed application using unsigned jars. LSignedAppJarUsingUnsignedJarInfo=The main application jar is signed, but some of the jars it is using aren't. LSignedJNLPFileDidNotMatch=The signed JNLP file did not match the launching JNLP file. @@ -94,28 +99,28 @@ LNotVerified=Jars not verified. LCancelOnUserRequest=Canceled on user request. LFatalVerification=A fatal error occurred while trying to verify jars. -LFatalVerificationInfo=Description +LFatalVerificationInfo=An exception has been thrown in class JarCertVerifier. Being unable to read the cacerts or trusted.certs files could be a possible cause for this exception. LNotVerifiedDialog=Not all jars could be verified. LAskToContinue=Would you still like to continue running this application? # Parser -PInvalidRoot=Root node is not a jnlp node -PNoResources=No resources section defined +PInvalidRoot=Root element is not a jnlp element. +PNoResources=No resources element specified. PUntrustedNative=nativelib element cannot be specified unless a trusted environment is requested. PExtensionHasJ2SE=j2se element cannot be specified in a component extension file. PInnerJ2SE=j2se element cannot be specified within a j2se element. -PTwoMains=Duplicate main JAR defined in a resources element (there can be only one) -PNativeHasMain=Cannot specify main attribute on native JARs. -PNoInfoElement=No information section defined. +PTwoMains=Duplicate main attribute specified on a resources element (there can be only one) +PNativeHasMain=main attribute cannot be specified on a nativelib element. +PNoInfoElement=No information element specified. PMissingTitle=title PMissingVendor=vendor -PMissingElement=The {0} section has not been defined for your locale nor does a default value exist in the JNLP file. -PTwoDescriptions=Duplicate description of kind {0} -PSharing=Element "sharing-allowed" is illegal in a standard JNLP file -PTwoSecurity=Only one security element allowed per JNLPFile. -PEmptySecurity=Security element specified but does not contain a permissions element. -PTwoDescriptors=Only one application descriptor element allowed per JNLPFile. +PMissingElement=The {0} section has not been specified for your locale nor does a default value exist in the JNLP file. +PTwoDescriptions=Duplicate description elements of kind {0} are illegal. +PSharing=sharing-allowed element is illegal in a standard JNLP file +PTwoSecurity=Only one security element allowed per JNLP file. +PEmptySecurity=security element specified but does not contain a permissions element. +PTwoDescriptors=Only one application-desc element allowed per JNLP file. PTwoDesktops=Only one desktop element allowed PTwoMenus=Only one menu element allowed PTwoTitles=Only one title element allowed @@ -139,6 +144,7 @@ BBadProp=Incorrect property format {0} (should be key=value) BBadParam=Incorrect parameter format {0} (should be name=value) BNoDir=Directory {0} does not exist. +BNoCodeOrObjectApplet=Applet tag must specify a 'code' or 'object' attribute. RNoResource=Missing Resource: {0} RShutdown=This exception to prevent shutdown of JVM, but the process has been terminated. RExitTaken=Exit class already set and caller is not exit class. @@ -174,7 +180,7 @@ BOArg = Adds an application argument before launching. BOParam = Adds an applet parameter before launching. BOProperty = Sets a system property before launching. -BOUpdate = Update check if seconds since last checked. +BOUpdate = Check for updates. BOLicense = Display the GPL license and exit. BOVerbose = Enable verbose output. BOAbout = Shows a sample application. @@ -194,11 +200,11 @@ CDownloading=Downloading CComplete=Complete CChooseCache=Choose a cache directory... -CChooseCacheInfo=Netx needs a location for storing cache files. +CChooseCacheInfo=NetX needs a location for storing cache files. CChooseCacheDir=Cache directory CCannotClearCache=Can not clear cache at this time CFakeCache=Cache is corrupt. Fixing. -CFakedCache=Cache is corrupt and has been fixed. It is strongly recommended that you run 'javaws -Xclearcache' and rerun your application as soon as possible. +CFakedCache=Cache was corrupt and has been fixed. It is strongly recommended that you run 'javaws -Xclearcache' and rerun your application as soon as possible. # Security SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action? @@ -208,7 +214,7 @@ SSigVerified=The application's digital signature has been verified. Do you want to run the application? SSignatureError=The application's digital signature has an error. Do you want to run the application? SUntrustedSource=The digital signature could not be verified by a trusted source. Only run if you trust the origin of the application. -SWarnFullPermissionsIgnorePolicy=The code executed will be given full permissions, ignoring any java policies you may have. +SWarnFullPermissionsIgnorePolicy=The code executed will be given full permissions, ignoring any Java policies you may have. STrustedSource=The digital signature has been validated by a trusted source. SClipboardReadAccess=The application has requested read-only access to the system clipboard. Do you want to allow this action? SClipboardWriteAccess=The application has requested write-only access to the system clipboard. Do you want to allow this action? @@ -218,6 +224,14 @@ SUnverified=(unverified) SAlwaysTrustPublisher=Always trust content from this publisher SHttpsUnverified=The website's HTTPS certificate cannot be verified. +SRememberOption=Remember this option? +SRememberAppletOnly=For applet +SRememberCodebase=For site {0} +SUnsignedSummary=An unsigned Java application wants to run +SUnsignedDetail=An unsigned application from the following location wants to run:
  {0}
The page which made the request was:
  {1}

It is recommended you only run applications from sites you trust. +SUnsignedAllowedBefore=You have accepted this applet previously. +SUnsignedRejectedBefore=You have rejected this applet previously. +SUnsignedQuestion=Allow the applet to run? SNotAllSignedSummary=Only parts of this application code are signed. SNotAllSignedDetail=This application contains both signed and unsigned code. While signed code is safe if you trust the provider, unsigned code may imply code outside of the trusted provider's control. SNotAllSignedQuestion=Do you wish to proceed and run this application anyway? @@ -228,14 +242,13 @@ SBadKeyUsage=Resources contain entries whose signer certificate's KeyUsage extension doesn't allow code signing. SBadExtendedKeyUsage=Resources contain entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing. SBadNetscapeCertType=Resources contain entries whose signer certificate's NetscapeCertType extension doesn't allow code signing. -SHasUnsignedEntry=Resources contain unsigned entries which have not been integrity-checked. SHasExpiredCert=The digital signature has expired. SHasExpiringCert=Resources contain entries whose signer certificate will expire within six months. SNotYetValidCert=Resources contain entries whose signer certificate is not yet valid. SUntrustedCertificate=The digital signature was generated with an untrusted certificate. STrustedCertificate=The digital signature was generated with a trusted certificate. -SCNMisMatch=The expected hostname for this certificate is: "{0}"
The address being connected to is: "{1}" -SRunWithoutRestrictions=This application will be run without the security restrictions normally provided by java. +SCNMisMatch=The expected hostname for this certificate is: "{0}"
The address being connected to is: "{1}" +SRunWithoutRestrictions=This application will be run without the security restrictions normally provided by Java. SCertificateDetails=Certificate Details # Security - certificate information @@ -270,7 +283,7 @@ KSCerts=Trusted Certificates KSJsseCerts=Trusted JSSE Certificates KSCaCerts=Trusted Root CA Certificates -KSJsseCaCerts=Trusted JSSE Root CA Certificates, +KSJsseCaCerts=Trusted JSSE Root CA Certificates KSClientCerts=Client Authentication Certificates # Deployment Configuration messages @@ -282,7 +295,7 @@ # Value Validator messages. Messages should follow "Possible values ..." VVPossibleValues=Possible values {0} VVPossibleBooleanValues=are {0} or {1} -VVPossibleFileValues=include the absolute location of a file - it must begin with a / +VVPossibleFileValues=include an absolute path to a file or directory VVPossibleRangedIntegerValues=are in range {0} to {1} (inclusive) VVPossibleUrlValues=include any valid url (eg http://icedtea.classpath.org/hg/) @@ -291,7 +304,7 @@ CPMainDescriptionLong=Configure how the browser plugin (IcedTeaNPPlugin) and javaws (NetX) work # Control Panel - Tab Descriptions -CPAboutDescription=View version information about Icedtea Control Panel. +CPAboutDescription=View version information about IcedTea Control Panel. CPNetworkSettingsDescription=Configure network settings, including how IcedTea-Web connects to the internet and whether to use any proxies. CPTempInternetFilesDescription=Java stores application data for faster execution the next time you run it. CPJRESettingsDescription=View and manage Java Runtime Environment versions and settings for Java applications and applets. @@ -300,6 +313,30 @@ CPDebuggingDescription=Enable options here to help with debugging CPDesktopIntegrationDescription=Set whether or not to allow creation of desktop shortcut. CPJVMPluginArguments=Set JVM arguments for plugin. +CPJVMitwExec=Set JVM for IcedTea-Web — working best with OpenJDK +CPJVMitwExecValidation=Validate JVM for IcedTea-Web +CPJVMPluginSelectExec=Browse for JVM for IcedTea-Web +CPJVMnone=No validation result for +CPJVMvalidated=Validation result for +CPJVMvalueNotSet=Value is not set. Hardcoded JVM will be used. +CPJVMnotLaunched=Error, process was not launched, see console output for more info. +CPJVMnoSuccess=Error, process have not ended successfully, see output for details, but your java is not set correctly. +CPJVMopenJdkFound=Excellent, OpenJDK detected +CPJVMoracleFound=Great, Oracle java detected +CPJVMibmFound=Good, IBM java detected +CPJVMgijFound=Warning, gij detected +CPJVMstrangeProcess=Your path had an executable process, but it was not recognized. Verify the Java version in the console output. +CPJVMnotDir=Error, The path you chose is not a directory. +CPJVMisDir=Ok, the path you chose is a directory. +CPJVMnoJava=Error, the directory you chose does not contain bin/java. +CPJVMjava=Ok, the directory you chose contains bin/java. +CPJVMnoRtJar=Error, the directory you chose does not contain lib/rt.jar +CPJVMrtJar=Ok, the directory you chose contains lib/rt.jar. +CPJVMPluginAllowTTValidation=Validate JRE immediately +CPJVMNotokMessage1=You have entered invalid JDK value ({0}) with following error message: +CPJVMNotokMessage2=You might be seeing this message because:
* Some validity tests have not been passed
* Non-OpenJDK is detected
With invalid JDK IcedTea-Web will probably not be able to start.
You will have to modify or remove {0} property in your configuration file {1}.
You should try to search for OpenJDK in your system or be sure you know what you are doing. +CPJVMconfirmInvalidJdkTitle=Confirm invalid JDK +CPJVMconfirmReset=Reset to default? # Control Panel - Buttons CPButAbout=About... @@ -309,16 +346,16 @@ CPButCertificates=Certificates... # Control Panel - Headers -CPHead=IcedTea Web Control Panel -CPHeadAbout=About -CPHeadNetworkSettings=Network Proxy Settings -CPHeadTempInternetFiles=Temporary Internet Files -CPHeadJRESettings=Java Runtime Environment Settings -CPHeadCertificates=Certificates -CPHeadDebugging=Debugging Settings -CPHeadDesktopIntegration=Desktop Integrations -CPHeadSecurity=Security Settings -CPHeadJVMSettings=JVM Settings +CPHead=IcedTea-Web Control Panel +CPHeadAbout=\u00a0About\u00a0IcedTea-Web\u00a0 +CPHeadNetworkSettings=\u00a0Network\u00a0Proxy\u00a0Settings\u00a0 +CPHeadTempInternetFiles=\u00a0Temporary\u00a0Internet\u00a0Files\u00a0 +CPHeadJRESettings=\u00a0Java\u00a0Runtime\u00a0Environment\u00a0Settings\u00a0 +CPHeadCertificates=\u00a0Certificates\u00a0 +CPHeadDebugging=\u00a0Debugging\u00a0Settings\u00a0 +CPHeadDesktopIntegration=\u00a0Desktop\u00a0Integrations\u00a0 +CPHeadSecurity=\u00a0Security\u00a0Settings\u00a0 +CPHeadJVMSettings=\u00a0JVM\u00a0Settings\u00a0 # Control Panel - Tabs CPTabAbout=About IcedTea-Web @@ -382,14 +419,14 @@ NSScriptLocation=Script location # Control Panel - SecurityGeneralPanel -SGPAllowUserGrantSigned=Allow users to grant permissions to signed content -SGPAllowUserGrantUntrust=Allow users to grant permissions to content from an untrusted authority +SGPAllowUserGrantSigned=Allow users to grant permissions to signed content +SGPAllowUserGrantUntrust=Allow users to grant permissions to content from an untrusted authority SGPUseBrowserKeystore=Use certificates and keys in browser keystore (Unsupported) SGPUsePersonalCertOneMatch=Use personal certificate automatically if only one matches server request (Unsupported) -SGPWarnCertHostMismatch=Warn if site certificate does not match hostname +SGPWarnCertHostMismatch=Warn if site certificate does not match hostname SGPShowValid=Show site certificate even if it is valid (Unsupported) -SGPShowSandboxWarning=Show sandbox warning banner -SGPAllowUserAcceptJNLPSecurityRequests=Allow user to accept JNLP security requests +SGPShowSandboxWarning=Show sandbox warning banner +SGPAllowUserAcceptJNLPSecurityRequests=Allow user to accept JNLP security requests SGPCheckCertRevocationList=Check certificates for revocation using Certificate Revocation Lists (CRLs) (Unsupported) SGPEnableOnlineCertValidate=Enable online certificate validation (Unsupported) SGPEnableTrustedPublisherList=Enable list of trusted publishers (Unsupported) @@ -401,10 +438,10 @@ # Control Panel - TemporaryInternetFilesPanel TIFPEnableCache=Keep temporary files on my computer -TIFPLocation=Location +TIFPLocation=\u00a0Location\u00a0 TIFPLocationLabel=Select the location where temporary files are kept TIFPChange=Change -TIFPDiskSpace=Disk space +TIFPDiskSpace=\u00a0Disk\u00a0space\u00a0 TIFPCompressionLevel=Select the compression level for JAR files TIFPNone=None TIFPMax=Max @@ -441,7 +478,240 @@ CLListDescription=Shows a list of all property names and values that are in use by IcedTea-Web CLGetDescription=Shows the value for property-name CLSetDescription=Sets the property-name to value if possible. The value is checked for being valid. If the administrator has locked the property, this will have no effect -CLResetDescription=Resets the value for property-name to it\'s default value +CLResetDescription=Resets the value for property-name to it\'s default value.\nall resets all properties recognized by IcedTea-Web to their default value. CLInfoDescription=Shows more information about the given property -CLCheckDescription=Shows any properties that have been defined but are not recognized by IcedTea Web -CLHelpDescription=The itweb-settings tool allows a user to modify, view and check configuration. \nTo use the GUI, do not pass any arguments. To use the CLI mode, pass in the approrpiate command and parameters. For help with a particular command, try: {0} command help +CLCheckDescription=Shows any properties that have been defined but are not recognized by IcedTea-Web +CLHelpDescription=The itweb-settings tool allows a user to modify, view and check configuration.\nTo use the GUI, do not pass any arguments. To use the CLI mode, pass in the approrpiate command and parameters. For help with a particular command, try: {0} command help + +# splash screen related +SPLASHerror = Click here for details. Serious exception occurred. +SPLASH_ERROR = ERROR +SPLASHtitle = Title +SPLASHvendor = Vendor +SPLASHhomepage = Homepage +SPLASHdescription = Description +SPLASHClose= Close +SPLASHclosewAndCopyException = Close and copy the stack trace to clipboard +SPLASHexOccured = A serious exception has occurred... +SPLASHHome = Home +SPLASHcantCopyEx = Can not copy exception +SPLASHnoExRecorded = No exception recorded +SPLASHmainL1 = For even more information you can visit {0} and follow the steps described there on how to obtain necessary information to file bug +SPLASHurl = http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs +SPLASHurlLooks = http://icedtea.classpath.org/wiki/IcedTea-Web +SPLASHmainL3 = No further information available, try to launch the browser from the command line and examine the output. +SPLASHcloseAndCopyShorter = Close and copy to clipboard +SPLASHmainL4 = The folloing exception has occured. For more information, try to launch the browser from the command line and examine the output. +SPLASHexWas = Exception was: +SPLASHcfl = Can't follow link to +SPLASHvendorsInfo = Information from vendor of your application +SPLASHanotherInfo = Another available info +SPLASHdefaultHomepage = Unspecified homepage, verify source rather +SPLASHerrorInInformation = Error during loading of information element, verify source rather +SPLASHmissingInformation = Information element is missing, verify source rather +SPLASHchainWas = This is the list of exceptions that occurred launching your applet. Please note, those exceptions can originate from multiple applets. For a helpful bug report, be sure to run only one applet. + +APPEXTSECappletSecurityLevelExtraHighId=Disable running of all Java applets +APPEXTSECappletSecurityLevelVeryHighId=Very High Security +APPEXTSECappletSecurityLevelHighId=High Security +APPEXTSECappletSecurityLevelLowId=Low Security +APPEXTSECappletSecurityLevelExtraHighExplanation=No applet will be run +APPEXTSECappletSecurityLevelVeryHighExplanation=No unsigned applets will be run +APPEXTSECappletSecurityLevelHighExplanation=User will be prompted for each unsigned applet +APPEXTSECappletSecurityLevelLowExplanation=All, even unsigned, applets will be run +APPEXTSECunsignedAppletActionAlways=Always trust this (matching) applet(s) +APPEXTSECunsignedAppletActionNever=Never trust this (matching) applet(s) +APPEXTSECunsignedAppletActionYes=This applet was visited and allowed +APPEXTSECunsignedAppletActionNo=This applet was visited and denied +APPEXTSECControlPanelExtendedAppletSecurityTitle=Extended applet security +APPEXTSECguiTableModelTableColumnAction=Action +APPEXTSECguiTableModelTableColumnDateOfAction=Date of action +APPEXTSECguiTableModelTableColumnDocumentBase=Document-base +APPEXTSECguiTableModelTableColumnCodeBase=Code-base +APPEXTSECguiTableModelTableColumnArchives=Archives +APPEXTSECguiPanelAppletInfoHederPart1={0} {1} +APPEXTSECguiPanelAppletInfoHederPart2={0} from {1} +APPEXTSECguiPanelConfirmDeletionOf=Are you sure you want to delete following {0} items +APPEXTSECguiPanelHelpButton=Help +APPEXTSECguiPanelSecurityLevel=Security Level +APPEXTSECguiPanelGlobalBehaviourCaption=Settings of global behavior for applets +APPEXTSECguiPanelDeleteMenuSelected=selected +APPEXTSECguiPanelDeleteMenuAllA=all allowed (A) +APPEXTSECguiPanelDeleteMenuAllN=all forbidden (N) +APPEXTSECguiPanelDeleteMenuAlly=all approved (y) +APPEXTSECguiPanelDeleteMenuAlln=all rejected (n) +APPEXTSECguiPanelDeleteMenuAllAll=absolute all +APPEXTSECguiPanelDeleteButton=Delete +APPEXTSECguiPanelDeleteButtonToolTip=You can press delete key during browsing the table. It will act as delete selected +APPEXTSECguiPanelTestUrlButton=Test url +APPEXTSECguiPanelAddRowButton=Add new row +APPEXTSECguiPanelValidateTableButton=Validate table +APPEXTSECguiPanelAskeforeActionBox=Ask me before action +APPEXTSECguiPanelShowRegExesBox=Show full regular expressions +APPEXTSECguiPanelInverSelection=Invert selection +APPEXTSECguiPanelMoveRowUp=Move row up +APPEXTSECguiPanelMoveRowDown=Move row down +APPEXTSECguiPanelCustomDefs=User definitions +APPEXTSECguiPanelGlobalDefs=System definitions +APPEXTSECguiPanelDocTest=Type document base URL +APPEXTSECguiPanelCodeTest=Type code base URL +APPEXTSECguiPanelNoMatch=Nothing matched +APPEXTSECguiPanelMatchingNote=Please note, that only first matched result will be considered as result. +APPEXTSECguiPanelMatched=Matched +APPEXTSECguiPanelMatchingError=Error during matching: {0} +APPEXTSECguiPanelCanNotValidate=Can not validate, can not create tmp file - {0} +APPEXTSECguiPanelEmptyDoc=All document-bases must be full +APPEXTSECguiPanelEmptyCode=All code-bases must be full +APPEXTSECguiPanelTableValid=Table looks valid +APPEXTSECguiPanelTableInvalid=Invalid with following error: {0} +APPEXTSECguiPanelShowOnlyPermanent=Show only permanent records +APPEXTSECguiPanelShowOnlyTemporal=Show only previously temporarily decided records +APPEXTSECguiPanelShowAll=Show all records +APPEXTSECguiPanelShowOnlyPermanentA=Show only allowed permanent records +APPEXTSECguiPanelShowOnlyPermanentN=Show only forbidden permanent records +APPEXTSECguiPanelShowOnlyTemporalY=Show previously allowed applets records +APPEXTSECguiPanelShowOnlyTemporalN=Show previously denied applets records +APPEXTSEChelpHomeDialogue=Dialogue +APPEXTSEChelp= \ +

Help for Extended applet security - itw-settings, files and structures, dialogue

\ +

\ +Extended Applet Security refers to security features for unsigned applets. Traditionally, only signed applets required user confirmation and unsigned applets ran automatically. This is represented by the 'low security' setting. Unsigned applets must be allowed or disallowed individually on 'high security' (the default), and additionally do not run at all on 'very high security'. In theory, unsigned applets can safely run automatically. In practice, however, any vulnerability in the Java security sandbox will prevent this from being true. \ +

\ +

\ +To do so it uses the Security Level main settings switch rules in the tables of Custom definitions and Global definitions
\ +You can read much more about development of (and help us to improve!) this feature at dedicated IcedTea-Web page \ +

\ +

Security Level

\ +

\ +Its a main switch for "extended applet security". Its value is commonly stored in usrs_home/.icedtea/deployment.properties, but can be enforced via global settings in /etc/.java/deployment/deployment.properties or JAVA_HOME/lib/deployment.properties under the key deployment.security.level
\ +

  • Disable running of all Java applets - stored as DENY_ALL - No applet will be run
    \ +
    \ +No applet will be allowed to run. However the Java virtual machine will always be executed (and an error screen with reason appear instead of applets). To disable Java completely you can uninstall IcedTea-Web or disable it in your browser (if supported). The tables with records are of course ignored. \ +
    \ +
  • Very High Security - stored as DENY_UNSIGNED - No unsigned applets will be run
    \ +
    \ +No applet unsigned will be allowed to run (and an error screen with reason will appear instead of such applets). The tables with records are of course again ignored. \ +
    \ +
  • High Security - stored as ASK_UNSIGNED - User will be prompted for each unsigned applet
    \ +
    \ +All unsigned applets will be tested against the tables below if they should be allowed or forbidden to run. If they are not matched in the table then the user is prompted and the decision is stored in tables below. If the user denies the applet, an error screen with reason appears and the applet does not run. If the user allows applets to run, the user can choose to save this decision and whether to allow just one applet or a whole group of applets (see Dialogue paragraph below). \ +
    This is default behavior. \ +
    \ +
  • Low Security - stored as ALLOW_UNSIGNED - All, even unsigned, applets will be run
    \ +
    \ +All applets even unsigned will be allowed to run. User will not be warned and the tables with records are of course again ignored. \ +
    \ +You need to press ok or apply button to make the changes take effect. \ +

    \ + \ + \ +

    Table with recorded actions

    \ +

    \ +

    Custom x Global table

    \ +After each action in High Security dialogue the record is added to, or updated in, the table or configuration file. Commonly in users file - home/.icedtea/.appletTrustSettings - "Custom definition" panel.
    \ +But superuser can specify default behavior in /etc/.java/deployment/ .appletTrustSettings - "Global definition" panel.
    \ +

    "Syntax"

    \ +
  • Action - Desired behavior when applet is matched
    \ +
    \ +
  • Always trust this applet - This unsigned applet will always be run in High Security Security Level. It is stored as A in .appletTrustSettings
    \ +
  • Never trust this applet - This unsigned applet will never be run in High Security Security Level. It is stored as N in .appletTrustSettings
    \ +
  • Visited and allowed - When the user is asked about this applet again, a note that this applet was already trusted in past will be displayed. It is stored as y in .appletTrustSettings
    \ +
  • Visited and denied - When user will be asked about this applet again, he will see information that this applet was already denied in past. It is stored as n in .appletTrustSettings
    \ +
  • \ +
  • Date - date of last action on this item (read only item)
    \ +
  • Document base - is the page from which the applet was requested. It is actually a regular expression to match a specific URL. See about regular expressions and their usage lower
    \ +
  • Code base - is the URL where an applets code came from. It is actually a regular expression to match a specific URL. See about regular expressions and their usage lower
    \ +
  • Archives - coma separated list of archives with applet's code. Can be empty if source code are just classes or group of applets is allowed
    \ +
    \ +When you change a value in the table, its effect is immediate. \ +

    Controls of tables

    \ +

    \ +

  • Delete - deletes items as specified in combo box on side
    \ +
    \ +
  • selected - removes all selected items. Key Del does the same. Default behavior. Multiple selections allowed. Selection can be inverted by button even more on side
    \ +
  • all allowed (A) - removes all permanently trusted records
    \ +
  • all forbidden (N) - removes all permanently forbidden records
    \ +
  • all approved (y) - removes all previously (temporarily) trusted records
    \ +
  • all rejected (n) - removes all previously (temporarily) denied records
    \ +
  • all - will clear the table
    \ +
    \ +Ask me before action - switch to ask before each deletion (in bulk) or not to ask. Asking dialogue can be pretty long, so if you do not see the buttons, just press Esc \ +
  • \ +
  • Show full regular expressions - Disable or Enable filtering of quotation marks \Q\E in code/document base columns. About regular expressions see more lower
    \ +
    \ +
  • Filtering in table(s)
    \ +
    \ +
  • Show only permanent records - Shows only permanently allowed (A) or denied (N) records. Default behavior
    \ +
  • Show only temporarily decided records - Shows only once allowed (y) or denied (n) informative records.
    \ +
  • Show only permanently allowed records - Shows only permanently allowed (A) records
    \ +
  • Show only permanently denied records - Shows only permanently denied (N) records
    \ +
  • Show only temporarily allowed records - Shows only once allowed (y) informative records.
    \ +
  • Show only temporarily denied records - Shows only once denied (n) informative records.
    \ +
  • \ +

    \ +
  • Add new row - will add new, exemplary filled, row with current date and empty archives
    \ +
  • Validate table - will test if table can save, load, and if each value is valid:
    \ +
    \ +
  • Action - is one of A,N,y,n
    \ +
  • Date - is valid date
    \ +
  • Code base and document base - are valid regular expressions or empty
    \ +
  • Archives - coma separated list of archives or empty
    \ +
  • \ +
  • Test url - In two dialogues (in two steps) will let you enter document base and codebase, and then try to match them against all records. All matching items are returned! Last values are remembered> \ +
  • Move row down/up
    \ +
    \ +Order of rows is important. First matched result is returned (permanent have priority). So you can prioritize your matches using these buttons.
    \ +For example, if you \Qhttp://blogs.com/\E.* regular expression to allow all applets on http://blogs.com, then it must be AFTER your \Qhttp://blogs.com/evilJohn\E.* regular expression forbidding all applets from blog of hacker evilJohn. \ +
    \ +

    \ +

    \ +

    Dialogue

    \ +If High Security is set, and a new unsigned applet is hit then the dialogue is shown asking you to allow it or deny it. You can also choose if you want to allow or deny this applet every-time (A or N) you encounter it or for just one run (y,n).
    \ +You can also select to trust or deny (again temporarily or permanently) all the applets from same, exact, codebase. If you are visiting one page, which has various applets on various documents then this is a choice for you.
    \ +If you decide not to allow remembering your decision, then just a temporary record is made. If you revisit a page, a small green or red label will inform you about your last decision.
    \ +Once you select remember your decision, the dialog will never appear again. But you can edit your decision in itw-settings application table (packed with IcedTea-Web). If you change your decision to temporary one (n,y) or delete its row, the dialogue will appear again. Of course you can switch also from Always to Never or vice versa. \ +
    \ +The dialogue always mentions the page on which an applet is displayed, and the URL from which it comes. There is also a hint, if you have ever visited this applet saying if you have allowed or rejected it in the past
    \ +
    \ +

    Controls

    \ +
    \ +
  • Remember this option - If set, then dialogue will never be shown for this applet or page again. \ +
    \ +
  • For applet - Exact applet will be allowed or denied \ +
  • For site - All applets from this place will be allowed or denied \ +
  • \ +
  • Proceed - Applets, as selected above will be allowed \ +
  • Cancel - Applets, as selected above will be forbidden \ +
  • \ +Be aware to "proceed" + "Remember this option" + "For site" on pages you do not know! It can make you vulnerable! \ +
    \ +

    \ +

    \ +

    Regular expressions

    \ +IcedTea-Web extended applet security - uses a powerful matching engine to match exact (sets of) applets. Base stone is Quotation of URL \Q\E and wildchars llike .* or .? or more.
    \ +This was designed to suits the need to block or allow exact pages. The best is to show some examples:
    \ +N 12.12.2012 .* \Qhttp://blogs.com/evilJohn\E.*
    \ +N 12.12.2012 \Qhttp://blogs.com/goodJohn/evilApplet.html\E.* \Qhttp://blogs.com/goodJohn/\E goodJohnsArchive.jar
    \ +A 12.12.2012 \Qhttp://blogs.com/\E.* \Qhttp://blogs.com/\E.*
    \ +N 12.12.2012 .* \Qhttp://adds.com\E.*
    \ +Y 12.12.2012 .* \Qhttp://www.walter-fendt.de/ph14_jar/\E
    \ +
    \ +So this table, created 12.12.2012:
    \ +
  • Forbid all stuff which have some code on http://blogs.com/evilJohn pages
    \ +
  • Forbidding also one exact applet from http://blogs.com/goodJohn/ with archive goodJohnsArchive.jar
    \ +
  • Allowing all (other) applets from http://blogs.com/ but only when displayed also on http://blogs.com/
    \ +
  • Forbidding all applets with code saved on http://adds.com (except on http://blogs.com/ - to have forbidden http://adds.com also on http://blogs.com/, this (http://adds.com) record must be above blogs record)
    \ +
  • And finally allowing all nice physical applets on walter-fendt's pages
    \ +
    \ +Note - the date saved in .appletTrustSettings has a not so nice format, but I left this for now...
    \ +
    \ +All information about full regular expression syntax can be found on http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html \ +

    \ +

    Conclusion

    \ +

    \ +Stay tuned to our homepage at http://icedtea.classpath.org/wiki/IcedTea-Web!
    \ +If you encounter any bug, feel free to file it in our bugzilla ... According to http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs
    \ +
    \ +Safe browsing from your IcedTea-Web team... \ +

    \ + \ Binary files /tmp/NuT9CcZAiZ/icedtea-web-1.3.2/netx/net/sourceforge/jnlp/resources/showDownloadDetails.png and /tmp/WZlglBfzlP/icedtea-web-1.4/netx/net/sourceforge/jnlp/resources/showDownloadDetails.png differ diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java 2013-04-10 11:40:23.873668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java 2013-05-03 19:08:24.272519842 +0000 @@ -27,6 +27,7 @@ import javax.swing.*; import net.sourceforge.jnlp.*; +import net.sourceforge.jnlp.splashscreen.SplashController; import net.sourceforge.jnlp.util.*; /** @@ -130,6 +131,15 @@ return cont; } + /** + * container must be SplashContoler + * + */ + public SplashController getSplashControler() { + + return (SplashController)cont; + } + /** * Initialize, start, and show the applet. */ diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java 2013-04-10 11:40:23.873668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java 2013-05-03 19:08:24.273519830 +0000 @@ -17,6 +17,7 @@ package net.sourceforge.jnlp.runtime; import java.awt.Window; +import java.io.File; import java.net.URL; import java.security.AccessControlContext; import java.security.AccessController; @@ -146,7 +147,14 @@ private void addMenuAndDesktopEntries() { XDesktopEntry entry = new XDesktopEntry(file); ShortcutDesc sd = file.getInformation().getShortcut(); - + File possibleDesktopFile = entry.getLinuxDesktopIconFile(); + if (possibleDesktopFile.exists()) { + if (JNLPRuntime.isDebug()) { + System.out.println("ApplicationInstance.addMenuAndDesktopEntries(): file - " + + possibleDesktopFile.getAbsolutePath() + " already exists. Not proceeding with desktop additions"); + } + return; + } if (shouldCreateShortcut(sd)) { entry.createDesktopShortcut(); } @@ -171,6 +179,9 @@ * @return true if a desktop shortcut should be created */ private boolean shouldCreateShortcut(ShortcutDesc sd) { + if (JNLPRuntime.isTrustAll()) { + return (sd != null && sd.onDesktop()); + } String currentSetting = JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT); boolean createShortcut = false; diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/Boot.java icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/Boot.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/Boot.java 2013-04-10 14:30:03.341821000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/Boot.java 2013-05-03 19:08:24.274519818 +0000 @@ -53,8 +53,8 @@ // todo: decide whether a spawned netx (external launch) // should inherit the same options as this instance (store argv?) - private static final String name = Boot.class.getPackage().getImplementationTitle(); - private static final String version = Boot.class.getPackage().getImplementationVersion(); + public static final String name = Boot.class.getPackage().getImplementationTitle(); + public static final String version = Boot.class.getPackage().getImplementationVersion(); /** the text to display before launching the about link */ private static final String aboutMessage = "" diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java 2013-04-11 13:21:10.822055000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java 2013-05-03 19:08:24.278519770 +0000 @@ -63,6 +63,7 @@ import net.sourceforge.jnlp.util.JarFile; import java.util.jar.Manifest; +import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; import net.sourceforge.jnlp.AppletDesc; import net.sourceforge.jnlp.ApplicationDesc; import net.sourceforge.jnlp.DownloadOptions; @@ -73,6 +74,7 @@ import net.sourceforge.jnlp.JNLPMatcherException; import net.sourceforge.jnlp.LaunchDesc; import net.sourceforge.jnlp.LaunchException; +import net.sourceforge.jnlp.NullJnlpFileException; import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.ResourcesDesc; @@ -82,10 +84,13 @@ import net.sourceforge.jnlp.cache.IllegalResourceDescriptorException; import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.cache.UpdatePolicy; +import net.sourceforge.jnlp.security.AppVerifier; +import net.sourceforge.jnlp.security.JNLPAppVerifier; +import net.sourceforge.jnlp.security.PluginAppVerifier; import net.sourceforge.jnlp.security.SecurityDialogs; -import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.tools.JarCertVerifier; import net.sourceforge.jnlp.util.FileUtils; +import net.sourceforge.jnlp.util.StreamUtils; import sun.misc.JarIndex; /** @@ -107,6 +112,11 @@ final public static String TEMPLATE = "JNLP-INF/APPLICATION_TEMPLATE.JNLP"; final public static String APPLICATION = "JNLP-INF/APPLICATION.JNLP"; + /** Actions to specify how cache is to be managed **/ + public static enum DownloadAction { + DOWNLOAD_TO_CACHE, REMOVE_FROM_CACHE, CHECK_CACHE + } + /** True if the application has a signed JNLP File */ private boolean isSignedJNLP = false; @@ -159,14 +169,8 @@ /** all jars not yet part of classloader or active */ private List available = new ArrayList(); - /** all of the jar files that were verified */ - private ArrayList verifiedJars = null; - - /** all of the jar files that were not verified */ - private ArrayList unverifiedJars = null; - /** the jar cert verifier tool to verify our jars */ - private JarCertVerifier jcv = null; + private final JarCertVerifier jcv; private boolean signing = false; @@ -214,7 +218,8 @@ * Create a new JNLPClassLoader from the specified file. * * @param file the JNLP file - * @param name of the application's main class + * @param policy the UpdatePolicy for this class loader + * @param mainName name of the application's main class */ protected JNLPClassLoader(JNLPFile file, UpdatePolicy policy, String mainName) throws LaunchException { super(new URL[0], JNLPClassLoader.class.getClassLoader()); @@ -228,6 +233,16 @@ this.mainClass = mainName; + AppVerifier verifier; + + if (file instanceof PluginBridge && !((PluginBridge)file).useJNLPHref()) { + verifier = new PluginAppVerifier(); + } else { + verifier = new JNLPAppVerifier(); + } + + jcv = new JarCertVerifier(verifier); + // initialize extensions initializeExtensions(); @@ -316,7 +331,11 @@ * */ if (!file.getSecurity().getSecurityType().equals(SecurityDesc.SANDBOX_PERMISSIONS) && !signing) { - throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LUnsignedJarWithSecurity"), R("LUnsignedJarWithSecurityInfo")); + if (jcv.allJarsSigned()) { + throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedJNLPAppDifferentCerts"), R("LSignedJNLPAppDifferentCertsInfo")); + } else { + throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LUnsignedJarWithSecurity"), R("LUnsignedJarWithSecurityInfo")); + } } else if (signing == true) { this.security = file.getSecurity(); } else { @@ -328,16 +347,6 @@ } /** - * Returns a JNLP classloader for the specified JNLP file. - * - * @param file the file to load classes for - * @param policy the update policy to use when downloading resources - */ - public static JNLPClassLoader getInstance(JNLPFile file, UpdatePolicy policy) throws LaunchException { - return getInstance(file, policy, null); - } - - /** * Gets the lock for a given unique key, creating one if it does not yet exist. * This operation is atomic & thread-safe. * @@ -358,6 +367,60 @@ } /** + * Creates a fully initialized JNLP classloader for the specified JNLPFile, + * to be used as an applet/application's classloader. + * In contrast, JNLP classloaders can also be constructed simply to merge + * its resources into another classloader. + * + * @param file the file to load classes for + * @param policy the update policy to use when downloading resources + * @param mainName Overrides the main class name of the application + */ + private static JNLPClassLoader createInstance(JNLPFile file, UpdatePolicy policy, String mainName) throws LaunchException { + String uniqueKey = file.getUniqueKey(); + JNLPClassLoader baseLoader = uniqueKeyToLoader.get(uniqueKey); + JNLPClassLoader loader = new JNLPClassLoader(file, policy, mainName); + + // If security level is 'high' or greater, we must check if the user allows unsigned applets + // when the JNLPClassLoader is created. We do so here, because doing so in the constructor + // causes unwanted side-effects for some applets + if (!loader.getSigning() && file instanceof PluginBridge) { + UnsignedAppletTrustConfirmation.checkUnsignedWithUserIfRequired((PluginBridge)file); + } + + // New loader init may have caused extentions to create a + // loader for this unique key. Check. + JNLPClassLoader extLoader = uniqueKeyToLoader.get(uniqueKey); + + if (extLoader != null && extLoader != loader) { + if (loader.signing && !extLoader.signing) + if (!SecurityDialogs.showNotAllSignedWarningDialog(file)) + throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); + + loader.merge(extLoader); + extLoader.decrementLoaderUseCount(); // loader urls have been merged, ext loader is no longer used + } + + // loader is now current + ext. But we also need to think of + // the baseLoader + if (baseLoader != null && baseLoader != loader) { + loader.merge(baseLoader); + } + + return loader; + } + + /** + * Returns a JNLP classloader for the specified JNLP file. + * + * @param file the file to load classes for + * @param policy the update policy to use when downloading resources + */ + public static JNLPClassLoader getInstance(JNLPFile file, UpdatePolicy policy) throws LaunchException { + return getInstance(file, policy, null); + } + + /** * Returns a JNLP classloader for the specified JNLP file. * * @param file the file to load classes for @@ -378,27 +441,7 @@ (file.isApplication() && !baseLoader.getJNLPFile().getFileLocation().equals(file.getFileLocation()))) { - loader = new JNLPClassLoader(file, policy, mainName); - - // New loader init may have caused extentions to create a - // loader for this unique key. Check. - JNLPClassLoader extLoader = uniqueKeyToLoader.get(uniqueKey); - - if (extLoader != null && extLoader != loader) { - if (loader.signing && !extLoader.signing) - if (!SecurityDialogs.showNotAllSignedWarningDialog(file)) - throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); - - loader.merge(extLoader); - extLoader.decrementLoaderUseCount(); // loader urls have been merged, ext loader is no longer used - } - - // loader is now current + ext. But we also need to think of - // the baseLoader - if (baseLoader != null && baseLoader != loader) { - loader.merge(baseLoader); - } - + loader = createInstance(file, policy, mainName); } else { // if key is same and locations match, this is the loader we want if (!file.isApplication()) { @@ -513,7 +556,7 @@ * @param jar the jar to check * @return true if file exists AND is an invalid jar, false otherwise */ - private boolean isInvalidJar(JARDesc jar){ + boolean isInvalidJar(JARDesc jar){ File cacheFile = tracker.getCacheFile(jar.getLocation()); if (cacheFile == null) return false;//File cannot be retrieved, do not claim it is an invalid jar @@ -561,9 +604,9 @@ JARDesc jars[] = resources.getJARs(); - if (jars == null || jars.length == 0) { + if (jars.length == 0) { - boolean allSigned = true; + boolean allSigned = (loaders.length > 1) /* has extensions */; for (int i = 1; i < loaders.length; i++) { if (!loaders[i].getSigning()) { allSigned = false; @@ -627,10 +670,8 @@ if (JNLPRuntime.isVerifying()) { - JarCertVerifier jcv; - try { - jcv = verifyJars(initialJars); + jcv.add(initialJars, tracker); } catch (Exception e) { //we caught an Exception from the JarCertVerifier class. //Note: one of these exceptions could be from not being able @@ -641,14 +682,13 @@ } //Case when at least one jar has some signing - if (jcv.anyJarsSigned() && jcv.isFullySignedByASingleCert()) { + if (jcv.isFullySigned()) { signing = true; if (!jcv.allJarsSigned() && !SecurityDialogs.showNotAllSignedWarningDialog(file)) throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); - // Check for main class in the downloaded jars, and check/verify signed JNLP fill checkForMain(initialJars); @@ -673,10 +713,10 @@ // If main jar was found, but a signed JNLP file was not located if (!isSignedJNLP && foundMainJar) file.setSignedJNLPAsMissing(); - + //user does not trust this publisher - if (!jcv.getAlreadyTrustPublisher()) { - checkTrustWithUser(jcv); + if (!jcv.isTriviallySigned()) { + checkTrustWithUser(); } else { /** * If the user trusts this publisher (i.e. the publisher's certificate @@ -685,9 +725,9 @@ } } else { + // Otherwise this jar is simply unsigned -- make sure to ask + // for permission on certain actions signing = false; - //otherwise this jar is simply unsigned -- make sure to ask - //for permission on certain actions } } @@ -752,7 +792,7 @@ * @param jars Jars that are checked to see if they contain the main class * @throws LaunchException Thrown if the signed JNLP file, within the main jar, fails to be verified or does not match */ - private void checkForMain(List jars) throws LaunchException { + void checkForMain(List jars) throws LaunchException { // Check launch info if (mainClass == null) { @@ -822,6 +862,8 @@ break; } } + + jarFile.close(); } catch (IOException e) { /* * After this exception is caught, it is escaped. This will skip @@ -838,18 +880,21 @@ * @param location The JAR location * @return the main class name, null if there isn't one of if there was an error */ - private String getMainClassName(URL location) { + String getMainClassName(URL location) { String mainClass = null; File f = tracker.getCacheFile(location); if( f != null) { + JarFile mainJar = null; try { - JarFile mainJar = new JarFile(f); + mainJar = new JarFile(f); mainClass = mainJar.getManifest(). getMainAttributes().getValue("Main-Class"); } catch (IOException ioe) { mainClass = null; + } finally { + StreamUtils.closeSilently(mainJar); } } @@ -887,7 +932,6 @@ private void verifySignedJNLP(JARDesc jarDesc, JarFile jarFile) throws LaunchException { - JarCertVerifier signer = new JarCertVerifier(); List desc = new ArrayList(); desc.add(jarDesc); @@ -898,9 +942,9 @@ InputStreamReader jnlpReader = null; try { - signer.verifyJars(desc, tracker); - - if (signer.allJarsSigned()) { // If the jar is signed + // NOTE: verification should have happened by now. In other words, + // calling jcv.verifyJars(desc, tracker) here should have no affect. + if (jcv.isFullySigned()) { Enumeration entries = jarFile.entries(); JarEntry je; @@ -984,58 +1028,34 @@ /* * After this exception is caught, it is escaped. If an exception is * thrown while handling the jar file, (mainly for - * JarCertVerifier.verifyJars) it assumes the jar file is unsigned and + * JarCertVerifier.add) it assumes the jar file is unsigned and * skip the check for a signed JNLP file */ } finally { //Close all streams - closeStream(inStream); - closeStream(inputReader); - closeStream(fr); - closeStream(jnlpReader); + StreamUtils.closeSilently(inStream); + StreamUtils.closeSilently(inputReader); + StreamUtils.closeSilently(fr); + StreamUtils.closeSilently(jnlpReader); } if (JNLPRuntime.isDebug()) System.err.println("Ending check for signed JNLP file..."); } - /*** - * Closes a stream - * - * @param stream the stream that will be closed + /** + * Prompt the user for trust on all the signers that require approval. + * @throws LaunchException if the user does not approve every dialog prompt. */ - private void closeStream (Closeable stream) { - if (stream != null) - try { - stream.close(); - } catch (Exception e) { - e.printStackTrace(System.err); - } - } - - private void checkTrustWithUser(JarCertVerifier jcv) throws LaunchException { + private void checkTrustWithUser() throws LaunchException { if (JNLPRuntime.isTrustAll()){ return; } - if (!jcv.getRootInCacerts()) { //root cert is not in cacerts - boolean b = SecurityDialogs.showCertWarningDialog( - AccessType.UNVERIFIED, file, jcv); - if (!b) - throw new LaunchException(null, null, R("LSFatal"), - R("LCLaunching"), R("LNotVerified"), ""); - } else if (jcv.getRootInCacerts()) { //root cert is in cacerts - boolean b = false; - if (jcv.noSigningIssues()) - b = SecurityDialogs.showCertWarningDialog( - AccessType.VERIFIED, file, jcv); - else if (!jcv.noSigningIssues()) - b = SecurityDialogs.showCertWarningDialog( - AccessType.SIGNING_ERROR, file, jcv); - if (!b) - throw new LaunchException(null, null, R("LSFatal"), - R("LCLaunching"), R("LCancelOnUserRequest"), ""); + + if (jcv.isFullySigned() && !jcv.getAlreadyTrustPublisher()) { + jcv.checkTrustWithUser(file); } } @@ -1140,7 +1160,7 @@ } // Class from host X should be allowed to connect to host X - if (cs.getLocation().getHost().length() > 0) + if (cs.getLocation() != null && cs.getLocation().getHost().length() > 0) result.add(new SocketPermission(cs.getLocation().getHost(), "connect, accept")); @@ -1249,15 +1269,25 @@ continue; } - JarCertVerifier signer = new JarCertVerifier(); - List jars = new ArrayList(); - JARDesc jarDesc = new JARDesc(new File(extractedJarLocation).toURL(), null, null, false, false, false, false); - jars.add(jarDesc); tracker.addResource(new File(extractedJarLocation).toURL(), null, null, null); - signer.verifyJars(jars, tracker); - if (signer.anyJarsSigned() && !signer.getAlreadyTrustPublisher()) { - checkTrustWithUser(signer); + URL codebase = file.getCodeBase(); + if (codebase == null) { + //FIXME: codebase should be the codebase of the Main Jar not + //the location. Although, it still works in the current state. + codebase = file.getResources().getMainJAR().getLocation(); + } + + SecurityDesc jarSecurity = null; + if (jcv.isFullySigned()) { + // Already trust application, nested jar should be given + jarSecurity = new SecurityDesc(file, + SecurityDesc.ALL_PERMISSIONS, + codebase.getHost()); + } else { + jarSecurity = new SecurityDesc(file, + SecurityDesc.SANDBOX_PERMISSIONS, + codebase.getHost()); } try { @@ -1267,25 +1297,6 @@ CachedJarFileCallback.getInstance().addMapping(fakeRemote, fileURL); addURL(fakeRemote); - SecurityDesc jarSecurity = file.getSecurity(); - - if (file instanceof PluginBridge) { - - URL codebase = null; - - if (file.getCodeBase() != null) { - codebase = file.getCodeBase(); - } else { - //Fixme: codebase should be the codebase of the Main Jar not - //the location. Although, it still works in the current state. - codebase = file.getResources().getMainJAR().getLocation(); - } - - jarSecurity = new SecurityDesc(file, - SecurityDesc.ALL_PERMISSIONS, - codebase.getHost()); - } - jarLocationSecurityMap.put(fakeRemote, jarSecurity); } catch (MalformedURLException mfue) { @@ -1299,6 +1310,7 @@ jarEntries.add(je.getName()); } + jarFile.close(); } addURL(jar.getLocation()); @@ -1322,6 +1334,8 @@ JarIndex index = JarIndex.getJarIndex(jarFile, null); if (index != null) jarIndexes.add(index); + + jarFile.close(); } else { CachedJarFileCallback.getInstance().addMapping(jar.getLocation(), jar.getLocation()); } @@ -1395,6 +1409,7 @@ new FileOutputStream(outFile)); } + jarFile.close(); } catch (IOException ex) { if (JNLPRuntime.isDebug()) ex.printStackTrace(); @@ -1498,18 +1513,6 @@ } /** - * Verifies code signing of jars to be used. - * - * @param jars the jars to be verified. - */ - private JarCertVerifier verifyJars(List jars) throws Exception { - - jcv = new JarCertVerifier(); - jcv.verifyJars(jars, tracker); - return jcv; - } - - /** * Find the loaded class in this loader or any of its extension loaders. */ protected Class findLoadedClassAll(String name) { @@ -1517,17 +1520,7 @@ Class result = null; if (loaders[i] == this) { - final String fName = name; - try { - result = AccessController.doPrivileged( - new PrivilegedExceptionAction>() { - public Class run() { - return JNLPClassLoader.super.findLoadedClass(fName); - } - }, getAccessControlContextForClassLoading()); - } catch (PrivilegedActionException pae) { - result = null; - } + result = JNLPClassLoader.super.findLoadedClass(name); } else { result = loaders[i].findLoadedClassAll(name); } @@ -1645,13 +1638,22 @@ * @param desc the JARDesc for the new jar */ private void addNewJar(final JARDesc desc) { + this.addNewJar(desc, JNLPRuntime.getDefaultUpdatePolicy()); + } + + /** + * Adds a new JARDesc into this classloader. + * @param desc the JARDesc for the new jar + * @param updatePolicy the UpdatePolicy for the resource + */ + private void addNewJar(final JARDesc desc, UpdatePolicy updatePolicy) { available.add(desc); tracker.addResource(desc.getLocation(), desc.getVersion(), null, - JNLPRuntime.getDefaultUpdatePolicy() + updatePolicy ); // Give read permissions to the cached jar file @@ -1675,7 +1677,6 @@ // Verify if needed - final JarCertVerifier signer = new JarCertVerifier(); final List jars = new ArrayList(); jars.add(desc); @@ -1687,14 +1688,12 @@ AccessController.doPrivileged(new PrivilegedExceptionAction() { public Void run() throws Exception { - signer.verifyJars(jars, tracker); + jcv.add(jars, tracker); - if (signer.anyJarsSigned() && !signer.getAlreadyTrustPublisher()) { - checkTrustWithUser(signer); - } + checkTrustWithUser(); final SecurityDesc security; - if (signer.anyJarsSigned()) { + if (jcv.isFullySigned()) { security = new SecurityDesc(file, SecurityDesc.ALL_PERMISSIONS, file.getCodeBase().getHost()); @@ -1725,6 +1724,7 @@ /** * Find the class in this loader or any of its extension loaders. */ + @Override protected Class findClass(String name) throws ClassNotFoundException { for (int i = 0; i < loaders.length; i++) { try { @@ -1741,13 +1741,16 @@ } } catch (ClassNotFoundException ex) { } catch (ClassFormatError cfe) { + cfe.printStackTrace(); } catch (PrivilegedActionException pae) { + } catch (NullJnlpFileException ex) { + throw new ClassNotFoundException(this.mainClass + " in main classloader ", ex); } } // Try codebase loader if (codeBaseLoader != null) - return codeBaseLoader.findClass(name, true); + return codeBaseLoader.findClassNonRecursive(name); // All else failed. Throw CNFE throw new ClassNotFoundException(name); @@ -2135,6 +2138,108 @@ } /** + * Returns all loaders that this loader uses, including itself + */ + JNLPClassLoader[] getLoaders() { + return loaders; + } + + /** + * Remove jars from the file system. + * + * @param jars Jars marked for removal. + */ + void removeJars(JARDesc[] jars) { + + for (JARDesc eachJar : jars) { + try { + tracker.removeResource(eachJar.getLocation()); + } catch (Exception e) { + if (JNLPRuntime.isDebug()) { + System.err.println(e.getMessage()); + System.err.println("Failed to remove resource from tracker, continuing.."); + } + } + + File cachedFile = CacheUtil.getCacheFile(eachJar.getLocation(), null); + String directoryUrl = CacheUtil.getCacheParentDirectory(cachedFile.getAbsolutePath()); + + File directory = new File(directoryUrl); + + if (JNLPRuntime.isDebug()) + System.out.println("Deleting cached file: " + cachedFile.getAbsolutePath()); + + cachedFile.delete(); + + if (JNLPRuntime.isDebug()) + System.out.println("Deleting cached directory: " + directory.getAbsolutePath()); + + directory.delete(); + } + } + + /** + * Downloads and initializes jars into this loader. + * + * @param ref Path of the launch or extension JNLP File containing the + * resource. If null, main JNLP's file location will be used instead. + * @param part The name of the path. + * @throws LaunchException + */ + void initializeNewJarDownload(URL ref, String part, Version version) { + JARDesc[] jars = ManageJnlpResources.findJars(this, ref, part, version); + + for (JARDesc eachJar : jars) { + if (JNLPRuntime.isDebug()) + System.out.println("Downloading and initializing jar: " + eachJar.getLocation().toString()); + + this.addNewJar(eachJar, UpdatePolicy.FORCE); + } + } + + /** + * Manages DownloadService jars which are not mentioned in the JNLP file + * @param ref Path to the resource. + * @param version The version of resource. If null, no version is specified. + * @param action The action to perform with the resource. Either DOWNLOADTOCACHE, REMOVEFROMCACHE, or CHECKCACHE. + * @return true if CHECKCACHE and the resource is cached. + */ + boolean manageExternalJars(URL ref, String version, DownloadAction action) { + boolean approved = false; + JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByResourceUrl(this, ref, version); + Version resourceVersion = (version == null) ? null : new Version(version); + + if (foundLoader != null) + approved = true; + + else if (ref.toString().startsWith(file.getCodeBase().toString())) + approved = true; + else if (SecurityDesc.ALL_PERMISSIONS.equals(security.getSecurityType())) + approved = true; + + if (approved) { + if (foundLoader == null) + foundLoader = this; + + if (action == DownloadAction.DOWNLOAD_TO_CACHE) { + JARDesc jarToCache = new JARDesc(ref, resourceVersion, null, false, true, false, true); + if (JNLPRuntime.isDebug()) + System.out.println("Downloading and initializing jar: " + ref.toString()); + + foundLoader.addNewJar(jarToCache, UpdatePolicy.FORCE); + + } else if (action == DownloadAction.REMOVE_FROM_CACHE) { + JARDesc[] jarToRemove = { new JARDesc(ref, resourceVersion, null, false, true, false, true) }; + foundLoader.removeJars(jarToRemove); + + } else if (action == DownloadAction.CHECK_CACHE) { + return CacheUtil.isCached(ref, resourceVersion); + } + } + return false; + } + + /** * Decrements loader use count by 1 * * If count reaches 0, loader is removed from list of available loaders @@ -2180,8 +2285,6 @@ return context; // If context already has all permissions, don't bother } catch (AccessControlException ace) { // continue below - } catch (ClassCircularityError cce) { - // continue below } // Since this is for class-loading, technically any class from one jar @@ -2227,7 +2330,7 @@ ConcurrentHashMap notFoundResources = new ConcurrentHashMap(); public CodeBaseClassLoader(URL[] urls, JNLPClassLoader cl) { - super(urls); + super(urls, cl); parentJNLPClassLoader = cl; } @@ -2236,21 +2339,7 @@ super.addURL(url); } - @Override - public Class findClass(String name) throws ClassNotFoundException { - return findClass(name, false); - } - - public Class findClass(String name, boolean recursivelyInvoked) throws ClassNotFoundException { - - if (!recursivelyInvoked) { - try { - return parentJNLPClassLoader.findClass(name); - } catch (ClassNotFoundException cnfe) { - // continue - } - } - + Class findClassNonRecursive(String name) throws ClassNotFoundException { // If we have searched this path before, don't try again if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) throw new ClassNotFoundException(name); @@ -2265,10 +2354,19 @@ }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); } catch (PrivilegedActionException pae) { notFoundResources.put(name, super.getURLs()); - throw new ClassNotFoundException("Could not find class " + name); + throw new ClassNotFoundException("Could not find class " + name, pae); + } catch (NullJnlpFileException njf) { + notFoundResources.put(name, super.getURLs()); + throw new ClassNotFoundException("Could not find class " + name, njf); } } + @Override + public Class findClass(String name) throws ClassNotFoundException { + // Calls JNLPClassLoader#findClass which may call into this.findClassNonRecursive + return getParentJNLPClassLoader().findClass(name); + } + /** * Returns the output of super.findLoadedClass(). * @@ -2329,7 +2427,7 @@ } }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); } catch (PrivilegedActionException pae) { - } + } if (url == null) { notFoundResources.put(name, super.getURLs()); @@ -2341,4 +2439,6 @@ return null; } } + + } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java 2013-04-10 14:30:03.342821000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java 2013-05-03 19:08:24.280519745 +0000 @@ -192,6 +192,7 @@ try { config.load(); + config.copyTo(System.getProperties()); } catch (ConfigurationException e) { /* exit if there is a fatal exception loading the configuration */ if (isApplication) { diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java 2013-05-03 19:08:24.281519732 +0000 @@ -0,0 +1,111 @@ +/* LocateJNLPClassLoader.java +Copyright (C) 2012, Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package net.sourceforge.jnlp.runtime; + +import java.net.URL; +import net.sourceforge.jnlp.JARDesc; +import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.ResourcesDesc; +import net.sourceforge.jnlp.Version; + +class LocateJnlpClassLoader { + + /** + * Locates the JNLPClassLoader of the JNLP file. + * @param rootClassLoader Root JNLPClassLoader of the application. + * @param urlToJnlpFile Path of the JNLP file. If null, main JNLP's file location + * be used instead + * @return the JNLPClassLoader of the JNLP file. + */ + static JNLPClassLoader getLoaderByJnlpFile(final JNLPClassLoader rootClassLoader, URL urlToJnlpFile) { + + if (rootClassLoader == null) + return null; + + JNLPFile file = rootClassLoader.getJNLPFile(); + + if (urlToJnlpFile == null) + urlToJnlpFile = rootClassLoader.getJNLPFile().getFileLocation(); + + if (file.getFileLocation().equals(urlToJnlpFile)) + return rootClassLoader; + + for (JNLPClassLoader loader : rootClassLoader.getLoaders()) { + if (rootClassLoader != loader) { + JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(loader, urlToJnlpFile); + if (foundLoader != null) + return foundLoader; + } + } + + return null; + } + + /** + * Locates the JNLPClassLoader of the JNLP file's resource. + * @param rootClassLoader Root JNLPClassLoader of the application. + * @param urlToJnlpFile Path of the launch or extension JNLP File. If null, + * main JNLP's file location will be used instead. + * @param version The version of resource. Is null if no version is specified + * @return the JNLPClassLoader of the JNLP file's resource. + */ + static JNLPClassLoader getLoaderByResourceUrl(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { + Version resourceVersion = (version == null) ? null : new Version(version); + + for (JNLPClassLoader loader : rootClassLoader.getLoaders()) { + ResourcesDesc resources = loader.getJNLPFile().getResources(); + + for (JARDesc eachJar : resources.getJARs()) { + if (ref.equals(eachJar.getLocation()) && + (resourceVersion == null || resourceVersion.equals(eachJar.getVersion()))) + return loader; + } + } + + for (JNLPClassLoader loader : rootClassLoader.getLoaders()) { + if (rootClassLoader != loader) { + JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByResourceUrl(loader, ref, version); + + if (foundLoader != null) + return foundLoader; + } + } + + return null; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java 2013-05-03 19:08:24.281519732 +0000 @@ -0,0 +1,140 @@ +/* ManageJnlpResources.java +Copyright (C) 2012, Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package net.sourceforge.jnlp.runtime; + +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +import net.sourceforge.jnlp.JARDesc; +import net.sourceforge.jnlp.ResourcesDesc; +import net.sourceforge.jnlp.Version; +import net.sourceforge.jnlp.runtime.JNLPClassLoader.DownloadAction; + +public class ManageJnlpResources { + + /** + * Returns jars from the JNLP file with the part name provided. + * @param rootClassLoader Root JNLPClassLoader of the application. + * @param ref Path of the launch or extension JNLP File containing the + * resource. If null, main JNLP's file location will be used instead. + * @param part The name of the part. + * @return jars found. + */ + public static JARDesc[] findJars(final JNLPClassLoader rootClassLoader, final URL ref, final String part, final Version version) { + JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(rootClassLoader, ref); + + if (foundLoader != null) { + List foundJars = new ArrayList(); + ResourcesDesc resources = foundLoader.getJNLPFile().getResources(); + + for (JARDesc eachJar : resources.getJARs(part)) { + if (version == null || version.equals(eachJar.getVersion())) + foundJars.add(eachJar); + } + + return foundJars.toArray(new JARDesc[foundJars.size()]); + } + + return new JARDesc[] {}; + } + + /** + * Removes jars from cache. + * @param classLoader JNLPClassLoader of the application that is associated to the resource. + * @param ref Path of the launch or extension JNLP File containing the + * resource. If null, main JNLP's file location will be used instead. + * @param jars Jars marked for removal. + */ + public static void removeCachedJars(final JNLPClassLoader classLoader, final URL ref, final JARDesc[] jars) { + JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(classLoader, ref); + + if (foundLoader != null) + foundLoader.removeJars(jars); + } + + /** + * Downloads jars identified by part name. + * @param classLoader JNLPClassLoader of the application that is associated to the resource. + * @param ref Path of the launch or extension JNLP File containing the + * resource. If null, main JNLP's file location will be used instead. + * @param part The name of the path. + */ + public static void downloadJars(final JNLPClassLoader classLoader, final URL ref, final String part, final Version version) { + JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(classLoader, ref); + + if (foundLoader != null) + foundLoader.initializeNewJarDownload(ref, part, version); + } + + /** + * Downloads and initializes resources which are not mentioned in the jnlp file. + * Used by DownloadService. + * @param rootClassLoader Root JNLPClassLoader of the application. + * @param ref Path to the resource. + * @param version The version of resource. If null, no version is specified. + */ + + public static void loadExternalResouceToCache(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { + rootClassLoader.manageExternalJars(ref, version, DownloadAction.DOWNLOAD_TO_CACHE); + } + + /** + * Removes resource which are not mentioned in the jnlp file. + * Used by DownloadService. + * @param rootClassLoader Root JNLPClassLoader of the application. + * @param ref Path to the resource. + * @param version The version of resource. If null, no version is specified. + */ + public static void removeExternalCachedResource(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { + rootClassLoader.manageExternalJars(ref, version, DownloadAction.REMOVE_FROM_CACHE); + } + + /** + * Returns true if the resource (not mentioned in the jnlp file) is cached, otherwise false + * Used by DownloadService. + * @param rootClassLoader Root JNLPClassLoader of the application. + * @param ref Path to the resource. + * @param version The version of resource. If null, no version is specified. + * @return + */ + public static boolean isExternalResourceCached(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { + return rootClassLoader.manageExternalJars(ref, version, DownloadAction.CHECK_CACHE); + } + +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java 2013-04-10 11:40:23.878668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java 2013-05-03 19:08:24.283519706 +0000 @@ -59,7 +59,7 @@ * Represents a Proxy Auto Config file. This object can be used to evaluate the * proxy file to find the proxy for a given url. * - * @see http://en.wikipedia.org/wiki/Proxy_auto-config#The_PAC_file + * @see "http://en.wikipedia.org/wiki/Proxy_auto-config#The_PAC_file" */ public class RhinoBasedPacEvaluator implements PacEvaluator { diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityLevel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityLevel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityLevel.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityLevel.java 2013-05-03 19:08:24.298519517 +0000 @@ -0,0 +1,78 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.security.appletextendedsecurity; + +import net.sourceforge.jnlp.runtime.Translator; + +public enum AppletSecurityLevel { + + DENY_ALL, DENY_UNSIGNED, ASK_UNSIGNED, ALLOW_UNSIGNED; + + public static String allToString() { + return DENY_ALL.toChars() + " " + DENY_UNSIGNED.toChars() + " " + ASK_UNSIGNED.toChars() + " " + ALLOW_UNSIGNED.toChars(); + } + + public String toChars() { + return this.name(); + } + + public String toExplanation() { + switch (this) { + case DENY_ALL: + return Translator.R("APPEXTSECappletSecurityLevelExtraHighId") + " - " + Translator.R("APPEXTSECappletSecurityLevelExtraHighExplanation"); + case DENY_UNSIGNED: + return Translator.R("APPEXTSECappletSecurityLevelVeryHighId") + " - " + Translator.R("APPEXTSECappletSecurityLevelVeryHighExplanation"); + case ASK_UNSIGNED: + return Translator.R("APPEXTSECappletSecurityLevelHighId") + " - " + Translator.R("APPEXTSECappletSecurityLevelHighExplanation"); + case ALLOW_UNSIGNED: + return Translator.R("APPEXTSECappletSecurityLevelLowId") + " - " + Translator.R("APPEXTSECappletSecurityLevelLowExplanation"); + } + throw new RuntimeException("Unknown AppletSecurityLevel"); + } + + public static AppletSecurityLevel fromString(String s) { + return AppletSecurityLevel.valueOf(s.toUpperCase()); + } + + @Override + public String toString() { + return toExplanation(); + } + + public static AppletSecurityLevel getDefault() { + return ASK_UNSIGNED; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySettings.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySettings.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySettings.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySettings.java 2013-05-03 19:08:24.298519517 +0000 @@ -0,0 +1,97 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.security.appletextendedsecurity; + +import javax.naming.ConfigurationException; +import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; +import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionStorage; +import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageImpl; +import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.util.lockingfile.StorageIoException; + +public class AppletStartupSecuritySettings { + + private static final AppletStartupSecuritySettings instance = new AppletStartupSecuritySettings(); + private UnsignedAppletActionStorageImpl globalInstance; + private UnsignedAppletActionStorageImpl customInstance; + + public static AppletStartupSecuritySettings getInstance() { + return instance; + } + + public static AppletSecurityLevel getHardcodedDefaultSecurityLevel() { + return AppletSecurityLevel.getDefault(); + } + + /** + * + * @return storage with global items from /etc/ + */ + public UnsignedAppletActionStorage getUnsignedAppletActionGlobalStorage() { + if (globalInstance == null) { + globalInstance = new UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustGlobalSettingsPath()); + } + return globalInstance; + } + + /** + * + * @return storage with custom items from /home/ + */ + public UnsignedAppletActionStorage getUnsignedAppletActionCustomStorage() { + if (customInstance == null) { + customInstance = new UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustUserSettingsPath()); + } + return customInstance; + } + + /** + * + * @return user-set security level or default one if user-set do not exists + */ + public AppletSecurityLevel getSecurityLevel() { + DeploymentConfiguration conf = JNLPRuntime.getConfiguration(); + if (conf == null) { + throw new StorageIoException("JNLPRuntime configuration is null. Try to reinstall IcedTea-Web"); + } + String s = conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); + if (s == null) { + return getHardcodedDefaultSecurityLevel(); + } + return AppletSecurityLevel.fromString(s); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteUnsignedApplet.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteUnsignedApplet.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteUnsignedApplet.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteUnsignedApplet.java 2013-05-03 19:08:24.299519504 +0000 @@ -0,0 +1,90 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.security.appletextendedsecurity; + +import net.sourceforge.jnlp.runtime.Translator; + +public enum ExecuteUnsignedApplet { + + ALWAYS, NEVER, YES, NO; + + public String toChar() { + switch (this) { + case ALWAYS: + return "A"; + case NEVER: + return "N"; + case YES: + return "y"; + case NO: + return "n"; + } + throw new RuntimeException("Unknown ExecuteUnsignedApplet"); + } + + public String toExplanation() { + switch (this) { + case ALWAYS: + return Translator.R("APPEXTSECunsignedAppletActionAlways"); + case NEVER: + return Translator.R("APPEXTSECunsignedAppletActionNever"); + case YES: + return Translator.R("APPEXTSECunsignedAppletActionYes"); + case NO: + return Translator.R("APPEXTSECunsignedAppletActionNo"); + } + throw new RuntimeException("Unknown UnsignedAppletAction"); + } + + public static ExecuteUnsignedApplet fromString(String s) { + if (s.startsWith("A")) { + return ExecuteUnsignedApplet.ALWAYS; + } else if (s.startsWith("N")) { + return ExecuteUnsignedApplet.NEVER; + } else if (s.startsWith("y")) { + return ExecuteUnsignedApplet.YES; + } else if (s.startsWith("n")) { + return ExecuteUnsignedApplet.NO; + } else { + throw new RuntimeException("Unknown ExecuteUnsignedApplet for " + s); + } + } + + @Override + public String toString() { + return toChar() + " - " + toExplanation(); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java 2013-05-03 19:08:24.299519504 +0000 @@ -0,0 +1,180 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.security.appletextendedsecurity; + +import java.awt.Dimension; +import java.io.IOException; +import javax.swing.JButton; +import javax.swing.JEditorPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; +import net.sourceforge.jnlp.runtime.Translator; + +public class ExtendedAppletSecurityHelp extends javax.swing.JDialog implements HyperlinkListener { + + public ExtendedAppletSecurityHelp(java.awt.Frame parent, boolean modal, String reference) { + this(parent, modal); + mainHtmlPane.scrollToReference(reference); + + } + + public ExtendedAppletSecurityHelp(java.awt.Frame parent, boolean modal) { + super(parent, modal); + Dimension d = new Dimension(600, 400); + setPreferredSize(d); + setSize(d); + initComponents(); + mainHtmlPane.setText(Translator.R("APPEXTSEChelp")); + mainHtmlPane.addHyperlinkListener(ExtendedAppletSecurityHelp.this); + mainHtmlPane.setCaretPosition(1); + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + } + + @Override + public void hyperlinkUpdate(HyperlinkEvent event) { + if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { + try { + if (event.getURL() == null) { + String s = event.getDescription().replace("#", ""); + mainHtmlPane.scrollToReference(s); + } else { + mainHtmlPane.setPage(event.getURL()); + } + } catch (IOException ioe) { + ioe.printStackTrace(); + } + } + } + + private void initComponents() { + + scrollPane = new javax.swing.JScrollPane(); + mainHtmlPane = new javax.swing.JEditorPane(); + mainPanel = new javax.swing.JPanel(); + niceSeparator = new javax.swing.JSeparator(); + mainButtonsPanel = new javax.swing.JPanel(); + navigationPanel = new javax.swing.JPanel(); + homeButton = new javax.swing.JButton(); + homeAndDialogueButton = new javax.swing.JButton(); + closePanel = new javax.swing.JPanel(); + closeButton = new javax.swing.JButton(); + getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.Y_AXIS)); + mainHtmlPane.setContentType("text/html"); + mainHtmlPane.setEditable(false); + scrollPane.setViewportView(mainHtmlPane); + getContentPane().add(scrollPane); + javax.swing.GroupLayout mainLayout = new javax.swing.GroupLayout(mainPanel); + mainPanel.setLayout(mainLayout); + mainLayout.setHorizontalGroup( + mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 485, Short.MAX_VALUE) + .addGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(mainLayout.createSequentialGroup() + .addGap(0, 217, Short.MAX_VALUE) + .addComponent(niceSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 218, Short.MAX_VALUE)))); + mainLayout.setVerticalGroup( + mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 10, Short.MAX_VALUE) + .addGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(mainLayout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(niceSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)))); + + getContentPane().add(mainPanel); + mainButtonsPanel.setLayout(new javax.swing.BoxLayout(mainButtonsPanel, javax.swing.BoxLayout.LINE_AXIS)); + navigationPanel.setLayout(new javax.swing.BoxLayout(navigationPanel, javax.swing.BoxLayout.LINE_AXIS)); + homeButton.setText(Translator.R("SPLASHHome")); + homeButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + goToIntroSection(evt); + } + }); + navigationPanel.add(homeButton); + homeAndDialogueButton.setText(Translator.R("APPEXTSEChelpHomeDialogue")); + homeAndDialogueButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + goToDialogueSection(evt); + } + }); + closeButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ExtendedAppletSecurityHelp.this.dispose(); + } + }); + navigationPanel.add(homeAndDialogueButton); + mainButtonsPanel.add(navigationPanel); + closeButton.setText(Translator.R("ButClose")); + closePanel.add(closeButton); + mainButtonsPanel.add(closePanel); + getContentPane().add(mainButtonsPanel); + + pack(); + } + + private void goToIntroSection(java.awt.event.ActionEvent evt) { + mainHtmlPane.setText(Translator.R("APPEXTSEChelp")); + mainHtmlPane.setCaretPosition(1); + } + + private void goToDialogueSection(java.awt.event.ActionEvent evt) { + mainHtmlPane.setText(Translator.R("APPEXTSEChelp")); + mainHtmlPane.scrollToReference("dialogue"); + } + + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + ExtendedAppletSecurityHelp dialog = new ExtendedAppletSecurityHelp(null, false); + dialog.setVisible(true); + } + }); + } + private JButton homeAndDialogueButton; + private JButton homeButton; + private JButton closeButton; + private JEditorPane mainHtmlPane; + private JPanel mainButtonsPanel; + private JPanel navigationPanel; + private JPanel closePanel; + private JPanel mainPanel; + private JScrollPane scrollPane; + private JSeparator niceSeparator; +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java 2013-05-03 19:08:24.302519467 +0000 @@ -0,0 +1,188 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.security.appletextendedsecurity.impl; + +import java.io.File; +import java.io.IOException; +import java.util.Date; +import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteUnsignedApplet; +import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; +import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx; +import net.sourceforge.jnlp.util.lockingfile.StorageIoException; + +public class UnsignedAppletActionStorageExtendedImpl extends UnsignedAppletActionStorageImpl { + + public UnsignedAppletActionStorageExtendedImpl(String location) { + this(new File(location)); + } + + public UnsignedAppletActionStorageExtendedImpl(File location) { + super(location); + } + + public UnsignedAppletActionEntry[] toArray() { + lock(); + try { + readContents(); + return items.toArray(new UnsignedAppletActionEntry[items.size()]); + } catch (IOException e) { + throw new StorageIoException(e); + } finally { + unlock(); + } + } + + public void clear() { + doLocked(new Runnable() { + public void run() { + try { + items.clear(); + writeContents(); + } catch (IOException e) { + throw new StorageIoException(e); + } + } + }); + } + + public void removeByBehaviour(final ExecuteUnsignedApplet unsignedAppletAction) { + doLocked(new Runnable() { + public void run() { + try { + readContents(); + for (int i = 0; i < items.size(); i++) { + UnsignedAppletActionEntry unsignedAppletActionEntry = items.get(i); + if (unsignedAppletActionEntry.getUnsignedAppletAction() == unsignedAppletAction) { + items.remove(i); + i--; + } + + } + writeContents(); + } catch (IOException e) { + throw new StorageIoException(e); + } + } + }); + } + + private void swap(final int i, final int ii) { + doLocked(new Runnable() { + public void run() { + try { + readContents(); + UnsignedAppletActionEntry backup = items.get(i); + items.set(i, items.get(ii)); + items.set(ii, backup); + writeContents(); + } catch (IOException e) { + throw new StorageIoException(e); + } + } + }); + + } + + public int moveUp(int selectedRow) { + if (selectedRow <= 0) { + return selectedRow; + } + swap(selectedRow, selectedRow - 1); + return selectedRow-1; + } + + public int moveDown(int selectedRow) { + if (selectedRow >= items.size() - 1) { + return selectedRow; + } + swap(selectedRow, selectedRow + 1); + return selectedRow+1; + } + + public void remove(final int item) { + doLocked(new Runnable() { + public void run() { + try { + readContents(); + items.remove(item); + writeContents(); + } catch (IOException ex) { + throw new StorageIoException(ex); + } + } + }); + } + + public void modify(final UnsignedAppletActionEntry source, final int columnIndex, final Object aValue) { + Runnable r = new Runnable() { + public void run() { + + try { + if (!items.contains(source)) { + throw new StorageIoException("Item to be modified not found in storage"); + } + + if (columnIndex == 0) { + source.setUnsignedAppletAction((ExecuteUnsignedApplet) aValue); + } + if (columnIndex == 1) { + source.setTimeStamp((Date) aValue); + } + if (columnIndex == 2) { + source.setDocumentBase(new UrlRegEx((String) aValue)); + } + if (columnIndex == 3) { + source.setCodeBase(new UrlRegEx((String) aValue)); + } + if (columnIndex == 4) { + source.setArchives(UnsignedAppletActionEntry.createArchivesList((String) aValue)); + } + + writeContents(); + } catch (IOException ex) { + throw new StorageIoException(ex); + } + } + }; + doLocked(r); + + } + + @Override + public synchronized void writeContentsLocked() throws IOException { + super.writeContentsLocked(); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java 2013-05-03 19:08:24.303519455 +0000 @@ -0,0 +1,244 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.security.appletextendedsecurity.impl; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteUnsignedApplet; +import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; +import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionStorage; +import net.sourceforge.jnlp.util.lockingfile.LockingReaderWriter; +import net.sourceforge.jnlp.util.lockingfile.StorageIoException; + +public class UnsignedAppletActionStorageImpl extends LockingReaderWriter implements UnsignedAppletActionStorage { + + protected List items; + + public UnsignedAppletActionStorageImpl(String location) { + this(new File(location)); + } + + public UnsignedAppletActionStorageImpl(File location) { + super(location); + } + + @Override + public void writeContents() throws IOException { + super.writeContents(); + } + + @Override + public synchronized void writeContentsLocked() throws IOException { + super.writeContentsLocked(); + } + + @Override + protected void readContents() throws IOException { + if (items == null) { + items = new ArrayList(); + } else { + items.clear(); + } + super.readContents(); + } + + @Override + protected void readLine(String line) { + if (line.trim().length() != 0) { + this.items.add(UnsignedAppletActionEntry.createFromString(line)); + } + } + + @Override + public void writeContent(BufferedWriter bw) throws IOException { + for (UnsignedAppletActionEntry item : items) { + item.write(bw); + bw.newLine(); + } + } + + @Override + public void add(final UnsignedAppletActionEntry item) { + doLocked(new Runnable() { + @Override + public void run() { + try { + readContents(); + items.add(item); + writeContents(); + } catch (IOException ex) { + throw new StorageIoException(ex); + } + } + }); + } + + @Override + public void update(final UnsignedAppletActionEntry item) { + doLocked(new Runnable() { + @Override + public void run() { + try { + if (items == null) { + throw new StorageIoException("Storage is not initialised, can not update"); + } + if (!items.contains(item)) { + throw new StorageIoException("Storage does not contain item you are updating. can not update"); + } + writeContents(); + } catch (IOException ex) { + throw new StorageIoException(ex); + } + } + }); + } + + @Override + public UnsignedAppletActionEntry getMatchingItem(String documentBase, String codeBase, List archives) { + List results = getMatchingItems(documentBase, codeBase, archives); + if (results == null || results.isEmpty()) { + return null; + } + // Chose the first result, unless we find a 'stronger' result + // Actions such as 'always accept' or 'always reject' are 'stronger' than + // the hints 'was accepted' or 'was rejected'. + for (UnsignedAppletActionEntry candidate : results) { + if (candidate.getUnsignedAppletAction() == ExecuteUnsignedApplet.ALWAYS + || candidate.getUnsignedAppletAction() == ExecuteUnsignedApplet.NEVER) { + //return first found strong + return candidate; + } + } + //no strong found, return first + return results.get(0); + } + + public List getMatchingItems(String documentBase, String codeBase, List archives) { + List result = new ArrayList(); + lock(); + try { + readContents(); + if (items == null) { + return result; + } + for (UnsignedAppletActionEntry unsignedAppletActionEntry : items) { + if (isMatching(unsignedAppletActionEntry, documentBase, codeBase, archives)) { + result.add(unsignedAppletActionEntry); + } + } + } catch (IOException e) { + throw new StorageIoException(e); + } finally { + unlock(); + } + return result; + } + + private boolean isMatching(UnsignedAppletActionEntry unsignedAppletActionEntry, String documentBase, String codeBase, List archives) { + boolean result = true; + if (documentBase != null && !documentBase.trim().isEmpty()) { + result = result && documentBase.matches(unsignedAppletActionEntry.getDocumentBase().getRegEx()); + } + if (codeBase != null && !codeBase.trim().isEmpty()) { + result = result && codeBase.matches(unsignedAppletActionEntry.getCodeBase().getRegEx()); + } + if (archives != null) { + List saved = unsignedAppletActionEntry.getArchives(); + if (saved == null || saved.isEmpty()) { + return result; + } + result = result && compareArchives(archives, saved); + } + return result; + } + + @Override + public String toString() { + return getBackingFile() + " " + super.toString(); + } + + private boolean compareArchives(List archives, List saved) { + if (archives == null && saved !=null){ + return false; + } + if (archives != null && saved ==null){ + return false; + } + if (archives == null && saved ==null){ + return true; + } + if (archives.size() != saved.size()) { + return false; + } + Collections.sort(archives); + Collections.sort(saved); + for (int i = 0; i < saved.size(); i++) { + String string1 = saved.get(i); + String string2 = archives.get(i); + //intentional reference compare + if (string1 == string2) { + continue; + } + if (string1 == null || string2 == null) { + return false; + } + if (string1.trim().equals(string2.trim())) { + continue; + } + return false; + } + return true; + } + + @Override + public UnsignedAppletActionEntry getMatchingItemByDocumentBase(String documentBase) { + return getMatchingItem(documentBase, null, null); + } + + @Override + public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase) { + return getMatchingItem(null, codeBase, null); + } + + @Override + public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase) { + return getMatchingItem(documentBase, codeBase, null); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java 2013-05-03 19:08:24.299519504 +0000 @@ -0,0 +1,174 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.security.appletextendedsecurity; + +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class UnsignedAppletActionEntry { + + private ExecuteUnsignedApplet unsignedAppletAction; + private Date timeStamp; + private UrlRegEx documentBase; + private UrlRegEx codeBase; + private List archives; + + public static UnsignedAppletActionEntry createFromString(String s) { + String[] split = s.split("\\s+"); + UnsignedAppletActionEntry nw = new UnsignedAppletActionEntry( + ExecuteUnsignedApplet.fromString(split[0]), + new Date(new Long(split[1])), + new UrlRegEx(split[2]), + null, + null); + if (split.length > 3) { + nw.setCodeBase(new UrlRegEx(split[3])); + } + if (split.length > 4) { + nw.setArchives(createArchivesList(s.substring(s.lastIndexOf(split[3]) + split[3].length()).trim())); + } + return nw; + } + + public UnsignedAppletActionEntry(ExecuteUnsignedApplet unsignedAppletAction, Date timeStamp, UrlRegEx documentBase, UrlRegEx codeBase, List archives) { + this.unsignedAppletAction = unsignedAppletAction; + this.timeStamp = timeStamp; + this.documentBase = documentBase; + this.codeBase = codeBase; + this.archives = archives; + + } + + @Override + public String toString() { + return this.serializeToReadableAndParseableString(); + + } + + public void write(Writer bw) throws IOException { + bw.write(this.serializeToReadableAndParseableString()); + } + + private String serializeToReadableAndParseableString() { + return unsignedAppletAction.toChar() + + " " + ((timeStamp == null) ? "1" : timeStamp.getTime()) + + " " + ((documentBase == null) ? "" : documentBase.getRegEx()) + + " " + ((codeBase == null) ? "" : codeBase.getRegEx()) + + " " + createArchivesString(archives); + } + + public Date getTimeStamp() { + return timeStamp; + } + + public UrlRegEx getDocumentBase() { + return documentBase; + } + + public void setTimeStamp(Date timeStamp) { + this.timeStamp = timeStamp; + } + + public void setDocumentBase(UrlRegEx documentBase) { + this.documentBase = documentBase; + } + + public ExecuteUnsignedApplet getUnsignedAppletAction() { + return unsignedAppletAction; + } + + public void setUnsignedAppletAction(ExecuteUnsignedApplet unsignedAppletAction) { + this.unsignedAppletAction = unsignedAppletAction; + } + + public UrlRegEx getCodeBase() { + return codeBase; + } + + public void setCodeBase(UrlRegEx codeBase) { + this.codeBase = codeBase; + } + + public List getArchives() { + return archives; + } + + public void setArchives(List archives) { + this.archives = archives; + } + + public static String createArchivesString(List listOfArchives) { + if (listOfArchives == null) { + return ""; + } + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < listOfArchives.size(); i++) { + String string = listOfArchives.get(i); + if (string.trim().isEmpty()) { + continue; + } + sb.append(string); + if (i != listOfArchives.size() - 1) { + sb.append(","); + } + } + return sb.toString(); + } + + public static List createArchivesList(String commedArchives) { + if (commedArchives == null) { + return null; + } + if (commedArchives.trim().isEmpty()) { + return null; + } + String[] items = commedArchives.trim().split(","); + List r = new ArrayList(items.length); + for (int i = 0; i < items.length; i++) { + String string = items[i]; + if (string.trim().isEmpty()) { + continue; + } + r.add(string); + + } + return r; + + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java 2013-05-03 19:08:24.301519479 +0000 @@ -0,0 +1,134 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.security.appletextendedsecurity; + +import java.util.List; + +/** + * This is abstract access to white/blacklist created from some permanent storage. + * + * It is daclaring adding, updating and searching. Intentionally not removing as + * during plugin runtime no deletations should be done. + * + * Implementations of this interface (unless dummy ones:) should ensure correct + * communication with permanent storage and be prepared for multiple instances + * read/write the same storage at time + * + */ +public interface UnsignedAppletActionStorage { + + /** + * This methods iterates through records in + * DeploymentConfiguration.getAppletTrustSettingsPath(), and is matching + * regexes saved here against params. So parameters here are NOT regexes, + * but are matched against saved regexes. + * + * Null or empty values are dangerously ignored, user, be aware of it. eg: + * match only codeBase will be null someCodeBase null null match only + * documentBase will be someDocBase null null null match only applet not + * regarding code or document base will be null null mainClass archives + * + * @param documentBase + * @param codeBase + * @param mainClass + * @param archives + * @return + */ + public UnsignedAppletActionEntry getMatchingItem(String documentBase, String codeBase, List archives); + + /** + * Shortcut getMatchingItem(documentBase, null,null,null) + * + * @param documentBase + * @return + */ + public UnsignedAppletActionEntry getMatchingItemByDocumentBase(String documentBase); + + /** + * Shortcut getMatchingItem(null, codeBase,null,null) + * + * @param codeBase + * @return + */ + public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase); + + /** + * Shortcut getMatchingItem(documentBase, codeBase,null,null) + * + * @param documentBase + * @param codeBase + * @return + */ + public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase); + + /** + * Will add new record. Note that regexes are stored for bases matching. + * + * eg UnsignedAppletActionEntry which will deny some applet no matter of + * page will be new UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, + * new Date(), null, null, someMain, someArchives) + * + * eg UnsignedAppletActionEntry which will allow all applets on page with + * same codebase will be new + * UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, new Date(), ".*", + * ".*", null, null); + * + * @param item + */ + public void add(final UnsignedAppletActionEntry item); + + /** + * Will replace (current impl is matching by object's hashcode This is not + * reloading the list(but still saving after), so StorageIoEception can be + * thrown if it was not loaded before. + * + * Imho this should be used only to actualise timestamps or change + * UnsignedAppletAction + * + * @param item + */ + public void update(final UnsignedAppletActionEntry item); + + /** + * Lock the storage, if necessary. If no ownership issues arise, can be a no-op. + */ + public void lock(); + + /** + * Unlock the storage, if necessary. If no ownership issues arise, can be a no-op. + */ + public void unlock(); +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java 2013-05-03 19:08:24.301519479 +0000 @@ -0,0 +1,208 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ + +package net.sourceforge.jnlp.security.appletextendedsecurity; + +import static net.sourceforge.jnlp.runtime.Translator.R; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +import net.sourceforge.jnlp.util.UrlUtils; +import net.sourceforge.jnlp.LaunchException; +import net.sourceforge.jnlp.PluginBridge; +import net.sourceforge.jnlp.cache.ResourceTracker; +import net.sourceforge.jnlp.security.SecurityDialogs; +import net.sourceforge.jnlp.security.UnsignedAppletTrustWarningPanel.UnsignedWarningAction; + +public class UnsignedAppletTrustConfirmation { + static private final boolean DEBUG = System.getenv().containsKey("ICEDTEAPLUGIN_DEBUG"); + + private static final AppletStartupSecuritySettings securitySettings = AppletStartupSecuritySettings.getInstance(); + + private static boolean unsignedConfirmationIsRequired() { + // If we are using the 'high' security setting or higher, we must confirm + // if the user wishes to run unsigned applets (not applicable to JNLP-launched apps) + return !(AppletSecurityLevel.ALLOW_UNSIGNED == securitySettings.getSecurityLevel()); + } + + private static boolean unsignedAppletsAreForbidden() { + // If we are using the 'very high' security setting or higher, we do not + // run unsigned applets + return AppletSecurityLevel.DENY_UNSIGNED == securitySettings.getSecurityLevel() + || AppletSecurityLevel.DENY_ALL == securitySettings.getSecurityLevel(); + } + + /** + * Gets the remembered decision, first checking the user policy for an ALWAYS/NEVER, + * and then the global policy. + * + * @param file the plugin file + * @return the remembered decision + */ + public static ExecuteUnsignedApplet getStoredAction(PluginBridge file) { + UnsignedAppletActionStorage userActionStorage = securitySettings.getUnsignedAppletActionCustomStorage(); + UnsignedAppletActionStorage globalActionStorage = securitySettings.getUnsignedAppletActionGlobalStorage(); + + UnsignedAppletActionEntry globalEntry = getMatchingItem(globalActionStorage, file); + UnsignedAppletActionEntry userEntry = getMatchingItem(userActionStorage, file); + + ExecuteUnsignedApplet globalAction = globalEntry == null ? null : globalEntry.getUnsignedAppletAction(); + ExecuteUnsignedApplet userAction = userEntry == null ? null : userEntry.getUnsignedAppletAction(); + + if (userAction == ExecuteUnsignedApplet.ALWAYS || userAction == ExecuteUnsignedApplet.NEVER) { + return userAction; + } else if (globalAction == ExecuteUnsignedApplet.ALWAYS || globalAction == ExecuteUnsignedApplet.NEVER) { + return globalAction; + } else { + return userAction; + } + } + + private static UnsignedAppletActionEntry getMatchingItem(UnsignedAppletActionStorage actionStorage, PluginBridge file) { + return actionStorage.getMatchingItem( + UrlUtils.normalizeUrlAndStripParams(file.getSourceLocation(), true /* encode local files */).toString(), + UrlUtils.normalizeUrlAndStripParams(file.getCodeBase(), true /* encode local files */).toString(), + toRelativePaths(file.getArchiveJars(), file.getCodeBase().toString())); + } + + /* Extract the archives as relative paths */ + static List toRelativePaths(List paths, String rootPath) { + List fileNames = new ArrayList(); + for (String path : paths) { + if (path.startsWith(rootPath)) { + fileNames.add(path.substring(rootPath.length())); + } else { + fileNames.add(path); + } + } + return fileNames; + } + + private static void updateAppletAction(PluginBridge file, ExecuteUnsignedApplet behaviour, boolean rememberForCodeBase) { + UnsignedAppletActionStorage userActionStorage = securitySettings.getUnsignedAppletActionCustomStorage(); + + userActionStorage.lock(); // We should ensure this operation is atomic + try { + UnsignedAppletActionEntry oldEntry = getMatchingItem(userActionStorage, file); + + /* Update, if entry exists */ + if (oldEntry != null) { + oldEntry.setUnsignedAppletAction(behaviour); + oldEntry.setTimeStamp(new Date()); + userActionStorage.update(oldEntry); + return; + } + + URL codebase = UrlUtils.normalizeUrlAndStripParams(file.getCodeBase(), true /* encode local files */); + URL documentbase = UrlUtils.normalizeUrlAndStripParams(file.getSourceLocation(), true /* encode local files */); + + /* Else, create a new entry */ + UrlRegEx codebaseRegex = new UrlRegEx("\\Q" + codebase + "\\E"); + UrlRegEx documentbaseRegex = new UrlRegEx(".*"); // Match any from codebase + List archiveMatches = null; // Match any from codebase + + if (!rememberForCodeBase) { + documentbaseRegex = new UrlRegEx("\\Q" + documentbase + "\\E"); // Match only this applet + archiveMatches = toRelativePaths(file.getArchiveJars(), file.getCodeBase().toString()); // Match only this applet + } + + UnsignedAppletActionEntry entry = new UnsignedAppletActionEntry( + behaviour, + new Date(), + documentbaseRegex, + codebaseRegex, + archiveMatches + ); + + userActionStorage.add(entry); + } finally { + userActionStorage.unlock(); + } + } + static private void debug(String logMessage) { + if (DEBUG) { + System.err.println(logMessage); + } + + } + + public static void checkUnsignedWithUserIfRequired(PluginBridge file) throws LaunchException { + + if (unsignedAppletsAreForbidden()) { + debug("Not running unsigned applet at " + file.getCodeBase() +" because unsigned applets are disallowed by security policy."); + throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LUnsignedApplet"), R("LUnsignedAppletPolicyDenied")); + } + + if (!unsignedConfirmationIsRequired()) { + debug("Running unsigned applet at " + file.getCodeBase() +" does not require confirmation according to security policy."); + return; + } + + ExecuteUnsignedApplet storedAction = getStoredAction(file); + debug("Stored action for unsigned applet at " + file.getCodeBase() +" was " + storedAction); + + boolean appletOK; + + if (storedAction == ExecuteUnsignedApplet.ALWAYS) { + appletOK = true; + } else if (storedAction == ExecuteUnsignedApplet.NEVER) { + appletOK = false; + } else { + // No remembered decision, prompt the user + UnsignedWarningAction warningResponse = SecurityDialogs.showUnsignedWarningDialog(file); + ExecuteUnsignedApplet executeAction = warningResponse.getAction(); + + appletOK = (executeAction == ExecuteUnsignedApplet.YES || executeAction == ExecuteUnsignedApplet.ALWAYS); + + if (executeAction != null) { + updateAppletAction(file, executeAction, warningResponse.rememberForCodeBase()); + } + + debug("Decided action for unsigned applet at " + file.getCodeBase() +" was " + executeAction); + } + + if (!appletOK) { + throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LUnsignedApplet"), R("LUnsignedAppletUserDenied")); + } + + } +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegEx.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegEx.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegEx.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegEx.java 2013-05-03 19:08:24.302519467 +0000 @@ -0,0 +1,62 @@ +/* Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.security.appletextendedsecurity; + +public class UrlRegEx { + + String regEx; + + public UrlRegEx(String s) { + regEx = s; + } + + @Override + public String toString() { + return getRegEx(); + } + + public String getRegEx() { + return regEx; + } + + public String getFilteredRegEx() { + return regEx.replaceAll("\\\\Q", "").replaceAll("\\\\E", ""); + } + + public void setRegEx(String regEx) { + this.regEx = regEx; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/AppVerifier.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/AppVerifier.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/AppVerifier.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/AppVerifier.java 2013-05-03 19:08:24.285519680 +0000 @@ -0,0 +1,91 @@ +/* AppVerifier.java + Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package net.sourceforge.jnlp.security; + +import java.security.cert.CertPath; +import java.util.Map; + +import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.LaunchException; +import net.sourceforge.jnlp.tools.CertInformation; +import net.sourceforge.jnlp.tools.JarCertVerifier; + +/** + * An interface that provides various details about an app's signers. + */ +public interface AppVerifier { + + /** + * Checks if the app has already found trust in its publisher(s). + * @param certs The certs to search through and their cert information + * @param signedJars A map of all the jars of this app and the number of + * signed entries each one has. + * @return True if the app trusts its publishers. + */ + public boolean hasAlreadyTrustedPublisher( + Map certs, + Map signedJars); + + /** + * Checks if the app has signer(s) whose certs along their chains are in CA certs. + * @param certs The certs to search through and their cert information + * @param signedJars A map of all the jars of this app and the number of + * signed entries each one has. + * @return True if the app has a root in the CA certs store. + */ + public boolean hasRootInCacerts(Map certs, + Map signedJars); + + /** + * Checks if the app's jars are covered by the provided certificates, enough + * to consider the app fully signed. + * @param certs Any possible signer and their respective information regarding this app. + * @param signedJars A map of all the jars of this app and the number of + * signed entries each one has. + * @return + */ + public boolean isFullySigned(Map certs, + Map signedJars); + + /** + * Prompt the user with requests for trusting the certificates used by this app + * @throws LaunchException + */ + public void checkTrustWithUser(JarCertVerifier jcv, JNLPFile file) + throws LaunchException; +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/CertsInfoPane.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/CertsInfoPane.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/CertsInfoPane.java 2013-04-10 11:40:23.881668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/CertsInfoPane.java 2013-05-03 19:08:24.288519644 +0000 @@ -84,7 +84,7 @@ * Builds the JTree out of CertPaths. */ void buildTree() { - certPath = parent.getCertVerifier().getCertPath(); + certPath = parent.getCertVerifier().getCertPath(null); X509Certificate firstCert = ((X509Certificate) certPath.getCertificates().get(0)); String subjectString = diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/CertVerifier.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/CertVerifier.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/CertVerifier.java 2013-04-10 11:40:23.880668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/CertVerifier.java 2013-05-03 19:08:24.286519668 +0000 @@ -1,5 +1,5 @@ /* CertVerifier.java - Copyright (C) 2009 Red Hat, Inc. + Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. @@ -39,10 +39,10 @@ import java.security.cert.CertPath; import java.security.cert.Certificate; -import java.util.ArrayList; +import java.util.List; /** - * An interface that provides various details about a certificate + * An interface that provides various details about certificates of an app. */ public interface CertVerifier { @@ -58,36 +58,30 @@ public boolean getRootInCacerts(); /** - * Return if there are signing issues with the certificate(s) being veried + * Return if there are signing issues with the certificate being verified */ - public boolean hasSigningIssues(); + public boolean hasSigningIssues(CertPath certPath); /** - * Return if there are no signing issues with this cert (!hasSigningIssues()) + * Get the details regarding issue with this certificate */ - public boolean noSigningIssues(); + public List getDetails(CertPath certPath); /** - * Get the details regarding issue(s) with this certificate - */ - public ArrayList getDetails(); - - /** - * Return a valid certificate path to this certificate(s) being verified + * Return a valid certificate path to this certificate being verified * @return The CertPath */ - public CertPath getCertPath(); + public CertPath getCertPath(CertPath certPath); /** * Returns the application's publisher's certificate. */ - public abstract Certificate getPublisher(); + public abstract Certificate getPublisher(CertPath certPath); /** * Returns the application's root's certificate. This - * may return the same certificate as getPublisher() in + * may return the same certificate as getPublisher(CertPath certPath) in * the event that the application is self signed. */ - public abstract Certificate getRoot(); - + public abstract Certificate getRoot(CertPath certPath); } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/CertWarningPane.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/CertWarningPane.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/CertWarningPane.java 2013-04-10 11:40:23.880668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/CertWarningPane.java 2013-05-03 19:08:24.286519668 +0000 @@ -96,7 +96,7 @@ private void addComponents() { AccessType type = parent.getAccessType(); JNLPFile file = parent.getFile(); - Certificate c = parent.getCertVerifier().getPublisher(); + Certificate c = parent.getCertVerifier().getPublisher(null); String name = ""; String publisher = ""; @@ -253,7 +253,7 @@ if (alwaysTrust != null && alwaysTrust.isSelected()) { try { KeyStore ks = KeyStores.getKeyStore(Level.USER, Type.CERTS); - X509Certificate c = (X509Certificate) parent.getCertVerifier().getPublisher(); + X509Certificate c = (X509Certificate) parent.getCertVerifier().getPublisher(null); CertificateUtils.addToKeyStore(c, ks); File keyStoreFile = new File(KeyStores.getKeyStoreLocation(Level.USER, Type.CERTS)); if (!keyStoreFile.isFile()) { diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java 2013-04-10 11:40:23.882668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java 2013-05-03 19:08:24.288519644 +0000 @@ -80,7 +80,14 @@ return isTrusted; } - public CertPath getCertPath() { + + /* XXX: Most of these methods have a CertPath param that should be passed + * from the UI dialogs. However, this is not implemented yet so most of + * the params are ignored. + */ + + @Override + public CertPath getCertPath(CertPath certPath) { // Parameter ignored. ArrayList list = new ArrayList(); for (int i = 0; i < chain.length; i++) @@ -99,7 +106,8 @@ return certPaths.get(0); } - public ArrayList getDetails() { + @Override + public List getDetails(CertPath certPath) { // Parameter ignored. boolean hasExpiredCert = false; boolean hasExpiringCert = false; @@ -192,13 +200,15 @@ details.add(detail); } - public Certificate getPublisher() { + @Override + public Certificate getPublisher(CertPath certPath) { // Paramater ignored. if (chain.length > 0) return (Certificate) chain[0]; return null; } - public Certificate getRoot() { + @Override + public Certificate getRoot(CertPath certPath) { // Parameter ignored. if (chain.length > 0) return (Certificate) chain[chain.length - 1]; return null; @@ -207,18 +217,14 @@ public boolean getRootInCacerts() { try { KeyStore[] caCertsKeyStores = KeyStores.getCAKeyStores(); - return CertificateUtils.inKeyStores((X509Certificate) getRoot(), caCertsKeyStores); + return CertificateUtils.inKeyStores((X509Certificate) getRoot(null), caCertsKeyStores); } catch (Exception e) { } return false; } - public boolean hasSigningIssues() { - return false; - } - - public boolean noSigningIssues() { + @Override + public boolean hasSigningIssues(CertPath certPath) { return false; } - } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java 2013-05-03 19:08:24.288519644 +0000 @@ -0,0 +1,142 @@ +/* JNLPAppVerifier.java + Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.security; + +import static net.sourceforge.jnlp.runtime.Translator.R; + +import java.security.cert.CertPath; +import java.util.Map; + +import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.LaunchException; +import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; +import net.sourceforge.jnlp.tools.CertInformation; +import net.sourceforge.jnlp.tools.JarCertVerifier; + +public class JNLPAppVerifier implements AppVerifier { + + @Override + public boolean hasAlreadyTrustedPublisher( + Map certs, + Map signedJars) { + int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(signedJars); + for (CertInformation certInfo : certs.values()) { + Map certSignedJars = certInfo.getSignedJars(); + + if (JarCertVerifier.getTotalJarEntries(certSignedJars) == sumOfSignableEntries + && certInfo.isPublisherAlreadyTrusted()) { + return true; + } + } + return false; + } + + @Override + public boolean hasRootInCacerts(Map certs, + Map signedJars) { + int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(signedJars); + for (CertInformation certInfo : certs.values()) { + Map certSignedJars = certInfo.getSignedJars(); + + if (JarCertVerifier.getTotalJarEntries(certSignedJars) == sumOfSignableEntries + && certInfo.isRootInCacerts()) { + return true; + } + } + return false; + } + + @Override + public boolean isFullySigned(Map certs, + Map signedJars) { + int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(signedJars); + for (CertPath cPath : certs.keySet()) { + // If this cert has signed everything, return true + if (hasCompletelySignedApp(certs.get(cPath), sumOfSignableEntries)) { + return true; + } + } + + // No cert found that signed all entries. Return false. + return false; + } + + @Override + public void checkTrustWithUser(JarCertVerifier jcv, JNLPFile file) + throws LaunchException { + + int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(jcv.getJarSignableEntries()); + for (CertPath cPath : jcv.getCertsList()) { + jcv.setCurrentlyUsedCertPath(cPath); + CertInformation info = jcv.getCertInformation(cPath); + if (hasCompletelySignedApp(info, sumOfSignableEntries)) { + if (info.isPublisherAlreadyTrusted()) { + return; + } + + AccessType dialogType; + if (info.isRootInCacerts() && !info.hasSigningIssues()) { + dialogType = AccessType.VERIFIED; + } else if (info.isRootInCacerts()) { + dialogType = AccessType.SIGNING_ERROR; + } else { + dialogType = AccessType.UNVERIFIED; + } + + boolean wasApproved = SecurityDialogs.showCertWarningDialog( + dialogType, file, jcv); + if (wasApproved) { + return; + } + } + } + + throw new LaunchException(null, null, R("LSFatal"), R("LCLaunching"), + R("LCancelOnUserRequest"), ""); + } + + /** + * Find out if the CertPath with the given info has fully signed the app. + * @param info The information regarding the CertPath in question + * @param sumOfSignableEntries The total number of signable entries in the app. + * @return True if the signer has fully signed this app. + */ + public boolean hasCompletelySignedApp(CertInformation info, int sumOfSignableEntries) { + return JarCertVerifier.getTotalJarEntries(info.getSignedJars()) == sumOfSignableEntries; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/MoreInfoPane.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/MoreInfoPane.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/MoreInfoPane.java 2013-04-10 11:40:23.882668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/MoreInfoPane.java 2013-05-03 19:08:24.290519620 +0000 @@ -44,7 +44,7 @@ import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; +import java.util.List; import javax.swing.BorderFactory; import javax.swing.ImageIcon; @@ -73,7 +73,7 @@ * Constructs the GUI components of this panel */ private void addComponents() { - ArrayList details = certVerifier.getDetails(); + List details = certVerifier.getDetails(null); // Show signed JNLP warning if the signed main jar does not have a // signed JNLP file and the launching JNLP file contains special properties diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java 2013-05-03 19:08:24.292519595 +0000 @@ -0,0 +1,225 @@ +/* PluginAppVerifier.java + Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.security; + +import static net.sourceforge.jnlp.runtime.Translator.R; + +import java.security.cert.CertPath; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.LaunchException; +import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; +import net.sourceforge.jnlp.tools.CertInformation; +import net.sourceforge.jnlp.tools.JarCertVerifier; + +public class PluginAppVerifier implements AppVerifier { + + @Override + public boolean hasAlreadyTrustedPublisher( + Map certs, + Map signedJars) { + + boolean allPublishersTrusted = true; + + for(String jarName : signedJars.keySet()) { + int numbSignableEntries = signedJars.get(jarName); + boolean publisherTrusted = false; + + for (CertInformation certInfo : certs.values()) { + if(certInfo.isSignerOfJar(jarName) + && numbSignableEntries == certInfo.getNumJarEntriesSigned(jarName) + && certInfo.isPublisherAlreadyTrusted()) { + publisherTrusted = true; + break; + } + } + + allPublishersTrusted &= publisherTrusted; + } + return allPublishersTrusted; + } + + @Override + public boolean hasRootInCacerts(Map certs, + Map signedJars) { + + boolean allRootCAsTrusted = true; + + for(String jarName : signedJars.keySet()) { + int numbSignableEntries = signedJars.get(jarName); + boolean rootCATrusted = false; + + for (CertInformation certInfo : certs.values()) { + if(certInfo.isSignerOfJar(jarName) + && numbSignableEntries == certInfo.getNumJarEntriesSigned(jarName) + && certInfo.isRootInCacerts()) { + rootCATrusted = true; + break; + } + } + + allRootCAsTrusted &= rootCATrusted; + } + return allRootCAsTrusted; + } + + @Override + public boolean isFullySigned(Map certs, + Map signedJars) { + + boolean isFullySigned = true; + + for(String jarName : signedJars.keySet()) { + int numbSignableEntries = signedJars.get(jarName); + boolean isSigned = false; + + for (CertInformation certInfo : certs.values()) { + if(certInfo.isSignerOfJar(jarName) + && numbSignableEntries == certInfo.getNumJarEntriesSigned(jarName)) { + isSigned = true; + break; + } + } + + isFullySigned &= isSigned; + } + + return isFullySigned; + } + + @Override + public void checkTrustWithUser(JarCertVerifier jcv, JNLPFile file) + throws LaunchException { + List certPaths = buildCertPathsList(jcv); + List alreadyApprovedByUser = new ArrayList(); + for (String jarName : jcv.getJarSignableEntries().keySet()) { + boolean trustFoundOrApproved = false; + for (CertPath cPathApproved : alreadyApprovedByUser) { + jcv.setCurrentlyUsedCertPath(cPathApproved); + CertInformation info = jcv.getCertInformation(cPathApproved); + if (info.isSignerOfJar(jarName) + && alreadyApprovedByUser.contains(cPathApproved)) { + trustFoundOrApproved = true; + break; + } + } + + if (trustFoundOrApproved) { + continue; + } + + for (CertPath cPath : certPaths) { + jcv.setCurrentlyUsedCertPath(cPath); + CertInformation info = jcv.getCertInformation(cPath); + if (info.isSignerOfJar(jarName)) { + if (info.isPublisherAlreadyTrusted()) { + trustFoundOrApproved = true; + alreadyApprovedByUser.add(cPath); + break; + } + + AccessType dialogType; + if (info.isRootInCacerts() && !info.hasSigningIssues()) { + dialogType = AccessType.VERIFIED; + } else if (info.isRootInCacerts()) { + dialogType = AccessType.SIGNING_ERROR; + } else { + dialogType = AccessType.UNVERIFIED; + } + + boolean wasApproved = SecurityDialogs.showCertWarningDialog( + dialogType, file, jcv); + if (wasApproved) { + alreadyApprovedByUser.add(cPath); + trustFoundOrApproved = true; + break; + } + } + } + if (!trustFoundOrApproved) { + throw new LaunchException(null, null, R("LSFatal"), + R("LCLaunching"), R("LCancelOnUserRequest"), ""); + } + } + } + + /** + * Build a list of all the CertPaths that were detected in the provided + * JCV, placing them in the most trusted possible order. + * @param jcv The verifier containing the CertPaths to examine. + * @return A list of CertPaths sorted in the following order: Signers with + * 1. Already trusted publishers + * 2. Roots in the CA store and have no signing issues + * 3. Roots in the CA store but have signing issues + * 4. Everything else + */ + public List buildCertPathsList(JarCertVerifier jcv) { + List certPathsList = jcv.getCertsList(); + List returnList = new ArrayList(); + + for (CertPath cPath : certPathsList) { + if (!returnList.contains(cPath) + && jcv.getCertInformation(cPath).isPublisherAlreadyTrusted()) + returnList.add(cPath); + } + + for (CertPath cPath : certPathsList) { + if (!returnList.contains(cPath) + && jcv.getCertInformation(cPath).isRootInCacerts() + && !jcv.getCertInformation(cPath).hasSigningIssues()) + returnList.add(cPath); + } + + for (CertPath cPath : certPathsList) { + if (!returnList.contains(cPath) + && jcv.getCertInformation(cPath).isRootInCacerts() + && jcv.getCertInformation(cPath).hasSigningIssues()) + returnList.add(cPath); + } + + for (CertPath cPath : certPathsList) { + if (!returnList.contains(cPath)) + returnList.add(cPath); + } + + return returnList; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/SecurityDialog.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/SecurityDialog.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/SecurityDialog.java 2013-04-10 11:40:23.883668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/SecurityDialog.java 2013-05-03 19:08:24.292519595 +0000 @@ -38,6 +38,7 @@ package net.sourceforge.jnlp.security; import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.security.SecurityDialogs.DialogType; @@ -52,6 +53,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.List; +import net.sourceforge.jnlp.util.ScreenFinder; /** * Provides methods for showing security warning dialogs for a wide range of @@ -305,6 +307,8 @@ panel = new AppletWarningPane(this, this.certVerifier); else if (dialogType == DialogType.NOTALLSIGNED_WARNING) panel = new NotAllSignedWarningPane(this); + else if (dialogType == DialogType.UNSIGNED_WARNING) // Only necessary for applets on 'high security' or above + panel = new UnsignedAppletTrustWarningDialog(this, (PluginBridge)file); else if (dialogType == DialogType.AUTHENTICATION) panel = new PasswordAuthenticationPane(this, extras); @@ -312,11 +316,7 @@ } private static void centerDialog(JDialog dialog) { - Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - Dimension dialogSize = dialog.getSize(); - - dialog.setLocation((screen.width - dialogSize.width) / 2, - (screen.height - dialogSize.height) / 2); + ScreenFinder.centerWindowsToCurrentScreen(dialog); } private void selectDefaultButton() { diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java 2013-04-10 11:40:23.884668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java 2013-05-03 19:08:24.293519582 +0000 @@ -1,3 +1,40 @@ +/* SecurityDialogMessage.java + Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + package net.sourceforge.jnlp.security; import java.security.cert.X509Certificate; diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/SecurityDialogs.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/SecurityDialogs.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/SecurityDialogs.java 2013-04-10 11:40:23.884668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/SecurityDialogs.java 2013-05-03 19:08:24.294519569 +0000 @@ -37,6 +37,9 @@ package net.sourceforge.jnlp.security; +import net.sourceforge.jnlp.security.UnsignedAppletTrustWarningPanel.UnsignedWarningAction; +import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteUnsignedApplet; + import java.awt.Dialog.ModalityType; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -70,6 +73,7 @@ SINGLE_CERT_INFO, ACCESS_WARNING, NOTALLSIGNED_WARNING, + UNSIGNED_WARNING, /* requires confirmation with 'high-security' setting */ APPLET_WARNING, AUTHENTICATION, } @@ -86,6 +90,7 @@ VERIFIED, UNVERIFIED, NOTALLSIGNED, + UNSIGNED, /* requires confirmation with 'high-security' setting */ SIGNING_ERROR } @@ -173,6 +178,26 @@ } /** + * Shows a warning dialog for when a plugin applet is unsigned. + * This is used with 'high-security' setting. + * + * @return true if permission was granted by the user, false otherwise. + */ + public static UnsignedWarningAction showUnsignedWarningDialog(JNLPFile file) { + + if (!shouldPromptUser()) { + return new UnsignedWarningAction(ExecuteUnsignedApplet.NO, false); + } + + final SecurityDialogMessage message = new SecurityDialogMessage(); + message.dialogType = DialogType.UNSIGNED_WARNING; + message.accessType = AccessType.UNSIGNED; + message.file = file; + + return (UnsignedWarningAction)getUserResponse(message); + } + + /** * Shows a security warning dialog according to the specified type of * access. If type is one of AccessType.VERIFIED or * AccessType.UNVERIFIED, extra details will be available with regards diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java 2013-05-03 19:08:24.295519556 +0000 @@ -0,0 +1,63 @@ +/* Copyright (C) 2013 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.security; + +import net.sourceforge.jnlp.PluginBridge; +import net.sourceforge.jnlp.security.UnsignedAppletTrustWarningPanel.UnsignedWarningAction; +import net.sourceforge.jnlp.security.UnsignedAppletTrustWarningPanel.ActionChoiceListener; + +/** + * A panel that confirms that the user is OK with unsigned code running. + * + */ +public class UnsignedAppletTrustWarningDialog extends SecurityDialogPanel { + + public UnsignedAppletTrustWarningDialog(SecurityDialog x, PluginBridge file) { + super(x); + + add(new UnsignedAppletTrustWarningPanel(file, + new ActionChoiceListener() { + @Override + public void actionChosen(UnsignedWarningAction action) { + parent.setValue(action); + parent.dispose(); + } + }) + ); + } + +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java 2013-05-03 19:08:24.296519543 +0000 @@ -0,0 +1,302 @@ +/* Copyright (C) 2013 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.security; + +import static net.sourceforge.jnlp.runtime.Translator.R; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.ButtonGroup; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.SwingConstants; + +import net.sourceforge.jnlp.PluginBridge; +import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteUnsignedApplet; +import net.sourceforge.jnlp.security.appletextendedsecurity.ExtendedAppletSecurityHelp; +import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; +import net.sourceforge.jnlp.util.ScreenFinder; + +public class UnsignedAppletTrustWarningPanel extends JPanel { + + /* + * Details of decided action. + */ + public static class UnsignedWarningAction { + private ExecuteUnsignedApplet action; + private boolean applyToCodeBase; + + public UnsignedWarningAction(ExecuteUnsignedApplet action, + boolean applyToCodeBase) { + this.action = action; + this.applyToCodeBase = applyToCodeBase; + } + + public ExecuteUnsignedApplet getAction() { + return action; + } + public boolean rememberForCodeBase() { + return applyToCodeBase; + } + } + + /* + * Callback for when action is decided. + */ + public static interface ActionChoiceListener { + void actionChosen(UnsignedWarningAction action); + } + + private final int PANE_WIDTH = 500; + + private final int TOP_PANEL_HEIGHT = 60; + private final int INFO_PANEL_HEIGHT = 140; + private final int INFO_PANEL_HINT_HEIGHT = 25; + private final int QUESTION_PANEL_HEIGHT = 35; + + private JButton allowButton; + private JButton rejectButton; + private JButton helpButton; + private JCheckBox permanencyCheckBox; + private JRadioButton applyToAppletButton; + private JRadioButton applyToCodeBaseButton; + + private PluginBridge file; + + private ActionChoiceListener actionChoiceListener; + + public UnsignedAppletTrustWarningPanel(PluginBridge file, ActionChoiceListener actionChoiceListener) { + + this.file = file; + this.actionChoiceListener = actionChoiceListener; + + addComponents(); + } + + public JButton getAllowButton() { + return allowButton; + } + + public JButton getRejectButton() { + return rejectButton; + } + + private String htmlWrap(String text) { + return "" + text + ""; + } + + private ImageIcon infoImage() { + final String location = "net/sourceforge/jnlp/resources/info-small.png"; + final ClassLoader appLoader = new sun.misc.Launcher().getClassLoader(); + return new ImageIcon(appLoader.getResource(location)); + } + + private void setupTopPanel() { + final String topLabelText = R("SUnsignedSummary"); + + JLabel topLabel = new JLabel(htmlWrap(topLabelText), infoImage(), + SwingConstants.LEFT); + topLabel.setFont(new Font(topLabel.getFont().toString(), Font.BOLD, 12)); + + JPanel topPanel = new JPanel(new BorderLayout()); + topPanel.setBackground(Color.WHITE); + topPanel.add(topLabel, BorderLayout.CENTER); + topPanel.setPreferredSize(new Dimension(PANE_WIDTH, TOP_PANEL_HEIGHT)); + topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + add(topPanel); + } + + private void setupInfoPanel() { + String infoLabelText = R("SUnsignedDetail", file.getCodeBase(), file.getSourceLocation()); + ExecuteUnsignedApplet rememberedAction = UnsignedAppletTrustConfirmation.getStoredAction(file); + int panelHeight = INFO_PANEL_HEIGHT; + if (rememberedAction == ExecuteUnsignedApplet.YES) { + infoLabelText += "
    " + R("SUnsignedAllowedBefore"); + panelHeight += INFO_PANEL_HINT_HEIGHT; + } else if (rememberedAction == ExecuteUnsignedApplet.NO) { + infoLabelText += "
    " + R("SUnsignedRejectedBefore"); + panelHeight += INFO_PANEL_HINT_HEIGHT; + } + + JLabel infoLabel = new JLabel(htmlWrap(infoLabelText)); + JPanel infoPanel = new JPanel(new BorderLayout()); + infoPanel.add(infoLabel, BorderLayout.CENTER); + infoPanel.setPreferredSize(new Dimension(PANE_WIDTH, panelHeight)); + infoPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + add(infoPanel); + } + + private void setupQuestionsPanel() { + JPanel questionPanel = new JPanel(new BorderLayout()); + + questionPanel.add(new JLabel(htmlWrap(R("SUnsignedQuestion"))), BorderLayout.EAST); + + questionPanel.setPreferredSize(new Dimension(PANE_WIDTH, QUESTION_PANEL_HEIGHT)); + questionPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + + add(questionPanel); + } + + private JPanel createMatchOptionsPanel() { + JPanel matchOptionsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + + ButtonGroup group = new ButtonGroup(); + applyToAppletButton = new JRadioButton(R("SRememberAppletOnly")); + applyToAppletButton.setSelected(true); + applyToAppletButton.setEnabled(false); // Start disabled until 'Remember this option' is selected + + applyToCodeBaseButton = new JRadioButton(htmlWrap(R("SRememberCodebase", file.getCodeBase()))); + applyToCodeBaseButton.setEnabled(false); + + group.add(applyToAppletButton); + group.add(applyToCodeBaseButton); + + matchOptionsPanel.add(applyToAppletButton); + matchOptionsPanel.add(applyToCodeBaseButton); + + return matchOptionsPanel; + } + + private JPanel createCheckBoxPanel() { + JPanel checkBoxPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); + + permanencyCheckBox = new JCheckBox(htmlWrap(R("SRememberOption"))); + permanencyCheckBox.addActionListener(permanencyListener()); + checkBoxPanel.add(permanencyCheckBox); + + return checkBoxPanel; + } + + private JPanel createButtonPanel() { + JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + + allowButton = new JButton(R("ButProceed")); + rejectButton = new JButton(R("ButCancel")); + helpButton = new JButton(R("APPEXTSECguiPanelHelpButton")); + + allowButton.addActionListener(chosenActionSetter(true)); + rejectButton.addActionListener(chosenActionSetter(false)); + + helpButton.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + JDialog d = new ExtendedAppletSecurityHelp(null, false,"dialogue"); + ScreenFinder.centerWindowsToCurrentScreen(d); + d.setVisible(true); + } + }); + + buttonPanel.add(allowButton); + buttonPanel.add(rejectButton); + buttonPanel.add(helpButton); + + buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); + + return buttonPanel; + } + + // Set up 'Remember Option' checkbox & Proceed/Cancel buttons + private void setupButtonAndCheckBoxPanel() { + JPanel outerPanel = new JPanel(new BorderLayout()); + JPanel rememberPanel = new JPanel(new GridLayout(2 /*rows*/, 1 /*column*/)); + rememberPanel.add(createCheckBoxPanel()); + rememberPanel.add(createMatchOptionsPanel()); + rememberPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + outerPanel.add(rememberPanel, BorderLayout.WEST); + outerPanel.add(createButtonPanel(), BorderLayout.EAST); + + add(outerPanel); + } + + /** + * Creates the actual GUI components, and adds it to this panel + */ + private void addComponents() { + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + + setupTopPanel(); + setupInfoPanel(); + setupQuestionsPanel(); + setupButtonAndCheckBoxPanel(); + } + + // Toggles whether 'match applet' or 'match codebase' options are greyed out + private ActionListener permanencyListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + applyToAppletButton.setEnabled(permanencyCheckBox.isSelected()); + applyToCodeBaseButton.setEnabled(permanencyCheckBox.isSelected()); + } + }; + } + // Sets action depending on allowApplet + checkbox state + private ActionListener chosenActionSetter(final boolean allowApplet) { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ExecuteUnsignedApplet action; + + if (allowApplet) { + action = permanencyCheckBox.isSelected() ? ExecuteUnsignedApplet.ALWAYS : ExecuteUnsignedApplet.YES; + } else { + action = permanencyCheckBox.isSelected() ? ExecuteUnsignedApplet.NEVER : ExecuteUnsignedApplet.NO; + } + + boolean applyToCodeBase = applyToCodeBaseButton.isSelected(); + actionChoiceListener.actionChosen(new UnsignedWarningAction(action, applyToCodeBase)); + } + }; + } +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java icedtea-web-1.4/netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java 2013-04-10 11:40:23.887668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java 2013-05-03 19:08:24.304519443 +0000 @@ -52,6 +52,7 @@ import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.ImageResources; +import net.sourceforge.jnlp.util.ScreenFinder; public class CertificateViewer extends JDialog { @@ -94,11 +95,7 @@ } private void centerDialog() { - Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - Dimension dialogSize = getSize(); - - setLocation((screen.width - dialogSize.width) / 2, - (screen.height - dialogSize.height) / 2); + ScreenFinder.centerWindowsToCurrentScreen(this); } public static void showCertificateViewer() throws Exception { diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/SecurityDesc.java icedtea-web-1.4/netx/net/sourceforge/jnlp/SecurityDesc.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/SecurityDesc.java 2013-04-10 11:40:23.857668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/SecurityDesc.java 2013-05-03 19:08:24.218520523 +0000 @@ -149,6 +149,9 @@ * @param downloadHost the download host (can always connect to) */ public SecurityDesc(JNLPFile file, Object type, String downloadHost) { + if (file == null) { + throw new NullJnlpFileException(); + } this.file = file; this.type = type; this.downloadHost = downloadHost; @@ -233,10 +236,16 @@ if (grantAwtPermissions) { permissions.add(new AWTPermission("showWindowWithoutWarningBanner")); } - - if (file.isApplication()) - for (int i = 0; i < jnlpRIAPermissions.length; i++) - permissions.add(jnlpRIAPermissions[i]); + if (JNLPRuntime.isWebstartApplication()) { + if (file == null) { + throw new NullJnlpFileException("Can not return sandbox permissions, file is null"); + } + if (file.isApplication()) { + for (int i = 0; i < jnlpRIAPermissions.length; i++) { + permissions.add(jnlpRIAPermissions[i]); + } + } + } if (downloadHost != null && downloadHost.length() > 0) permissions.add(new SocketPermission(downloadHost, diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/services/XDownloadService.java icedtea-web-1.4/netx/net/sourceforge/jnlp/services/XDownloadService.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/services/XDownloadService.java 2013-04-10 11:40:23.888668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/services/XDownloadService.java 2013-05-03 19:08:24.307519405 +0000 @@ -20,6 +20,13 @@ import java.net.*; import javax.jnlp.*; +import net.sourceforge.jnlp.JARDesc; +import net.sourceforge.jnlp.Version; +import net.sourceforge.jnlp.cache.CacheUtil; +import net.sourceforge.jnlp.runtime.JNLPClassLoader; +import net.sourceforge.jnlp.runtime.ManageJnlpResources; +import net.sourceforge.jnlp.runtime.JNLPRuntime; + /** * The DownloadService JNLP service. * @@ -28,11 +35,14 @@ */ class XDownloadService implements DownloadService { - protected XDownloadService() { + /** + * Returns the JNLPClassLoader of the application + * @return + */ + JNLPClassLoader getClassLoader() { + return (JNLPClassLoader) JNLPRuntime.getApplication().getClassLoader(); } - // comments copied from DownloadService interface - /** * Returns a listener that will automatically display download * progress to the user. @@ -46,7 +56,19 @@ * url and version) is cached locally. */ public boolean isExtensionPartCached(URL ref, String version, String part) { - return true; + boolean allCached = true; + Version resourceVersion = (version == null) ? null : new Version(version); + + JARDesc[] jars = ManageJnlpResources.findJars(this.getClassLoader(), ref, part, resourceVersion); + + if (jars.length <= 0) + return false; + + for (int i = 0; i < jars.length && allCached; i++) { + allCached = CacheUtil.isCached(jars[i].getLocation(), resourceVersion); + } + + return allCached; } /** @@ -54,7 +76,14 @@ * url and version) are cached locally. */ public boolean isExtensionPartCached(URL ref, String version, String[] parts) { - return true; + boolean allCached = true; + if (parts.length <= 0) + return false; + + for (String eachPart : parts) + allCached = this.isExtensionPartCached(ref, version, eachPart); + + return allCached; } /** @@ -64,7 +93,17 @@ * the application. */ public boolean isPartCached(String part) { - return true; + boolean allCached = true; + JARDesc[] jars = ManageJnlpResources.findJars(this.getClassLoader(), null, part, null); + + if (jars.length <= 0) + return false; + + for (int i = 0; i < jars.length && allCached; i++) { + allCached = CacheUtil.isCached(jars[i].getLocation(), null); + } + + return allCached; } /** @@ -74,7 +113,14 @@ * application. */ public boolean isPartCached(String[] parts) { - return true; + boolean allCached = true; + if (parts.length <= 0) + return false; + + for (String eachPart : parts) + allCached = this.isPartCached(eachPart); + + return allCached; } /** @@ -83,7 +129,7 @@ * application or extension. */ public boolean isResourceCached(URL ref, String version) { - return true; + return ManageJnlpResources.isExternalResourceCached(this.getClassLoader(), ref, version); } /** @@ -92,6 +138,8 @@ * @throws IOException */ public void loadExtensionPart(URL ref, String version, String[] parts, DownloadServiceListener progress) throws IOException { + for (String eachPart : parts) + this.loadExtensionPart(ref, version, eachPart, progress); } /** @@ -100,6 +148,8 @@ * @throws IOException */ public void loadExtensionPart(URL ref, String version, String part, DownloadServiceListener progress) throws IOException { + Version resourceVersion = (version == null) ? null : new Version(version); + ManageJnlpResources.downloadJars(this.getClassLoader(), ref, part, resourceVersion); } /** @@ -108,6 +158,8 @@ * @throws IOException */ public void loadPart(String[] parts, DownloadServiceListener progress) throws IOException { + for (String eachPart : parts) + this.loadPart(eachPart, progress); } /** @@ -116,6 +168,7 @@ * @throws IOException */ public void loadPart(String part, DownloadServiceListener progress) throws IOException { + ManageJnlpResources.downloadJars(this.getClassLoader(), null, part, null); } /** @@ -124,6 +177,7 @@ * @throws IOException */ public void loadResource(URL ref, String version, DownloadServiceListener progress) throws IOException { + ManageJnlpResources.loadExternalResouceToCache(this.getClassLoader(), ref, version); } /** @@ -133,6 +187,9 @@ * @throws IOException */ public void removeExtensionPart(URL ref, String version, String part) throws IOException { + Version resourceVersion = (version == null) ? null : new Version(version); + JARDesc[] jars = ManageJnlpResources.findJars(this.getClassLoader(), ref, part, resourceVersion); + ManageJnlpResources.removeCachedJars(this.getClassLoader(), ref, jars); } /** @@ -142,6 +199,8 @@ * @throws IOException */ public void removeExtensionPart(URL ref, String version, String[] parts) throws IOException { + for (String eachPart : parts) + this.removeExtensionPart(ref, version, eachPart); } /** @@ -151,6 +210,8 @@ * @throws IOException */ public void removePart(String part) throws IOException { + JARDesc[] jars = ManageJnlpResources.findJars(this.getClassLoader(), null, part, null); + ManageJnlpResources.removeCachedJars(this.getClassLoader(), null, jars); } /** @@ -160,6 +221,8 @@ * @throws IOException */ public void removePart(String[] parts) throws IOException { + for (String eachPart : parts) + this.removePart(eachPart); } /** @@ -169,6 +232,7 @@ * @throws IOException */ public void removeResource(URL ref, String version) throws IOException { + ManageJnlpResources.removeExternalCachedResource(this.getClassLoader(), ref, version); } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java 2013-05-03 19:08:24.327519153 +0000 @@ -0,0 +1,118 @@ +/* DefaultErrorSplashScreen12.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls; + +import java.awt.Graphics; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; +import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.ErrorPainter; +import net.sourceforge.jnlp.splashscreen.parts.BasicComponentErrorSplashScreen; + +public final class DefaultErrorSplashScreen2012 extends BasicComponentErrorSplashScreen { + + private final DefaultErrorSplashScreen2012 self; + private final ErrorPainter painter; + private final DefaultSplashScreens2012Commons commons; + + public DefaultErrorSplashScreen2012(int width, int height, SplashReason splashReason, Throwable ex) { + //setting width and height now is causing unnecessary blinking + //setSplashHeight(height); + //setSplashWidth(width); + //to have this in inner classes + self = this; + setLoadingException(ex); + setSplashReason(splashReason); + painter = new ErrorPainter(self, true); + addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + if (((ErrorPainter) painter).getErrorCorner() != null + && e.getX() > ((ErrorPainter) painter).getErrorCorner().x + && e.getY() > ((ErrorPainter) painter).getErrorCorner().y) { + raiseExceptionDialog(); + } + } + }); + commons = new DefaultSplashScreens2012Commons(painter, self); + } + + @Override + public void paintComponent(Graphics g) { + paintTo(g); + } + + @Override + public void paintTo(Graphics g) { + commons.paintTo(g); + + + } + + @Override + public void adjustForSize() { + commons.adjustForSize(); + } + + @Override + public void stopAnimation() { + commons.stopAnimation(); + } + + /** + * Methods to start the animation in the splash panel. + * + * This method exits after starting a new thread to do the animation. It + * is synchronized to prevent multiple startAnimation threads from being created. + */ + @Override + public void startAnimation() { + commons.startAnimation(); + } + + @Override + public void setPercentage(int done) { + commons.setPercentage(done); + } + + @Override + public int getPercentage() { + return commons.getPercentage(); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java 2013-05-03 19:08:24.334519064 +0000 @@ -0,0 +1,553 @@ +/* BasePainter.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +import net.sourceforge.jnlp.splashscreen.impls.*; +import java.awt.Color; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.Toolkit; +import java.awt.font.TextAttribute; +import java.awt.image.BufferedImage; +import java.util.HashMap; +import java.util.List; + +import java.util.Map; +import java.util.Observable; +import java.util.Observer; + +import javax.swing.SwingUtilities; +import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; +import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen; +import net.sourceforge.jnlp.splashscreen.parts.InfoItem; +import net.sourceforge.jnlp.splashscreen.parts.InformationElement; +import net.sourceforge.jnlp.util.ScreenFinder; + +public class BasePainter implements Observer { + + protected final BasicComponentSplashScreen master; + //animations + //waterLevel of water (0-100%) + private int waterLevel = 0; + //waving of water and position of shhadowed WEB + private int animationsPosition = 0; + private int greyTextIncrment = 15; //how quickly is greyed web moving + //colors + protected static final Color TEA_LIVE_COLOR = new Color(205, 1, 3); + protected static final Color BACKGROUND_LIVE_COLOR = Color.white; + protected static final Color TEA_LEAFS_STALKS_LIVE_COLOR = Color.black; + protected static final Color PLUGIN_LIVE_COLOR = Color.black; + protected static final Color WATER_LIVE_COLOR = new Color(80, 131, 160); + protected static final Color PLAIN_TEXT_LIVE_COLOR = Color.black; + protected Color teaColor; + protected Color backgroundColor; + protected Color teaLeafsStalksColor; + protected Color pluginColor; + protected Color waterColor; + protected Color plainTextColor; + //BufferedImage tmpBackround; //testingBackground for fitting + protected BufferedImage prerenderedStuff; + private Font teaFont; + private Font icedFont; + private Font webFont; + private Font pluginFont; + private Font plainTextsFont; + private Font alternativeTextFont; + //those spaces are meaningful for centering the text.. thats why alternative;) + private static final String alternativeICED = "Iced "; + private static final String alternativeWeb = "Web "; + private static final String alternativeTtea = " Tea"; + private static final String alternativePlugin = "plugin "; + private static final String ICED = "Iced"; + private static final String web = "web"; + private static final String tea = "Tea"; + private static final String plugin = "plugin "; + //inidivdual sizes, all converging to ZERO!! + /** + * Experimentaly meassured best top position for painted parts of vectros + */ + private final int WEB_TOP_ALIGMENT = 324; + /** + * Experimentaly meassured best left position for painted parts of vectors + */ + private final int WEB_LEFT_ALIGMENT = 84; + //enabling + protected boolean showNiceTexts = true; + private boolean showLeaf = true; + private boolean showInfo = true; + protected TextWithWaterLevel twl; + protected TextWithWaterLevel oldTwl; + protected boolean canWave = true; + + protected void paintNiceTexts(Graphics2D g2d) { + //the only animated stuff + oldTwl = twl; + twl = new TextWithWaterLevel(ICED, icedFont); + if (oldTwl != null && !canWave) { + twl.setCachedPolygon(oldTwl.getCachedPolygon()); + } + twl.setPercentageOfWater(waterLevel); + twl.setBgColor(backgroundColor); + twl.setWaterColor(waterColor); + twl.cutTo(g2d, scaleX(42), scaleY(278)); + MovingText mt = new MovingText(web, webFont); + mt.setPercentageOfWater(animationsPosition); + mt.cutTo(g2d, scaleX(WEB_LEFT_ALIGMENT), scaleY(WEB_TOP_ALIGMENT)); + } + + protected void paintPlainTexts(Graphics2D g2d) { + g2d.setFont(alternativeTextFont); + g2d.setColor(waterColor); + drawTextAroundCenter(g2d, -0.6d, alternativeICED); + g2d.setColor(teaColor); + drawTextAroundCenter(g2d, -0.6d, alternativeTtea); + g2d.setColor(pluginColor); + String s = getAlternativeProductName(); + int sub = animationsPosition / greyTextIncrment; + sub = sub % s.length(); + if (!master.isAnimationRunning()) { + sub = s.length(); + } + drawTextAroundCenter(g2d, 0.3d, s.substring(0, sub)); + } + //enabling end + + private int scaleAvarage(double origValue) { + return (int) (avarageRatio() * origValue); + } + + private int scaleMax(double origValue) { + return (int) (maxRatio() * origValue); + } + + private int scaleMin(double origValue) { + return (int) (minRatio() * origValue); + } + + private double avarageRatio() { + return (getRatioX() + getRatioY()) / 2d; + } + + private double minRatio() { + return Math.min(getRatioX(), getRatioY()); + } + + private double maxRatio() { + return Math.max(getRatioX(), getRatioY()); + } + + private int scaleY(double origValue) { + return (int) scaleY(master.getSplashHeight(), origValue); + } + + private int scaleX(double origValue) { + return (int) scaleX(master.getSplashWidth(), origValue); + } + + private double getRatioY() { + return getRatio(DefaultSplashScreen2012.ORIGINAL_H, master.getSplashHeight()); + } + + private double getRatioX() { + return getRatio(DefaultSplashScreen2012.ORIGINAL_W, master.getSplashWidth()); + } + + private static double scaleY(double currentSize, double origValue) { + return scale(DefaultSplashScreen2012.ORIGINAL_H, currentSize, origValue); + } + + private static double scaleX(double currentSize, double origValue) { + return scale(DefaultSplashScreen2012.ORIGINAL_W, currentSize, origValue); + } + + private static double getRatioY(double currentSize) { + return getRatio(DefaultSplashScreen2012.ORIGINAL_H, currentSize); + } + + private static double getRatioX(double currentSize) { + return getRatio(DefaultSplashScreen2012.ORIGINAL_W, currentSize); + } + + public static double scale(double origSize, double currentSize, double origValue) { + return getRatio(origSize, currentSize) * origValue; + } + + public static double getRatio(double origSize, double currentSize) { + return (currentSize / origSize); + } + //size is considered from 0-origsize as 0-1. + + //scaling end + public BasePainter(BasicComponentSplashScreen master) { + this(master, false); + } + + public BasePainter(BasicComponentSplashScreen master, boolean startAnimation) { + //to have this in inner classes + this.master = master; + setColors(); + adjustForSize(master.getSplashWidth(), master.getSplashHeight()); + if (startAnimation) { + startAnimationThreads(); + } + + } + + public void increaseAnimationPosition() { + animationsPosition += greyTextIncrment; + } + + protected void ensurePrerenderedStuff() { + if (this.prerenderedStuff == null) { + this.prerenderedStuff = prerenderStill(); + } + } + + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + ensurePrerenderedStuff(); + if (prerenderedStuff != null) { + g2d.drawImage(prerenderedStuff, 0, 0, null); + } + + if (showNiceTexts) { + paintNiceTexts(g2d); + } else { + paintPlainTexts(g2d); + } + + + + } + + public final void adjustForSize(int width, int height) { + prepareFonts(width, height); + //enablings depends on fonts + setEnablings(width, height, master.getVersion(), master.getInformationElement(), (Graphics2D) (master.getGraphics())); + prerenderedStuff = prerenderStill(); + } + + private void setEnablings(int w, int h, String version, InformationElement ic, Graphics2D g2d) { + showLeaf = true; + if (w > 0 && h > 0) { + //leaf stretch much better to wide then to high + if (h / w > 2 || w / h > 6) { + showLeaf = false; + } + } + showInfo = true; + if (version != null && g2d != null && ic != null && ic.getHeader() != null && ic.getHeader().size() > 0) { + String s = ic.getHeader().get(0); + FontMetrics fm = g2d.getFontMetrics(plainTextsFont); + int versionLength = fm.stringWidth(version); + int firsDescLineLengthg = fm.stringWidth(s); + if (firsDescLineLengthg > w - versionLength - 10) { + showInfo = false; + } + } + if (Math.min(h, w) < ScreenFinder.getCurrentScreenSizeWithoutBounds().getHeight() / 10) { + showNiceTexts = false; + } else { + showNiceTexts = true; + } + } + + public final void startAnimationThreads() { + Thread tt = getMovingTextThread(); + tt.start(); + Thread t = getWaterLevelThread(); + t.start(); + } + + private void prepareFonts(int w, int h) { + master.setSplashHeight(h); + master.setSplashWidth(w); + Map teaFontAttributes = new HashMap(); + teaFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(84))); + teaFontAttributes.put(TextAttribute.WIDTH, new Double((0.95))); + teaFontAttributes.put(TextAttribute.FAMILY, "Serif"); + teaFont = new Font(teaFontAttributes); + Map icedFontAttributes = new HashMap(); + icedFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(82))); + icedFontAttributes.put(TextAttribute.WIDTH, new Double((0.80))); + icedFontAttributes.put(TextAttribute.FAMILY, "Serif"); + icedFont = new Font(icedFontAttributes); + Map webFontAttributes = new HashMap(); + webFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(41))); + webFontAttributes.put(TextAttribute.WIDTH, new Double((2))); + webFontAttributes.put(TextAttribute.FAMILY, "Serif"); + webFont = new Font(webFontAttributes); + Map pluginFontAttributes = new HashMap(); + pluginFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(32))); + pluginFontAttributes.put(TextAttribute.WEIGHT, new Double((5d))); + pluginFontAttributes.put(TextAttribute.WIDTH, new Double((0.9))); + pluginFontAttributes.put(TextAttribute.FAMILY, "Serif"); + pluginFont = new Font(pluginFontAttributes); + Map plainFontAttributes = new HashMap(); + plainFontAttributes.put(TextAttribute.SIZE, new Integer(12)); + plainFontAttributes.put(TextAttribute.FAMILY, "Monospaced"); + plainTextsFont = new Font(plainFontAttributes); + Map alternativeTextFontAttributes = new HashMap(); + alternativeTextFontAttributes.put(TextAttribute.SIZE, Math.min(w, h) / 5); + alternativeTextFontAttributes.put(TextAttribute.WIDTH, new Double((0.7))); + alternativeTextFontAttributes.put(TextAttribute.FAMILY, "Monospaced"); + alternativeTextFont = new Font(alternativeTextFontAttributes); + + } + + private void setColors() { + + teaColor = TEA_LIVE_COLOR; + backgroundColor = BACKGROUND_LIVE_COLOR; + teaLeafsStalksColor = TEA_LEAFS_STALKS_LIVE_COLOR; + pluginColor = PLUGIN_LIVE_COLOR; + waterColor = WATER_LIVE_COLOR; + plainTextColor = PLAIN_TEXT_LIVE_COLOR; + + } + + protected BufferedImage prerenderStill() { + if (master.getSplashWidth() <= 0 || master.getSplashHeight() <= 0) { + return null; + } + BufferedImage bi = new BufferedImage(master.getSplashWidth(), master.getSplashHeight(), BufferedImage.TYPE_INT_ARGB); + paintStillTo(bi.createGraphics(), master.getInformationElement(), master.getVersion()); + return bi; + } + + protected void paintStillTo(Graphics2D g2d, InformationElement ic, String version) { + RenderingHints r = g2d.getRenderingHints(); + drawBase(g2d, ic, version); + g2d.setRenderingHints(r); + } + + protected void drawTextAroundCenter(Graphics2D g2d, double heightOffset, String msg) { + + int y = (master.getSplashHeight() / 2) + (g2d.getFontMetrics().getHeight() / 2 + (int) (heightOffset * g2d.getFontMetrics().getHeight())); + int x = (master.getSplashWidth() / 2) - (g2d.getFontMetrics().stringWidth(msg) / 2); + g2d.drawString(msg, x, y); + } + + private Thread getMovingTextThread() { + Thread tt = new Thread(new MovingTextRunner(this)); + //tt.setDaemon(true); + return tt; + } + + static String stripCommitFromVersion(String version) { + if (version.contains("pre+")) { + return version; + } + int i = version.indexOf("+"); + if (i < 0) { + return version; + } + return version.substring(0, version.indexOf("+")); + } + + private final class MovingTextRunner extends Observable implements Runnable { + + private static final int MAX_ANIMATION_VALUE = 10000; + private static final int ANIMATION_RESTART_VALUE = 1; + private static final long MOOVING_TEXT_DELAY = 150; + + public MovingTextRunner(Observer o) { + this.addObserver(o); + } + + @Override + public void run() { + while (master.isAnimationRunning()) { + try { + animationsPosition += greyTextIncrment; + if (animationsPosition > MAX_ANIMATION_VALUE) { + animationsPosition = ANIMATION_RESTART_VALUE; + } + this.setChanged(); + this.notifyObservers(); + Thread.sleep(MOOVING_TEXT_DELAY); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + }; + + private Thread getWaterLevelThread() { + Thread t = new Thread(new WaterLevelThread(this)); + //t.setDaemon(true); + return t; + } + + private final class WaterLevelThread extends Observable implements Runnable { + + private static final int MAX_WATERLEVEL_VALUE = 120; + private static final int WATER_LEVEL_INCREMENT = 2; + + private WaterLevelThread(BasePainter o) { + this.addObserver(o); + } + + @Override + public void run() { + while (master.isAnimationRunning()) { + if (waterLevel > MAX_WATERLEVEL_VALUE) { + break; + } + try { + waterLevel += WATER_LEVEL_INCREMENT; + this.setChanged(); + this.notifyObservers(); + //it is risinfg slower and slower + Thread.sleep((waterLevel / 4) * 30); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + }; + + private String getAlternativeProductName() { + if (SplashReason.JAVAWS.equals(master.getSplashReason())) { + return alternativeWeb; + } else if (SplashReason.APPLET.equals(master.getSplashReason())) { + return alternativeWeb + alternativePlugin; + } else { + return "...."; + } + } + + protected FontMetrics drawBase(Graphics2D g2d, InformationElement ic, String version) { + g2d.setColor(backgroundColor); + g2d.fillRect(0, 0, master.getSplashWidth() + 5, master.getSplashHeight() + 5); + if (showNiceTexts) { + //g2d.drawImage(tmpBackround, 0, 0, null); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); + g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g2d.setFont(teaFont); + g2d.setColor(teaColor); + g2d.drawString(tea, scaleX(42) + g2d.getFontMetrics(icedFont).stringWidth(ICED), scaleY(278)); + g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); + if (showLeaf) { + g2d.fillPolygon(SplinesDefs.getMainLeafCurve(getRatioX(), getRatioY())); + } + if (showLeaf) { + g2d.fillPolygon(SplinesDefs.getSecondLeafCurve(getRatioX(), getRatioY())); + } + g2d.setColor(teaLeafsStalksColor); + if (showLeaf) { + g2d.fillPolygon(SplinesDefs.getMainLeafStalkCurve(getRatioX(), getRatioY())); + } + if (showLeaf) { + g2d.fillPolygon(SplinesDefs.getSecondLeafStalkCurve(getRatioX(), getRatioY())); + } + g2d.setFont(pluginFont); + g2d.setColor(pluginColor); + if (SplashReason.APPLET.equals(master.getSplashReason())) { + if (showLeaf) { + g2d.drawString(plugin, scaleX(404), scaleY(145)); + } else { + FontMetrics wfm = g2d.getFontMetrics(webFont); + g2d.drawString(plugin, wfm.stringWidth(web) + scaleX(WEB_LEFT_ALIGMENT) + 10, scaleY(WEB_TOP_ALIGMENT)); + } + } + g2d.setFont(plainTextsFont); + g2d.setColor(plainTextColor); + FontMetrics fm = g2d.getFontMetrics(); + if (ic != null) { + InfoItem des = ic.getBestMatchingDescriptionForSplash(); + List head = ic.getHeader(); + if (head != null && showInfo) { + for (int i = 0; i < head.size(); i++) { + String string = head.get(i); + g2d.drawString(string, 5, (i + 1) * fm.getHeight()); + } + } + if (des != null && des.getValue() != null) { + g2d.drawString(des.getValue(), 5, master.getSplashHeight() - fm.getHeight()); + } + } + } + g2d.setFont(plainTextsFont); + g2d.setColor(plainTextColor); + FontMetrics fm = g2d.getFontMetrics(); + if (version != null) { + String niceVersion=stripCommitFromVersion(version); + int y = master.getSplashWidth() - fm.stringWidth(niceVersion + " "); + if (y < 0) { + y = 0; + } + g2d.drawString(niceVersion, y, fm.getHeight()); + } + return fm; + } + + public int getWaterLevel() { + return waterLevel; + } + + public void setWaterLevel(int level) { + this.waterLevel = level; + } + + public int getAnimationsPosition() { + return animationsPosition; + } + + public void clearCachedWaterTextImage() { + oldTwl = null; + } + + @Override + public void update(Observable o, Object arg) { + try { + SwingUtilities.invokeAndWait(new Runnable() { + + @Override + public void run() { + master.repaint(); + } + }); + } catch (Exception ex) { + ex.printStackTrace(); + } + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java 2013-05-03 19:08:24.334519064 +0000 @@ -0,0 +1,190 @@ +/* ControlCurve.java +Copyright (C) 2012 Tim Lambert, Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +/** This class represents a curve defined by a sequence of control points */ + +/* + * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/) + * which does not have a license. The author (Tim Lambert) has agreed to + * license this under GPL+Classpath by email + * + */ +import java.awt.*; + +public class ControlCurve { + + protected Polygon pts; + protected Polygon result; + protected boolean withPoints = true; + protected int selection = -1; + + public ControlCurve() { + pts = new Polygon(); + } + + public ControlCurve(Polygon p) { + pts = p; + } + + public Polygon getSourcePolygon() { + return pts; + } + + public void setSourcePolygon(Polygon pts) { + this.pts = pts; + } + static Font f = new Font("Courier", Font.PLAIN, 12); + + /** + * to be overwriten + */ + public Polygon calcualteResult() { + return null; + } + + public void calcualteAndSaveResult() { + result = calcualteResult(); + } + + /** paint this curve into g.*/ + public void paint(Graphics g) { + if (isWithPoints()) { + FontMetrics fm = g.getFontMetrics(f); + g.setFont(f); + int h = fm.getAscent() / 2; + + for (int i = 0; i < pts.npoints; i++) { + String s = Integer.toString(i); + int w = fm.stringWidth(s) / 2; + g.drawString(Integer.toString(i), pts.xpoints[i] - w, pts.ypoints[i] + h); + } + } + } + static final int EPSILON = 36; /* square of distance for picking */ + + + /** return index of control point near to (x,y) or -1 if nothing near */ + public int selectPoint(int x, int y) { + int mind = Integer.MAX_VALUE; + selection = -1; + for (int i = 0; i < pts.npoints; i++) { + int d = sqr(pts.xpoints[i] - x) + sqr(pts.ypoints[i] - y); + if (d < mind && d < EPSILON) { + mind = d; + selection = i; + } + } + return selection; + } + + // square of an int + static int sqr(int x) { + return x * x; + } + + public Polygon getResult() { + return result; + } + + public void resetResult() { + this.result = null; + } + + /** add a control point, return index of new control point */ + public int addPoint(int x, int y) { + pts.addPoint(x, y); + resetResult(); + return selection = pts.npoints - 1; + } + + /** set selected control point */ + public void setPoint(int x, int y) { + setPoint(selection, x, y); + } + + /** set selected control point */ + public void setPoint(int index, int x, int y) { + if (index >= 0 && index < pts.npoints) { + pts.xpoints[index] = x; + pts.ypoints[index] = y; + resetResult(); + } + } + + /** remove selected control point */ + public void removePoint(int index) { + if (index >= 0 && index < pts.npoints) { + pts.npoints--; + for (int i = index; i < pts.npoints; i++) { + pts.xpoints[i] = pts.xpoints[i + 1]; + pts.ypoints[i] = pts.ypoints[i + 1]; + } + resetResult(); + } + } + + /** remove selected control point */ + public void removePoint() { + removePoint(selection); + } + + public boolean isWithPoints() { + return withPoints; + } + + public void setWithPoints(boolean withPoints) { + this.withPoints = withPoints; + } + + @Override + public String toString() { + StringBuilder r = new StringBuilder(); + for (int i = 0; i < pts.npoints; i++) { + r.append(" ").append(pts.xpoints[i]).append(" ").append(pts.ypoints[i]); + } + return r.toString(); + } + + /** + * for testing purposes + * @param selection + */ + void setSelection(int selection) { + this.selection = selection; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java 2013-05-03 19:08:24.334519064 +0000 @@ -0,0 +1,63 @@ +/* Cubic.java +Copyright (C) 2012 Tim Lambert, Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +/** this class represents a cubic polynomial */ + +/* + * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/) + * which does not have a license. The author (Tim Lambert) has agreed to + * license this under GPL+Classpath by email + * + */ +public class Cubic { + + float a, b, c, d; /* a + b*u + c*u^2 +d*u^3 */ + + + public Cubic(float a, float b, float c, float d) { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + } + + /** evaluate cubic */ + public float eval(float u) { + return (((d * u) + c) * u + b) * u + a; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java 2013-05-03 19:08:24.335519052 +0000 @@ -0,0 +1,260 @@ +/* ErrorPainter.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +import java.awt.Color; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.RenderingHints; +import java.util.Observable; + +import net.sourceforge.jnlp.runtime.Translator; +import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen; +import net.sourceforge.jnlp.splashscreen.parts.InformationElement; + +public final class ErrorPainter extends BasePainter { + + //colors + private static final Color TEA_DEAD_COLOR = Color.darkGray; + private static final Color BACKGROUND_DEAD_COLOR = Color.gray; + private static final Color TEA_LEAFS_STALKS_DEAD_COLOR = new Color(100, 100, 100); + private static final Color PLUGIN_DEAD_COLOR = Color.darkGray; + private static final Color WATER_DEAD_COLOR = Color.darkGray; + private static final Color PLAIN_TEXT_DEAD_COLOR = Color.white; + private static final String ERROR_MESSAGE_KEY = "SPLASHerror"; + private static final String ERROR_FLY_MESSAGE_KEY = "SPLASH_ERROR"; + private static final Color ERROR_FLY_COLOR = Color.red; + //for clicking ot error message + private Point errorCorner = null; + private boolean errorIsFlying = false; + private int errorFlyPercentage = 100; + + /** + * Interpolation is root ratior is r= (currentSize / origSize) + * then value to-from is interpolaed from to to from accroding to ratio + * + * @param origSize + * @param currentSize + * @param from + * @param to + * @return + */ + public static double interpol(double origSize, double currentSize, double from, double to) { + return getRatio(origSize, currentSize) * (to - from) + from; + } + + /** + * is interpolating one color to another based on ration current/orig + * Each (r,g,b,a) part of color is interpolated separately + * resturned is new color composed form new r,g,b,a + * @param origSize + * @param currentSize + * @param from + * @param to + * @return + */ + public static Color interpolateColor(double origSize, double currentSize, Color from, Color to) { + double r = interpol(origSize, currentSize, to.getRed(), from.getRed()); + double g = interpol(origSize, currentSize, to.getGreen(), from.getGreen()); + double b = interpol(origSize, currentSize, to.getBlue(), from.getBlue()); + double a = interpol(origSize, currentSize, to.getAlpha(), from.getAlpha()); + return new Color((int) r, (int) g, (int) b, (int) a); + } + //scaling end + + public ErrorPainter(BasicComponentSplashScreen master) { + this(master, false); + } + + public ErrorPainter(BasicComponentSplashScreen master, boolean startScream) { + super(master); + if (startScream) { + startErrorScream(); + } + + } + + public void startErrorScream() { + errorIsFlying = true; + getFlyingRedErrorTextThread().start(); + } + + @Override + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + ensurePrerenderedStuff(); + if (errorIsFlying) { + paintStillTo(g2d, master.getInformationElement(), master.getVersion()); + } else { + if (prerenderedStuff != null) { + g2d.drawImage(prerenderedStuff, 0, 0, null); + } + } + + if (super.showNiceTexts) { + paintNiceTexts(g2d); + } else { + paintPlainTexts(g2d); + } + + if (errorIsFlying) { + g2d.setClip(0, 0, master.getSplashWidth(), master.getSplashHeight()); + drawBigError(g2d); + } + + + } + + private void drawBigError(Graphics2D g2d) { + Font f = new Font("Serif", Font.PLAIN, (int) scale(100, errorFlyPercentage, master.getSplashHeight())); + g2d.setColor(ERROR_FLY_COLOR); + g2d.setFont(f); + drawTextAroundCenter(g2d, 0, geFlyingErrorMessage()); + } + + public Point getErrorCorner() { + return errorCorner; + } + + private void setColors() { + + teaColor = TEA_DEAD_COLOR; + backgroundColor = BACKGROUND_DEAD_COLOR; + teaLeafsStalksColor = TEA_LEAFS_STALKS_DEAD_COLOR; + pluginColor = PLUGIN_DEAD_COLOR; + waterColor = WATER_DEAD_COLOR; + + } + + private void interpolateColor(int origSize, int currentSize) { + teaColor = interpolateColor(origSize, currentSize, TEA_LIVE_COLOR, TEA_DEAD_COLOR); + backgroundColor = interpolateColor(origSize, currentSize, BACKGROUND_LIVE_COLOR, BACKGROUND_DEAD_COLOR); + teaLeafsStalksColor = interpolateColor(origSize, currentSize, TEA_LEAFS_STALKS_LIVE_COLOR, TEA_LEAFS_STALKS_DEAD_COLOR); + pluginColor = interpolateColor(origSize, currentSize, PLUGIN_LIVE_COLOR, PLUGIN_DEAD_COLOR); + waterColor = interpolateColor(origSize, currentSize, WATER_LIVE_COLOR, WATER_DEAD_COLOR); + plainTextColor = interpolateColor(origSize, currentSize, PLAIN_TEXT_LIVE_COLOR, PLAIN_TEXT_DEAD_COLOR); + } + + @Override + protected void paintStillTo(Graphics2D g2d, InformationElement ic, String version) { + RenderingHints r = g2d.getRenderingHints(); + FontMetrics fm = drawBase(g2d, ic, version); + drawError(g2d, ic, version, fm); + g2d.setRenderingHints(r); + } + + private String getErrorMessage() { + String localised = Translator.R(ERROR_MESSAGE_KEY); + //if (localised==null)return errorMessage; + return localised; + } + + private String geFlyingErrorMessage() { + String localised = Translator.R(ERROR_FLY_MESSAGE_KEY); + return localised; + } + + private Thread getFlyingRedErrorTextThread() { + // Create a new thread to draw big flying error in case of failure + Thread t = new Thread(new FlyingRedErrorTextRunner(this)); + //t.setDaemon(true); + return t; + } + + private final class FlyingRedErrorTextRunner extends Observable implements Runnable { + + private static final int FLYING_ERROR_PERCENTAGE_INCREMENT = -3; + private static final int FLYING_ERROR_PERCENTAGE_MINIMUM = 5; + private static final int FLYING_ERROR_PERCENTAGE_LOWER_BOUND = 80; + private static final int FLYING_ERROR_PERCENTAGE_UPPER_BOUND = 90; + private static final int FLYING_ERROR_DELAY = 75; + + private FlyingRedErrorTextRunner(ErrorPainter o) { + this.addObserver(o); + } + + @Override + public void run() { + try { + while (errorIsFlying) { + errorFlyPercentage += FLYING_ERROR_PERCENTAGE_INCREMENT; + interpolateColor(100, errorFlyPercentage); + if (errorFlyPercentage <= FLYING_ERROR_PERCENTAGE_MINIMUM) { + errorIsFlying = false; + setColors(); + prerenderedStuff = null; + } + this.setChanged(); + this.notifyObservers(); + Thread.sleep(FLYING_ERROR_DELAY); + if (errorFlyPercentage < FLYING_ERROR_PERCENTAGE_UPPER_BOUND + && errorFlyPercentage > FLYING_ERROR_PERCENTAGE_LOWER_BOUND) { + clearCachedWaterTextImage(); + canWave = false; + } + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + canWave = true; + errorIsFlying = false; + setColors(); + prerenderedStuff = null; + master.repaint(); + + } + } + }; + + private void drawError(Graphics2D g2d, InformationElement ic, String version, FontMetrics fm) { + int minh = fm.getHeight(); + int minw = fm.stringWidth(getErrorMessage()); + int space = 5; + g2d.setColor(backgroundColor); + errorCorner = new Point(master.getSplashWidth() - space * 4 - minw, master.getSplashHeight() - space * 4 - minh); + if (errorCorner.x < 0) { + errorCorner.x = 0; + } + g2d.fillRect(errorCorner.x, errorCorner.y, space * 4 + minw, space * 4 + minh); + g2d.setColor(plainTextColor); + g2d.drawRect(errorCorner.x + space, errorCorner.y + space, space * 2 + minw, space * 2 + minh); + g2d.drawString(getErrorMessage(), errorCorner.x + 2 * space, errorCorner.y + 5 * space); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java 2013-05-03 19:08:24.335519052 +0000 @@ -0,0 +1,77 @@ +/* MovingText.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +import java.awt.Color; +import java.awt.Font; +import java.awt.GradientPaint; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.image.BufferedImage; + +public class MovingText extends TextWithWaterLevel { + + public MovingText(String s, Font f) { + super(s, f); + + } + + @Override + public BufferedImage getBackground() { + Point p = getFutureSize(); + int w = p.x; + int h = p.y; + if (w <= 0 || h <= 0) { + return null; + } + BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); + Graphics2D g2d = bi.createGraphics(); + + Color e1 = Color.gray; + Color s1 = Color.white; + int level = getPercentageOfWater() % (2 * w); + GradientPaint gradient = new GradientPaint(level - w, h / 2, s1, level, h / 2, e1, true); + g2d.setPaint(gradient); + g2d.fillRect(100, 100, 200, 120); + + g2d.fillRect(0, 0, w, h); + + + + return bi; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java 2013-05-03 19:08:24.336519040 +0000 @@ -0,0 +1,107 @@ +/* NatCubicClosed.java +Copyright (C) 2012 Tim Lambert, Red Hat, Inc., + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +public class NatCubicClosed extends NatCubic { + + /* + * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/) + * which does not have a license. The author (Tim Lambert) has agreed to + * license this under GPL+Classpath by email + * + */ + /* + NatCubic calcualtion + calculates the closed natural cubic spline that interpolates + x[0], x[1], ... x[n] + The first segment is returned as + C[0].a + C[0].b*u + C[0].c*u^2 + C[0].d*u^3 0<=u <1 + the other segments are in C[1], C[2], ... C[n] */ + @Override + Cubic[] calcNaturalCubic(int n, int[] x) { + float[] w = new float[n + 1]; + float[] v = new float[n + 1]; + float[] y = new float[n + 1]; + float[] D = new float[n + 1]; + float z, F, G, H; + int k; + /* We solve the equation + [4 1 1] [D[0]] [3(x[1] - x[n]) ] + |1 4 1 | |D[1]| |3(x[2] - x[0]) | + | 1 4 1 | | . | = | . | + | ..... | | . | | . | + | 1 4 1| | . | |3(x[n] - x[n-2])| + [1 1 4] [D[n]] [3(x[0] - x[n-1])] + + by decomposing the matrix into upper triangular and lower matrices + and then back sustitution. See Spath "Spline Algorithms for Curves + and Surfaces" pp 19--21. The D[i] are the derivatives at the knots. + */ + w[1] = v[1] = z = 1.0f / 4.0f; + y[0] = z * 3 * (x[1] - x[n]); + H = 4; + F = 3 * (x[0] - x[n - 1]); + G = 1; + for (k = 1; k < n; k++) { + v[k + 1] = z = 1 / (4 - v[k]); + w[k + 1] = -z * w[k]; + y[k] = z * (3 * (x[k + 1] - x[k - 1]) - y[k - 1]); + H = H - G * w[k]; + F = F - G * y[k - 1]; + G = -v[k] * G; + } + H = H - (G + 1) * (v[n] + w[n]); + y[n] = F - (G + 1) * y[n - 1]; + + D[n] = y[n] / H; + D[n - 1] = y[n - 1] - (v[n] + w[n]) * D[n]; /* This equation is WRONG! in my copy of Spath */ + for (k = n - 2; k >= 0; k--) { + D[k] = y[k] - v[k + 1] * D[k + 1] - w[k + 1] * D[n]; + } + + + /* now compute the coefficients of the cubics */ + Cubic[] C = new Cubic[n + 1]; + for (k = 0; k < n; k++) { + C[k] = new Cubic((float) x[k], D[k], 3 * (x[k + 1] - x[k]) - 2 * D[k] - D[k + 1], + 2 * (x[k] - x[k + 1]) + D[k] + D[k + 1]); + } + C[n] = new Cubic((float) x[n], D[n], 3 * (x[0] - x[n]) - 2 * D[n] - D[0], + 2 * (x[n] - x[0]) + D[n] + D[0]); + return C; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java 2013-05-03 19:08:24.335519052 +0000 @@ -0,0 +1,127 @@ +/* NatCubic.java +Copyright (C) 2012 Tim Lambert, Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +import java.awt.*; + +public class NatCubic extends ControlCurve { + + /* + * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/) + * which does not have a license. The author (Tim Lambert) has agreed to + * license this under GPL+Classpath by email + * + */ + /* + NatCubic calcualtion + calculates the natural cubic spline that interpolates + y[0], y[1], ... y[n] + The first segment is returned as + C[0].a + C[0].b*u + C[0].c*u^2 + C[0].d*u^3 0<=u <1 + the other segments are in C[1], C[2], ... C[n-1] */ + Cubic[] calcNaturalCubic(int n, int[] x) { + float[] gamma = new float[n + 1]; + float[] delta = new float[n + 1]; + float[] D = new float[n + 1]; + int i; + /* We solve the equation + [2 1 ] [D[0]] [3(x[1] - x[0]) ] + |1 4 1 | |D[1]| |3(x[2] - x[0]) | + | 1 4 1 | | . | = | . | + | ..... | | . | | . | + | 1 4 1| | . | |3(x[n] - x[n-2])| + [ 1 2] [D[n]] [3(x[n] - x[n-1])] + + by using row operations to convert the matrix to upper triangular + and then back sustitution. The D[i] are the derivatives at the knots. + */ + + gamma[0] = 1.0f / 2.0f; + for (i = 1; i < n; i++) { + gamma[i] = 1 / (4 - gamma[i - 1]); + } + gamma[n] = 1 / (2 - gamma[n - 1]); + + delta[0] = 3 * (x[1] - x[0]) * gamma[0]; + for (i = 1; i < n; i++) { + delta[i] = (3 * (x[i + 1] - x[i - 1]) - delta[i - 1]) * gamma[i]; + } + delta[n] = (3 * (x[n] - x[n - 1]) - delta[n - 1]) * gamma[n]; + + D[n] = delta[n]; + for (i = n - 1; i >= 0; i--) { + D[i] = delta[i] - gamma[i] * D[i + 1]; + } + + /* now compute the coefficients of the cubics */ + Cubic[] C = new Cubic[n]; + for (i = 0; i < n; i++) { + C[i] = new Cubic((float) x[i], D[i], 3 * (x[i + 1] - x[i]) - 2 * D[i] - D[i + 1], + 2 * (x[i] - x[i + 1]) + D[i] + D[i + 1]); + } + return C; + } + final int STEPS = 12; + + /* draw a cubic spline */ + @Override + public void paint(Graphics g) { + super.paint(g); + if (pts.npoints >= 2) { + if (getResult() == null) { + calcualteAndSaveResult(); + } + g.drawPolyline(result.xpoints, result.ypoints, result.npoints); + } + } + + @Override + public Polygon calcualteResult() { + Cubic[] X = calcNaturalCubic(pts.npoints - 1, pts.xpoints); + Cubic[] Y = calcNaturalCubic(pts.npoints - 1, pts.ypoints); + /* very crude technique - just break each segment up into steps lines */ + Polygon p = new Polygon(); + p.addPoint((int) Math.round(X[0].eval(0)), (int) Math.round(Y[0].eval(0))); + for (int i = 0; i < X.length; i++) { + for (int j = 1; j <= STEPS; j++) { + float u = j / (float) STEPS; + p.addPoint(Math.round(X[i].eval(u)), Math.round(Y[i].eval(u))); + } + } + return p; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.java 2013-05-03 19:08:24.336519040 +0000 @@ -0,0 +1,198 @@ +/* SplinesDefs.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +import java.awt.Point; +import java.awt.Polygon; + +public class SplinesDefs { + + private final static Point[] mainLeafArray = { + new Point(268, 307), + new Point(274, 326), + new Point(289, 337), + new Point(317, 349), + new Point(362, 350), + new Point(413, 334), + new Point(428, 326), + new Point(453, 309), + new Point(469, 292), + new Point(496, 264), + new Point(516, 236), + new Point(531, 215), + new Point(550, 185), + new Point(567, 155), + new Point(580, 130), + new Point(571, 139), + new Point(555, 148), + new Point(540, 157), + new Point(521, 167), + new Point(502, 174), + new Point(477, 183), + new Point(443, 193), + new Point(413, 201), + new Point(392, 209), + new Point(376, 218), + new Point(363, 228), + new Point(356, 250), + new Point(372, 231), + new Point(398, 218), + new Point(420, 209), + new Point(446, 200), + new Point(479, 192), + new Point(505, 182), + new Point(547, 168), + new Point(539, 182), + new Point(526, 204), + new Point(509, 227), + new Point(498, 244), + new Point(486, 257), + new Point(469, 272), + new Point(460, 281), + new Point(449, 293), + new Point(436, 303), + new Point(418, 315), + new Point(400, 323), + new Point(383, 332), + new Point(367, 334), + new Point(343, 338), + new Point(322, 335), + new Point(304, 330), + new Point(288, 322) + }; + private final static Point[] mainLeafStalkArray = { + new Point(353, 287), + new Point(366, 295), + new Point(376, 291), + new Point(392, 283), + new Point(428, 251), + new Point(441, 233), + new Point(462, 217), + new Point(446, 225), + new Point(434, 236), + new Point(428, 242), + new Point(408, 261), + new Point(392, 275), + new Point(373, 284), + new Point(363, 289) + }; + private final static Point[] smallLeafArray = { + new Point(342, 207), + new Point(352, 213), + new Point(360, 218), + new Point(374, 217), + new Point(389, 202), + new Point(397, 175), + new Point(396, 143), + new Point(397, 113), + new Point(380, 127), + new Point(350, 145), + new Point(327, 155), + new Point(313, 166), + new Point(297, 182), + new Point(293, 196), + new Point(308, 183), + new Point(332, 167), + new Point(364, 150), + new Point(385, 137), + new Point(384, 158), + new Point(382, 187), + new Point(371, 204) + }; + private final static Point[] smallLeafStalkArray = { + new Point(320, 203), + new Point(331, 191), + new Point(345, 185), + new Point(356, 183), + new Point(365, 177), + new Point(368, 171), + new Point(368, 165), + new Point(360, 173), + new Point(354, 176), + new Point(341, 180), + new Point(334, 184), + new Point(321, 194) + }; + + public static Polygon getMainLeaf(Double scalex, double scaley) { + + return polygonizeControlPoints(mainLeafArray, scalex, scaley); + } + + static Polygon polygonizeControlPoints(Point[] pp, Double scalex, double scaley) { + Polygon r = new Polygon(); + for (int i = 0; i < pp.length; i++) { + Point p = pp[i]; + r.addPoint((int) ((double) p.x * (double) scalex), (int) ((double) p.y * (double) scaley)); + } + return r; + } + + public static Polygon getSecondLeaf(Double scalex, double scaley) { + return polygonizeControlPoints(smallLeafArray, scalex, scaley); + } + + public static Polygon getSecondLeafStalk(Double scalex, double scaley) { + return polygonizeControlPoints(smallLeafStalkArray, scalex, scaley); + } + + public static Polygon getMainLeafStalk(Double scalex, double scaley) { + return polygonizeControlPoints(mainLeafStalkArray, scalex, scaley); + } + + public static Polygon getMainLeafCurve(Double scalex, double scaley) { + return getNatCubicClosed(getMainLeaf(scalex, scaley)); + } + + public static Polygon getMainLeafStalkCurve(Double scalex, double scaley) { + return getNatCubicClosed(getMainLeafStalk(scalex, scaley)); + } + + public static Polygon getSecondLeafCurve(Double scalex, double scaley) { + return getNatCubicClosed(getSecondLeaf(scalex, scaley)); + } + + public static Polygon getSecondLeafStalkCurve(Double scalex, double scaley) { + return getNatCubicClosed(getSecondLeafStalk(scalex, scaley)); + } + + static Polygon getNatCubicClosed(Polygon p) { + NatCubicClosed c = new NatCubicClosed(); + c.setSourcePolygon(p); + return c.calcualteResult(); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java 2013-05-03 19:08:24.336519041 +0000 @@ -0,0 +1,152 @@ +/* TextOutlineRenderer.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.font.FontRenderContext; +import java.awt.font.TextLayout; +import java.awt.geom.AffineTransform; + +public class TextOutlineRenderer { + + private Image img; + private Font font; + private Color outlineColor; + private final String text; + + public TextOutlineRenderer(Font f, String s) { + this.font = f; + outlineColor = Color.black; + this.text = s; + + } + + public TextOutlineRenderer(Font f, String s, Color textOutline) { + this(f, s); + this.outlineColor = textOutline; + } + + public int getWidth() { + if (img == null) { + return -1; + } + return img.getWidth(null); + } + + public int getHeight() { + if (img == null) { + return -1; + } + return img.getHeight(null); + } + + public void cutTo(Graphics2D g2, int x, int y) { + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + + g2.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + + FontRenderContext frc = g2.getFontRenderContext(); + TextLayout tl = new TextLayout(getText(), getFont(), frc); + float sw = (float) tl.getBounds().getWidth(); + AffineTransform transform = new AffineTransform(); + transform.setToTranslation(x, y); + Shape shape = tl.getOutline(transform); + Rectangle r = shape.getBounds(); + g2.setColor(getTextOutline()); + g2.draw(shape); + g2.setClip(shape); + g2.drawImage(getImg(), r.x, r.y, r.width, r.height, null); + + } + + /** + * @return the img + */ + public Image getImg() { + return img; + } + + /** + * @param img the img to set + */ + public void setImg(Image img) { + this.img = img; + } + + /** + * @return the font + */ + public Font getFont() { + return font; + } + + /** + * @param font the font to set + */ + public void setFont(Font font) { + this.font = font; + } + + /** + * @return the color of outline + */ + public Color getTextOutline() { + return outlineColor; + } + + /** + * @param outlineColor the color of outline + */ + public void setTextOutline(Color textOutline) { + this.outlineColor = textOutline; + } + + /** + * @return the text + */ + public String getText() { + return text; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java 2013-05-03 19:08:24.336519041 +0000 @@ -0,0 +1,179 @@ +/* TextWithWaterLevel.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; + +import java.awt.Polygon; +import java.awt.Color; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.util.Random; + +public class TextWithWaterLevel extends TextOutlineRenderer { + + private Color waterColor; + private Color bgColor; + private int percentageOfWater; + private Random sea = new Random(); + //set to null befor getBackground if waving is needed + //or create new TWL ;) + private Polygon cachedPolygon; + + public TextWithWaterLevel(String s, Font f) { + super(f, s); + waterColor = Color.BLUE; + bgColor = Color.white; + + } + + protected Point getFutureSize() { + BufferedImage bi = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB); + FontMetrics fm = bi.createGraphics().getFontMetrics(getFont()); + int w = fm.stringWidth(getText()); + int h = fm.getHeight(); + return new Point(w, h); + } + + public BufferedImage getBackground() { + Point p = getFutureSize(); + int w = p.x; + int h = p.y; + if (w <= 0 || h <= 0) { + return null; + } + BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); + Graphics2D g2d = bi.createGraphics(); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.setColor(bgColor); + g2d.fillRect(0, 0, w, h); + if (cachedPolygon == null) { + int level = (h * percentageOfWater) / 100; + int waveHeight = 10; + int waveLength = 20; + if (level > waveHeight / 2 + 1) { + NatCubic line = new NatCubic(); + int x = 0; + while (x < w + 2 * waveLength) { + line.addPoint(x, h - level - waveHeight / 2 - sea.nextInt(waveHeight)); + x = x + waveLength; + } + cachedPolygon = line.calcualteResult(); + cachedPolygon.addPoint(w, h); + cachedPolygon.addPoint(0, h); + } + } + g2d.setColor(waterColor); + if (cachedPolygon != null) { + g2d.fillPolygon(cachedPolygon); + } + //line.paint(g2d); + //FlodFill.floodFill(bi, waterColor, new Point(1, h - 1)); + return bi; + } + + public Polygon getCachedPolygon() { + return cachedPolygon; + } + + public void setCachedPolygon(Polygon cachedPolygon) { + this.cachedPolygon = cachedPolygon; + } + + @Override + public void cutTo(Graphics2D g2, int x, int y) { + if (this.getImg() == null) { + this.setImg(getBackground()); + } + if (this.getImg() == null) { + return; + } + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2.setFont(getFont()); + g2.setColor(getTextOutline()); + g2.drawString(getText(), x, y - 2); + g2.drawString(getText(), x, y + 2); + g2.drawString(getText(), x - 2, y); + g2.drawString(getText(), x + 2, y); + //sorry, cuted text have disturbed borders + super.cutTo(g2, x, y); + } + + /** + * @return the waterColor + */ + public Color getWaterColor() { + return waterColor; + } + + /** + * @param waterColor the waterColor to set + */ + public void setWaterColor(Color waterColor) { + this.waterColor = waterColor; + } + + /** + * @return the bgColor + */ + public Color getBgColor() { + return bgColor; + } + + /** + * @param bgColor the bgColor to set + */ + public void setBgColor(Color bgColor) { + this.bgColor = bgColor; + } + + /** + * @return the percentageOfWater + */ + public int getPercentageOfWater() { + return percentageOfWater; + } + + /** + * @param percentageOfWater the percentageOfWater to set + */ + public void setPercentageOfWater(int percentageOfWater) { + this.percentageOfWater = percentageOfWater; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java 2013-05-03 19:08:24.327519153 +0000 @@ -0,0 +1,105 @@ +/* DefaultSplashScreen12.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls; + +import java.awt.Graphics; + + +import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; +import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter; +import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen; + +public final class DefaultSplashScreen2012 extends BasicComponentSplashScreen { + + private final DefaultSplashScreen2012 self; + private final BasePainter painter; + private final DefaultSplashScreens2012Commons commons; + + public DefaultSplashScreen2012(int width, int height, SplashReason splashReason) { + //setting width and height now is causing unnecessary blinking + //setSplashHeight(height); + //setSplashWidth(width); + //to have this in inner classes + self = this; + setSplashReason(splashReason); + painter = new BasePainter(this); + commons = new DefaultSplashScreens2012Commons(painter, self); + } + + @Override + public void paintComponent(Graphics g) { + paintTo(g); + } + + @Override + public void paintTo(Graphics g) { + commons.paintTo(g); + + + } + + @Override + public void adjustForSize() { + commons.adjustForSize(); + } + + @Override + public void stopAnimation() { + commons.stopAnimation(); + } + + /** + * Methods to start the animation in the splash panel. + * + * This method exits after starting a new thread to do the animation. It + * is synchronized to prevent multiple startAnimation threads from being created. + */ + @Override + public void startAnimation() { + commons.startAnimation(); + } + + @Override + public void setPercentage(int done) { + commons.setPercentage(done); + } + + @Override + public int getPercentage() { + return commons.getPercentage(); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java 2013-05-03 19:08:24.328519141 +0000 @@ -0,0 +1,119 @@ +/* DefaultSplashScreensCommons2012.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.impls; + +import java.awt.Graphics; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.Observable; + +import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter; +import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen; + +public final class DefaultSplashScreens2012Commons { + + private final BasicComponentSplashScreen parent; + private final BasePainter painter; + + + public DefaultSplashScreens2012Commons(BasePainter painterr, BasicComponentSplashScreen parentt) { + this.painter = painterr; + this.parent = parentt; + parent.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + painter.increaseAnimationPosition(); + parent.repaint(); + } + }); + // Add a new listener for resizes + parent.addComponentListener(new ComponentAdapter() { + // Re-adjust variables based on size + + @Override + public void componentResized(ComponentEvent e) { + parent.setSplashWidth(parent.getWidth()); + parent.setSplashHeight(parent.getHeight()); + parent.adjustForSize(); + parent.repaint(); + } + }); + } + + public void paintTo(Graphics g) { + painter.paint(g); + + + } + + public void adjustForSize() { + painter.adjustForSize(parent.getSplashWidth(), parent.getSplashHeight()); + } + + public void stopAnimation() { + parent.setAnimationRunning(false); + } + + /** + * Methods to start the animation in the splash panel. + * + * This method exits after starting a new thread to do the animation. It + * is synchronized to prevent multiple startAnimation threads from being created. + */ + public synchronized void startAnimation() { + if (parent.isAnimationRunning()) { + return; + } + parent.setAnimationRunning(true); + painter.startAnimationThreads(); + + } + + public void setPercentage(int done) { + painter.clearCachedWaterTextImage(); + painter.setWaterLevel(done); + } + + public int getPercentage() { + return painter.getWaterLevel(); + } + + +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java 2013-05-03 19:08:24.336519041 +0000 @@ -0,0 +1,85 @@ +/* BasicComponentSplashScreen.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.parts; + +import net.sourceforge.jnlp.splashscreen.SplashErrorPanel; + +public abstract class BasicComponentErrorSplashScreen extends BasicComponentSplashScreen implements SplashErrorPanel { + + /** + * When applet loading fails, then dying stacktrace can be stted, and is then shown to user on demand. + */ + private Throwable loadingException; + + + /** + * @return the loadingException + */ + @Override + public Throwable getLoadingException() { + return loadingException; + } + + /** + * @param loadingException the loadingException to set + */ + @Override + public void setLoadingException(Throwable loadingException) { + this.loadingException = loadingException; + } + + + + protected void raiseExceptionDialogNOW() { + JEditorPaneBasedExceptionDialog dialog = new JEditorPaneBasedExceptionDialog(null, true, getLoadingException(), getInformationElement(), createAditionalInfo()); + dialog.setVisible(true); + } + + protected void raiseExceptionDialogQUEUED() { + java.awt.EventQueue.invokeLater(new Runnable() { + + @Override + public void run() { + raiseExceptionDialogNOW(); + } + }); + } + + protected void raiseExceptionDialog() { + raiseExceptionDialogQUEUED(); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java 2013-05-03 19:08:24.338519015 +0000 @@ -0,0 +1,156 @@ +/* BasicComponentSplashScreen.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.parts; + +import javax.swing.JComponent; +import net.sourceforge.jnlp.splashscreen.SplashPanel; +import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; + +public abstract class BasicComponentSplashScreen extends JComponent implements SplashPanel { + //scaling 100% + public static final double ORIGINAL_W = 635; + public static final double ORIGINAL_H = 480; + /** Width of the plugin window */ + protected int pluginWidth; + /** Height of the plugin window */ + protected int pluginHeight; + /** The project name to display */ + private SplashReason splashReason; + private boolean animationRunning = false; + private InformationElement content; + private String version; + + @Override + public JComponent getSplashComponent() { + return this; + } + + @Override + public boolean isAnimationRunning() { + return animationRunning; + } + + public void setAnimationRunning(boolean b){ + animationRunning=b; + } + + @Override + public void setInformationElement(InformationElement content) { + this.content = content; + } + + @Override + public InformationElement getInformationElement() { + return content; + } + + + /** + * @return the pluginWidth + */ + @Override + public int getSplashWidth() { + return pluginWidth; + } + + /** + * @param pluginWidth the pluginWidth to set + */ + @Override + public void setSplashWidth(int pluginWidth) { + this.pluginWidth = pluginWidth; + } + + /** + * @return the pluginHeight + */ + @Override + public int getSplashHeight() { + return pluginHeight; + } + + /** + * @param pluginHeight the pluginHeight to set + */ + @Override + public void setSplashHeight(int pluginHeight) { + this.pluginHeight = pluginHeight; + } + + /** + * @return the splashReason + */ + @Override + public SplashReason getSplashReason() { + return splashReason; + } + + /** + * @param splashReason the splashReason to set + */ + @Override + public void setSplashReason(SplashReason splashReason) { + this.splashReason = splashReason; + } + + /** + * @return the version + */ + @Override + public String getVersion() { + return version; + } + + /** + * @param version the version to set + */ + @Override + public void setVersion(String version) { + this.version = version; + } + + + protected String createAditionalInfo() { + if (getVersion() != null) { + return getSplashReason().toString() + " version: " + getVersion(); + } else { + return null; + } + } + + +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java 2013-05-03 19:08:24.339519002 +0000 @@ -0,0 +1,126 @@ +/* DescriptionInfoItem.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.parts; + +/** + *description element: A short statement about the application. Description + * elements are optional. The kind attribute defines how the description should + * be used. It can have one of the following values: + * + * * one-line: If a reference to the application is going to appear on one row + * in a list or a table, this description will be used. + * * short: If a reference to the application is going to be displayed in a + * situation where there is room for a paragraph, this description is used. + * * tooltip: If a reference to the application is going to appear in a + * tooltip, this description is used. + * + * Only one description element of each kind can be specified. A description + * element without a kind is used as a default value. Thus, if Java Web Start + * needs a description of kind short, and it is not specified in the JNLP file, + * then the text from the description without an attribute is used. + * + * All descriptions contain plain text. No formatting, such as with HTML tags, + * is supported. + */ +public class DescriptionInfoItem extends InfoItem { + + protected String kind; + + public DescriptionInfoItem(String value, String kind) { + super(InfoItem.description, value); + this.kind = kind; + } + + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public boolean isOfSameKind(DescriptionInfoItem o) { + if (o.getKind() == null && getKind() == null) { + return true; + } + if (o.getKind() == null && getKind() != null) { + return false; + } + if (o.getKind() != null && getKind() == null) { + return false; + } + return (o.getKind().equals(getKind())); + } + + public boolean isSame(DescriptionInfoItem o) { + return isOfSameKind(o) && isofSameType(o); + + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof DescriptionInfoItem)) { + return false; + } + DescriptionInfoItem o = (DescriptionInfoItem) obj; + return super.equals(o) && isOfSameKind(o); + + + } + + @Override + public int hashCode() { + int hash = 7; + hash = 59 * hash + (this.kind != null ? this.kind.hashCode() : 0); + hash = 59 * hash + (this.getType() != null ? this.getType().hashCode() : 0); + hash = 59 * hash + (this.getValue() != null ? this.getValue().hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return super.toString() + " (" + getKind() + ")"; + } + + + + @Override + public String toNiceString() { + return super.toNiceString(); + } + +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java 2013-05-03 19:08:24.339519002 +0000 @@ -0,0 +1,145 @@ +/* InfoItem.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.parts; + +import net.sourceforge.jnlp.InformationDesc; +import net.sourceforge.jnlp.runtime.Translator; + +/** + * The optional kind="splash" attribute may be used in an icon element to + * indicate that the image is to be used as a "splash" screen during the launch + * of an application. If the JNLP file does not contain an icon element with + * kind="splash" attribute, Java Web Start will construct a splash screen using + * other items from the information Element. + * If the JNLP file does not contain any icon images, the splash image will + * consist of the application's title and vendor, as taken from the JNLP file. + * + * items not used inside + */ +public class InfoItem { + + public static final String SPLASH = "SPLASH"; + public static final String title = "title"; + public static final String vendor = "vendor"; + public static final String homepage = "homepage"; + public static final String homepageHref = "href"; + public static final String description = "description"; + public static final String descriptionKind = "kind"; + public static final String descriptionKindOneLine = (String) InformationDesc.ONE_LINE; + //when no kind is specified, then it should behave as short + public static final String descriptionKindShort = (String) InformationDesc.SHORT; + public static final String descriptionKindToolTip = (String) InformationDesc.TOOLTIP; + protected String type; + protected String value; + + + public InfoItem(String type, String value) { + this.type = type; + this.value = value; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the value + */ + public String getValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(String value) { + this.value = value; + } + + public boolean isofSameType(InfoItem o) { + return ((getType().equals(o.getType()))); + + + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof InfoItem)) { + return false; + } + InfoItem o = (InfoItem) obj; + return isofSameType(o) && (getValue().equals(o.getValue())); + + + + } + + @Override + public String toString() { + return type + ": " + value; + } + + + + + public String toNiceString() { + String key = SPLASH + type; + return localise(key, value); + } + + public static String localise(String key, String s) { + return Translator.R(key) + ": " + s; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 59 * hash + (this.getType() != null ? this.getType().hashCode() : 0); + hash = 59 * hash + (this.getValue() != null ? this.getValue().hashCode() : 0); + return hash; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java 2013-05-03 19:08:24.340518989 +0000 @@ -0,0 +1,240 @@ +/* InformationElement.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +/** +http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html + */ +package net.sourceforge.jnlp.splashscreen.parts; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import net.sourceforge.jnlp.InformationDesc; +import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.runtime.Translator; + +/** + * This class is wrapper arround tag which should + * javaws provide from source jnlp file + */ +public class InformationElement { + + private InfoItem title; + private InfoItem vendor; + private InfoItem homepage; + private List descriptions = new ArrayList(5); + + public void setTitle(String title) { + if (title == null) { + return; + } + this.title = new InfoItem(InfoItem.title, title); + } + + public void setvendor(String vendor) { + if (vendor == null) { + return; + } + this.vendor = new InfoItem(InfoItem.vendor, vendor); + } + + public void setHomepage(String homepage) { + if (homepage == null) { + return; + } + this.homepage = new InfoItem(InfoItem.homepage, homepage); + } + + public void addDescription(String description) { + addDescription(description, null); + } + + /** + * Just one description of each kind (4 including null) are allowed in information element. + * This method should throw exception when trying to add second description of same kind + * But I do not consider it as good idea to force this behaviour for somesing like psalsh screen, + * so I jsut replace the previous one with new one. without any warning + */ + public void addDescription(String description, String kind) { + if (description == null) { + return; + } + DescriptionInfoItem d = new DescriptionInfoItem(description, kind); + for (DescriptionInfoItem descriptionInfoItem : descriptions) { + if (descriptionInfoItem.isOfSameKind(d)) { + descriptions.remove(descriptionInfoItem); + descriptions.add(d); + return; + } + } + descriptions.add(d); + + } + + public InfoItem getBestMatchingDescriptionForSplash() { + for (DescriptionInfoItem d : descriptions) { + if (InfoItem.descriptionKindOneLine.equals(d.getKind())) { + return d; + } + } + for (DescriptionInfoItem d : descriptions) { + if (d.getKind() == null) { + return d; + } + } + return null; + } + + public InfoItem getLongestDescriptionForSplash() { + for (DescriptionInfoItem d : descriptions) { + if (InfoItem.descriptionKindShort.equals(d.getKind())) { + return d; + } + } + for (DescriptionInfoItem d : descriptions) { + if (d.getKind() == null) { + return d; + } + } + for (DescriptionInfoItem d : descriptions) { + if (InfoItem.descriptionKindOneLine.equals(d.getKind())) { + return d; + } + } + for (DescriptionInfoItem d : descriptions) { + if (InfoItem.descriptionKindToolTip.equals(d.getKind())) { + return d; + } + } + return null; + } + + public String getTitle() { + if (title == null) { + return null; + } + return title.toNiceString(); + } + + public String getVendor() { + if (vendor == null) { + return null; + } + return vendor.toNiceString(); + } + + public String getHomepage() { + if (homepage == null) { + return null; + } + return homepage.toNiceString(); + } + + List getDescriptions() { + return Collections.unmodifiableList(descriptions); + } + + public String getDescription() { + InfoItem i = getBestMatchingDescriptionForSplash(); + if (i == null) { + return null; + } + return i.toNiceString(); + } + + public List getHeader() { + List r = new ArrayList(4); + String t = getTitle(); + String v = getVendor(); + String h = getHomepage(); + if (t != null) { + r.add(t); + } + if (v != null) { + r.add(v); + } + if (h != null) { + r.add(h); + } + + return r; + } + + public static InformationElement createFromJNLP(JNLPFile file) { + try { + if (file == null) { + String message = Translator.R(InfoItem.SPLASH + "errorInInformation"); + InformationElement ie = new InformationElement(); + ie.setHomepage(""); + ie.setTitle(message); + ie.setvendor(""); + ie.addDescription(message); + return ie; + } + if (file.getInformation() == null) { + String message = Translator.R(InfoItem.SPLASH + "missingInformation"); + InformationElement ie = new InformationElement(); + ie.setHomepage(""); + ie.setTitle(message); + ie.setvendor(""); + ie.addDescription(message); + return ie; + } + InformationElement ie = new InformationElement(); + String homePage = Translator.R(InfoItem.SPLASH + "defaultHomepage"); + if (file.getInformation().getHomepage() != null) { + homePage = file.getInformation().getHomepage().toString(); + } + ie.setHomepage(homePage); + ie.setTitle(file.getInformation().getTitle()); + ie.setvendor(file.getInformation().getVendor()); + ie.addDescription(file.getInformation().getDescriptionStrict((String) (InformationDesc.DEFAULT))); + ie.addDescription(file.getInformation().getDescriptionStrict(InfoItem.descriptionKindOneLine), InfoItem.descriptionKindOneLine); + ie.addDescription(file.getInformation().getDescriptionStrict(InfoItem.descriptionKindShort), InfoItem.descriptionKindShort); + ie.addDescription(file.getInformation().getDescriptionStrict(InfoItem.descriptionKindToolTip), InfoItem.descriptionKindToolTip); + return ie; + } catch (Exception ex) { + ex.printStackTrace(); + String message = Translator.R(InfoItem.SPLASH + "errorInInformation"); + InformationElement ie = new InformationElement(); + ie.setHomepage(""); + ie.setTitle(message); + ie.setvendor(""); + ie.addDescription(ex.getMessage()); + return ie; + } + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java 2013-05-03 19:08:24.341518977 +0000 @@ -0,0 +1,408 @@ +/* JeditorPaneBasedExceptionDialog.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen.parts; + +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.awt.event.WindowEvent; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.text.DateFormat; +import java.util.Date; +import java.util.List; +import javax.swing.BorderFactory; +import javax.swing.GroupLayout; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JEditorPane; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.LayoutStyle; +import javax.swing.SwingConstants; +import javax.swing.WindowConstants; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; +import net.sourceforge.jnlp.LaunchException; +import net.sourceforge.jnlp.runtime.Translator; + +public class JEditorPaneBasedExceptionDialog extends JDialog implements HyperlinkListener { + + // components + private JButton closeButton; + private JButton closeAndCopyButton; + private JButton homeButton; + private JEditorPane htmlErrorAndHelpPanel; + private JLabel exceptionLabel; + private JLabel iconLabel; + private JPanel mainPanel; + private JPanel topPanel; + private JPanel bottomPanel; + private JScrollPane htmlPaneScroller; + // End of components declaration + private final String message; + private final Throwable exception; + private final Date shown; + private final String anotherInfo; + + /** Creates new form JEditorPaneBasedExceptionDialog */ + public JEditorPaneBasedExceptionDialog(java.awt.Frame parent, boolean modal, Throwable ex, InformationElement information, String anotherInfo) { + super(parent, modal); + shown = new Date(); + initComponents(); + htmlErrorAndHelpPanel.setContentType("text/html"); + htmlErrorAndHelpPanel.setEditable(false); + this.anotherInfo=anotherInfo; + List l = infoElementToList(information); + this.message = getText(ex, l, anotherInfo, shown); + this.exception = ex; + if (exception == null) { + closeAndCopyButton.setVisible(false); + } + htmlErrorAndHelpPanel.setText(message); + //htmlPaneScroller.getVerticalScrollBar().setValue(1); + htmlErrorAndHelpPanel.setCaretPosition(0); + try { + Icon icon = new ImageIcon(this.getClass().getResource("/net/sourceforge/jnlp/resources/warning.png")); + iconLabel.setIcon(icon); + } catch (Exception lex) { + lex.printStackTrace(); + } + htmlErrorAndHelpPanel.addHyperlinkListener(this); + homeButton.setVisible(false); + this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + + } + + static List infoElementToList(InformationElement information) { + List l = null; + if (information != null) { + l = information.getHeader(); + InfoItem ii = information.getLongestDescriptionForSplash(); + if (ii != null) { + l.add(ii.toNiceString()); + } + } + return l; + } + + private void initComponents() { + + topPanel = new JPanel(); + closeButton = new JButton(); + closeAndCopyButton = new JButton(); + mainPanel = new JPanel(); + exceptionLabel = new JLabel(); + iconLabel = new JLabel(); + bottomPanel = new JPanel(); + htmlPaneScroller = new JScrollPane(); + htmlErrorAndHelpPanel = new JEditorPane(); + homeButton = new JButton(); + + setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + + closeButton.setText(Translator.R(InfoItem.SPLASH + "Close")); + closeButton.addActionListener(new java.awt.event.ActionListener() { + + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + closeWindowButtonActionPerformed(evt); + } + }); + + closeAndCopyButton.setText(Translator.R(InfoItem.SPLASH + "closewAndCopyException")); + closeAndCopyButton.addActionListener(new java.awt.event.ActionListener() { + + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + copyAndCloseButtonActionPerformed(evt); + } + }); + + GroupLayout jPanel2Layout = new GroupLayout(topPanel); + topPanel.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addComponent(closeButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 314, Short.MAX_VALUE).addComponent(closeAndCopyButton).addContainerGap())); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addContainerGap(24, Short.MAX_VALUE).addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(closeButton).addComponent(closeAndCopyButton)).addContainerGap())); + + exceptionLabel.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N + exceptionLabel.setHorizontalAlignment(SwingConstants.CENTER); + exceptionLabel.setText(Translator.R(InfoItem.SPLASH + "exOccured")); + + bottomPanel.setBorder(BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + bottomPanel.setLayout(new java.awt.BorderLayout()); + + htmlPaneScroller.setViewportView(htmlErrorAndHelpPanel); + + bottomPanel.add(htmlPaneScroller, java.awt.BorderLayout.CENTER); + + homeButton.setText(Translator.R(InfoItem.SPLASH + "Home")); + homeButton.addActionListener(new java.awt.event.ActionListener() { + + @Override + public void actionPerformed(java.awt.event.ActionEvent evt) { + homeButtonActionPerformed(evt); + } + }); + + GroupLayout jPanel1Layout = new GroupLayout(mainPanel); + mainPanel.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, 71, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(exceptionLabel, GroupLayout.DEFAULT_SIZE, 503, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(homeButton, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE).addContainerGap()).addComponent(bottomPanel, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 723, Short.MAX_VALUE)); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE).addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(exceptionLabel, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE).addComponent(homeButton, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(bottomPanel, GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE))); + + GroupLayout layout = new GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(mainPanel, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(topPanel, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addContainerGap())); + layout.setVerticalGroup( + layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(mainPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(topPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addContainerGap())); + + pack(); + } + + private void copyAndCloseButtonActionPerformed(java.awt.event.ActionEvent evt) { + if (exception != null) { + try { + StringSelection data = new StringSelection(anotherInfo+"\n"+shown.toString()+"\n"+getExceptionStackTraceAsString(exception)+addPlainChain()); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(data, data); + } catch (Exception ex) { + JOptionPane.showMessageDialog(this, Translator.R(InfoItem.SPLASH + "cantCopyEx")); + ex.printStackTrace(); + } + } else { + JOptionPane.showMessageDialog(this, Translator.R(InfoItem.SPLASH + "noExRecorded")); + } + close(); + } + + private void homeButtonActionPerformed(java.awt.event.ActionEvent evt) { + htmlErrorAndHelpPanel.setText(message); + homeButton.setVisible(false); + } + + private void closeWindowButtonActionPerformed(java.awt.event.ActionEvent evt) { + close(); + } + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + + public void run() { + Exception ex = new RuntimeException("dsgsfdg"); + JEditorPaneBasedExceptionDialog dialog = new JEditorPaneBasedExceptionDialog(new JFrame(), true, ex, null, "uaaa: aaa\nwqdeweq:sdsds"); + dialog.addWindowListener(new java.awt.event.WindowAdapter() { + + public void windowClosing(java.awt.event.WindowEvent e) { + System.exit(0); + } + }); + dialog.setVisible(true); + } + }); + } + + static String getText(Throwable ex, List l, String anotherInfo,Date shown) { + StringBuilder s = new StringBuilder(""); + String info = "

    " + + Translator.R(InfoItem.SPLASH + "mainL1", createLink()) + + "

    \n"; + String t = "

    " + + Translator.R(InfoItem.SPLASH + "mainL3") + + "

    \n" + + info + formatListInfoList(l) + formatInfo(anotherInfo); + Object[] options = new String[2]; + options[0] = Translator.R(InfoItem.SPLASH + "Close"); + options[1] = Translator.R(InfoItem.SPLASH + "closeAndCopyShorter"); + if (ex != null) { + t = "

    " + + Translator.R(InfoItem.SPLASH + "mainL4") + + "

    \n" + + info + formatListInfoList(l) + formatInfo(anotherInfo) + +"
    "+DateFormat.getInstance().format(shown)+"
    " + + "

    " + + Translator.R(InfoItem.SPLASH + "exWas") + + "
    \n" + "

    " + getExceptionStackTraceAsString(ex) + "
    " + + addChain(); + + + } else { + t += formatListInfoList(l); + } + s.append(t); + s.append(""); + return s.toString(); + } + + public static String getExceptionStackTraceAsString(Throwable exception) { + if (exception == null) { + return ""; + } + StringWriter sw = new StringWriter(); + exception.printStackTrace(new PrintWriter(sw)); + return sw.toString(); + } + + public static String[] getExceptionStackTraceAsStrings(Throwable exception) { + if (exception == null) { + return new String[0]; + } + StringWriter sw = new StringWriter(); + exception.printStackTrace(new PrintWriter(sw)); + return sw.toString().split("\n"); + } + + @Override + public void hyperlinkUpdate(HyperlinkEvent event) { + if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { + try { + htmlErrorAndHelpPanel.setPage(event.getURL()); + homeButton.setVisible(true); + + } catch (Exception ioe) { + JOptionPane.showMessageDialog(this, Translator.R(InfoItem.SPLASH + "cfl") + " " + + event.getURL().toExternalForm() + ": " + ioe); + } + } + } + + private void close() { + processWindowEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING)); + } + + static String formatListInfoList(List l) { + if (l == null) { + return ""; + } + StringBuilder sb = new StringBuilder(); + sb.append("

    "); + sb.append("

    "). + append(Translator.R(InfoItem.SPLASH + "vendorsInfo")).append(":

    "); + sb.append("
    ");
    +        for (int i = 0; i < l.size(); i++) {
    +            String string = l.get(i);
    +            sb.append(string).append("\n");
    +        }
    +        sb.append("
    "); + sb.append("

    "); + return sb.toString(); + } + + static String formatInfo(String l) { + if (l == null) { + return ""; + } + StringBuilder sb = new StringBuilder(); + sb.append("

    "); + sb.append("

    "). + append(Translator.R(InfoItem.SPLASH + "anotherInfo")).append(":

    "); + sb.append("
    ");
    +        sb.append(l);
    +        sb.append("
    "); + sb.append("

    "); + return sb.toString(); + } + + Throwable getException() { + return exception; + } + + String getMessage() { + return message; + } + + private static String createLink() { + return "" + + Translator.R(InfoItem.SPLASH + "urlLooks") + ""; + } + + + private static String addChain() { + if (LaunchException.getLaunchExceptionChain().isEmpty()) { + return ""; + } + return Translator.R(InfoItem.SPLASH + "chainWas") + + "
    \n" + "
    " + getChainAsString(true) + "
    "; + + } + + private static String addPlainChain() { + if (LaunchException.getLaunchExceptionChain().isEmpty()) { + return ""; + } + return "\n Chain: \n" + getChainAsString(false); + + } + + private static String getChainAsString(boolean formatTime) { + return getChainAsString(LaunchException.getLaunchExceptionChain(), formatTime); + } + + private static String getChainAsString(List launchExceptionChain, boolean formatTime) { + String s = ""; + if (launchExceptionChain != null) { + for (int i = 0; i < launchExceptionChain.size(); i++) { + LaunchException.LaunchExceptionWithStamp launchException = launchExceptionChain.get(i); + s = s + (i+1) + ") at " + formatTime(launchException.getStamp(), formatTime) + "\n" + getExceptionStackTraceAsString(launchException.getEx()); + } + } + return s; + } + + private static String formatTime(Date dateTime, boolean formatTime) { + if (dateTime == null) { + return "unknown time"; + } + if (formatTime) { + return DateFormat.getInstance().format(dateTime); + } else { + return dateTime.toString(); + } + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/SplashController.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/SplashController.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/SplashController.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/SplashController.java 2013-05-03 19:08:24.325519178 +0000 @@ -0,0 +1,48 @@ +/* SplashController.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen; + +public interface SplashController { + + public void removeSplash(); + + public void replaceSplash(SplashPanel r); + + public int getSplashWidth(); + + public int getSplashHeigth(); +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java 2013-05-03 19:08:24.325519178 +0000 @@ -0,0 +1,47 @@ +/* SplashErrorPanel.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen; + +public interface SplashErrorPanel extends SplashPanel { + + /** + * When applet loading fails, then dying stacktrace can be set, and is then shown to user on demand. + */ + public Throwable getLoadingException(); + + public void setLoadingException(Throwable loadingException); +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java 2013-05-03 19:08:24.325519178 +0000 @@ -0,0 +1,115 @@ +/* SplashPanel.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen; + +import java.awt.Graphics; +import java.awt.event.ComponentListener; + +import javax.swing.JComponent; +import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; +import net.sourceforge.jnlp.splashscreen.parts.InformationElement; + +public interface SplashPanel { + + /** + * The plugin splashscreens must be placed into another containers, + * So must return themselves as JComponent. + * Mostly your SplashScreen will extend some JComponent, so this method will + * just return "this" + */ + public JComponent getSplashComponent(); + + + public void setInformationElement(InformationElement content); + + public InformationElement getInformationElement(); + + /** Width of the plugin window */ + public void setSplashWidth(int pluginWidth); + + /** Height of the plugin window */ + public void setSplashHeight(int pluginHeight); + + /** Width of the plugin window */ + public int getSplashWidth(); + + /** Height of the plugin window */ + public int getSplashHeight(); + + public void adjustForSize(); + + // Add a new listener for resizes + public void addComponentListener(ComponentListener cl); + + public boolean isAnimationRunning(); + + /** + * Methods to start the animation in the splash panel. + * + * This method exits after starting a new thread to do the animation. It + * is synchronized to prevent multiple startAnimation threads from being created. + */ + public void startAnimation(); + + public void stopAnimation(); + + void paintTo(Graphics g); + + public void setSplashReason(SplashReason splashReason); + + public SplashReason getSplashReason(); + + /** + * Version can be printed in splash window + * @param version + */ + public void setVersion(String version); + + String getVersion(); + + /** + * how mny percentage loaded is shown in progress bar (if any) + * @param done - should be in 0-100 inclusinve + */ + public void setPercentage(int done); + + /** + * returns state of loading progress bar + * @return percentage showed in possible progress bar - should be in 0-100 + */ + int getPercentage(); +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java 2013-05-03 19:08:24.327519153 +0000 @@ -0,0 +1,212 @@ +/* SplashUtils.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.splashscreen; + +import net.sourceforge.jnlp.runtime.AppletEnvironment; +import net.sourceforge.jnlp.runtime.AppletInstance; +import net.sourceforge.jnlp.runtime.Boot; +import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.splashscreen.impls.*; + +public class SplashUtils { + + static final String ICEDTEA_WEB_PLUGIN_SPLASH = "ICEDTEA_WEB_PLUGIN_SPLASH"; + static final String ICEDTEA_WEB_SPLASH = "ICEDTEA_WEB_SPLASH"; + static final String NONE = "none"; + static final String DEFAULT = "default"; + + + /** + * + * Indicator whether to show icedtea-web plugin or just icedtea-web + * For "just icedtea-web" will be done an attempt to show content of + * information element + * + */ + public static enum SplashReason { + + APPLET, JAVAWS; + + @Override + public String toString() { + switch (this) { + case APPLET: + return "IcedTea-Web Plugin"; + case JAVAWS: + return "IcedTea-Web"; + } + return "unknown"; + } + } + + public static void showErrorCaught(Throwable ex, AppletInstance appletInstance) { + try { + showError(ex, appletInstance); + } catch (Throwable t) { + if (JNLPRuntime.isDebug()) { + // prinitng this exception is discutable. I have let it in for case that + //some retyping will fail + t.printStackTrace(); + } + } + } + + public static void showError(Throwable ex, AppletInstance appletInstance) { + if (appletInstance == null) { + return; + } + AppletEnvironment ae = appletInstance.getAppletEnvironment(); + showError(ex, ae); + } + + public static void showError(Throwable ex, AppletEnvironment ae) { + if (ae == null) { + return; + } + SplashController p = ae.getSplashControler(); + showError(ex, p); + } + + public static void showError(Throwable ex, SplashController f) { + if (f == null) { + return; + } + + f.replaceSplash(getErrorSplashScreen(f.getSplashWidth(), f.getSplashHeigth(), ex)); + } + + + private static SplashReason getReason() { + if (JNLPRuntime.isWebstartApplication()){ + return SplashReason.JAVAWS; + }else{ + return SplashReason.APPLET; + } + + } + + + /** + * Warrning - splash should have recieve width and height without borders. + * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method + * @param width + * @param height + * @return + */ + public static SplashPanel getSplashScreen(int width, int height) { + return getSplashScreen(width, height, getReason()); + } + + /** + * Warrning - splash should have recieve width and height without borders. + * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method + * @param width + * @param height + * @param ex - exception to be shown if any + * @return + */ + public static SplashErrorPanel getErrorSplashScreen(int width, int height, Throwable ex) { + return getErrorSplashScreen(width, height, getReason(), ex); + } + + /** + * Warrning - splash should have recieve width and height without borders. + * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method + * @param width + * @param height + * @param splashReason + * @return + */ + static SplashPanel getSplashScreen(int width, int height, SplashUtils.SplashReason splashReason) { + return getSplashScreen(width, height, splashReason, null, false); + } + + /** + * Warrning - splash should have recieve width and height without borders. + * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method + * @param width + * @param height + * @param splashReason + * @return + */ + static SplashErrorPanel getErrorSplashScreen(int width, int height, SplashUtils.SplashReason splashReason, Throwable ex) { + return (SplashErrorPanel) getSplashScreen(width, height, splashReason, ex, true); + } + + static SplashPanel getSplashScreen(int width, int height, SplashUtils.SplashReason splashReason, Throwable loadingException, boolean isError) { + String splashEnvironmetVar = null; + String pluginSplashEnvironmetVar = null; + try { + pluginSplashEnvironmetVar = System.getenv(ICEDTEA_WEB_PLUGIN_SPLASH); + splashEnvironmetVar = System.getenv(ICEDTEA_WEB_SPLASH); + } catch (Exception ex) { + ex.printStackTrace(); + } + SplashPanel sp = null; + if (SplashReason.JAVAWS.equals(splashReason)) { + if (NONE.equals(splashEnvironmetVar)) { + return null; + } + if (DEFAULT.equals(splashEnvironmetVar)) { + if (isError) { + sp = new DefaultErrorSplashScreen2012(width, height, splashReason, loadingException); + } else { + sp = new DefaultSplashScreen2012(width, height, splashReason); + } + } + } + if (SplashReason.APPLET.equals(splashReason)) { + if (NONE.equals(pluginSplashEnvironmetVar)) { + return null; + } + if (DEFAULT.equals(pluginSplashEnvironmetVar)) { + if (isError) { + sp = new DefaultErrorSplashScreen2012(width, height, splashReason, loadingException); + } else { + sp = new DefaultSplashScreen2012(width, height, splashReason); + } + } + } + if (isError) { + sp = new DefaultErrorSplashScreen2012(width, height, splashReason, loadingException); + } else { + sp = new DefaultSplashScreen2012(width, height, splashReason); + } + sp.setVersion(Boot.version); + return sp; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/tools/CertInformation.java icedtea-web-1.4/netx/net/sourceforge/jnlp/tools/CertInformation.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/tools/CertInformation.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/tools/CertInformation.java 2013-05-03 19:08:24.349518876 +0000 @@ -0,0 +1,292 @@ +/* CertInformation.java + Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.tools; + +import static net.sourceforge.jnlp.runtime.Translator.R; + +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.sourceforge.jnlp.runtime.JNLPRuntime; + +/** + * Maintains information about a CertPath that has signed at least one of the + * entries provided by a jar of the app. + */ +public class CertInformation { + + private boolean hasExpiredCert = false; + private boolean hasExpiringCert = false; + + private boolean isNotYetValidCert = false; + + /* Code signer properties of the certificate. */ + private boolean hasBadKeyUsage = false; + private boolean hasBadExtendedKeyUsage = false; + private boolean hasBadNetscapeCertType = false; + + private boolean alreadyTrustPublisher = false; + private boolean rootInCacerts = false; + + static enum Detail { + TRUSTED (R("STrustedCertificate")), + UNTRUSTED (R("SUntrustedCertificate")), + RUN_WITHOUT_RESTRICTIONS(R("SRunWithoutRestrictions")), + EXPIRED (R("SHasExpiredCert")), + EXPIRING (R("SHasExpiringCert")), + NOT_YET_VALID (R("SNotYetValidCert")), + BAD_KEY_USAGE (R("SBadKeyUsage")), + BAT_EXTENDED_KEY_USAGE (R("SBadExtendedKeyUsage")), + BAD_NETSCAPE_CERT_TYPE (R("SBadNetscapeCertType")); + + private final String message; + Detail(String issue) { + message = issue; + } + + public String message() { + return message; + } + } + + private EnumSet details = EnumSet.noneOf(Detail.class); + + /** The jars and their number of entries this cert has signed. */ + private HashMap signedJars = new HashMap(); + + /** + * Return if there are signing issues with this certificate. + * @return true if there are any issues with expiry, validity or bad key usage. + */ + public boolean hasSigningIssues() { + return hasExpiredCert || isNotYetValidCert || hasBadKeyUsage + || hasBadExtendedKeyUsage || hasBadNetscapeCertType; + } + + /** + * Return whether or not the publisher is already trusted. + * + * @return True if the publisher is trusted already. + */ + public boolean isPublisherAlreadyTrusted() { + return alreadyTrustPublisher; + } + + /** + * Set whether or not the publisher is already trusted. + * + */ + public void setAlreadyTrustPublisher() { + alreadyTrustPublisher = true; + } + + /** + * Return whether or not the root is in the list of trusted CA certificates. + * + * @return True if the root is in the list of CA certificates. + */ + public boolean isRootInCacerts() { + return rootInCacerts; + } + + /** + * Set that this cert's root CA is to be trusted. + */ + public void setRootInCacerts() { + rootInCacerts = true; + details.add(Detail.TRUSTED); + } + + /** + * Resets any trust of the root and publisher. Also removes unnecessary + * details from the list of issues. + */ + public void resetForReverification() { + alreadyTrustPublisher = false; + rootInCacerts = false; + removeFromDetails(Detail.UNTRUSTED); + removeFromDetails(Detail.TRUSTED); + } + /** + * Check if this cert is the signer of a jar. + * @param jarName The absolute path of the jar this certificate has signed. + * @return true if this cert has signed the jar found at jarName. + */ + public boolean isSignerOfJar(String jarName) { + return signedJars.containsKey(jarName); + } + + /** + * Add a jar to the list of jars this certificate has signed along with the + * number of entries it has signed in the jar. + * + * @param jarName The absolute path of the jar this certificate has signed. + * @param signedEntriesCount The number of entries this cert has signed in jarName. + */ + public void setNumJarEntriesSigned(String jarName, int signedEntriesCount) { + if (signedJars.containsKey(jarName)) { + if (JNLPRuntime.isDebug()) + System.err.println("WARNING: A jar that has already been " + + "verified is being yet again verified: " + jarName); + } else { + signedJars.put(jarName, signedEntriesCount); + } + } + + /** + * Find the number of entries this cert has signed in the specified jar. + * @param jarName The absolute path of the jar this certificate has signed. + * @return The number of entries this cert has signed in jarName. + */ + public int getNumJarEntriesSigned(String jarName) { + return signedJars.get(jarName); + } + + /** + * Get all the jars this cert has signed along with the number of entries + * in each jar. + * @return + */ + public Map getSignedJars() { + return signedJars; + } + + /** + * Get the details regarding issue(s) with this certificate. + * + * @return A list of all the details/issues with this app. + */ + public List getDetailsAsStrings() { + List detailsToStr = new ArrayList(); + for (Detail issue : details) { + detailsToStr.add(issue.message()); + } + return detailsToStr; + } + + /** + * Remove an issue from the list of details of issues with this certificate. + * List is unchanged if detail was not present. + * + * @param detail The issue to be removed regarding this certificate. + */ + private void removeFromDetails(Detail detail) { + details.remove(detail); + } + + /** + * Set that this cert is expired and add this issue to the list of details. + */ + public void setHasExpiredCert() { + hasExpiredCert = true; + details.add(Detail.RUN_WITHOUT_RESTRICTIONS); + details.add(Detail.EXPIRED); + } + + /** + * Set that this cert is expiring within 6 months and add this issue to + * the list of details. + */ + public void setHasExpiringCert() { + hasExpiringCert = true; + details.add(Detail.RUN_WITHOUT_RESTRICTIONS); + details.add(Detail.EXPIRING); + } + + /** + * Get whether or not this cert will expire within 6 months. + * @return true if the cert will be expired after 6 months. + */ + public boolean hasExpiringCert() { + return hasExpiringCert; + } + + /** + * Set that this cert is not yet valid + * and add this issue to the list of details. + */ + public void setNotYetValidCert() { + isNotYetValidCert = true; + details.add(Detail.RUN_WITHOUT_RESTRICTIONS); + details.add(Detail.NOT_YET_VALID); + } + + + /** + * Set that this cert has bad key usage + * and add this issue to the list of details. + */ + public void setBadKeyUsage() { + hasBadKeyUsage = true; + details.add(Detail.RUN_WITHOUT_RESTRICTIONS); + details.add(Detail.BAD_KEY_USAGE); + } + + + /** + * Set that this cert has bad extended key usage + * and add this issue to the list of details. + */ + public void setBadExtendedKeyUsage() { + hasBadExtendedKeyUsage = true; + details.add(Detail.RUN_WITHOUT_RESTRICTIONS); + details.add(Detail.BAT_EXTENDED_KEY_USAGE); + } + + + /** + * Set that this cert has a bad netscape cert type + * and add this issue to the list of details. + */ + public void setBadNetscapeCertType() { + hasBadNetscapeCertType = true; + details.add(Detail.RUN_WITHOUT_RESTRICTIONS); + details.add(Detail.BAD_NETSCAPE_CERT_TYPE); + } + + /** + * Set that this cert and all of its CAs are untrusted so far. + */ + public void setUntrusted() { + details.add(Detail.UNTRUSTED); + + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java icedtea-web-1.4/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java 2013-04-10 14:30:03.343821000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java 2013-05-03 19:08:24.351518851 +0000 @@ -25,8 +25,6 @@ package net.sourceforge.jnlp.tools; -import static net.sourceforge.jnlp.runtime.Translator.R; - import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -50,6 +48,7 @@ import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.security.AppVerifier; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.CertificateUtils; import net.sourceforge.jnlp.security.KeyStores; @@ -58,8 +57,9 @@ import sun.security.x509.NetscapeCertTypeExtension; /** - *

    The jar certificate verifier utility. - * + *

    + * The jar certificate verifier utility. + * * @author Roland Schemers * @author Jan Luehe */ @@ -71,133 +71,150 @@ // prefix for new signature-related files in META-INF directory private static final String SIG_PREFIX = META_INF + "SIG-"; - private static final long SIX_MONTHS = 180 * 24 * 60 * 60 * 1000L; //milliseconds + private static final long SIX_MONTHS = 180 * 24 * 60 * 60 * 1000L; // milliseconds - static enum verifyResult { + static enum VerifyResult { UNSIGNED, SIGNED_OK, SIGNED_NOT_OK } - // signer's certificate chain (when composing) - X509Certificate[] certChain; - - boolean verbose = false; // verbose output when signing/verifying - boolean showcerts = false; // show certs when verifying - - private boolean hasExpiredCert = false; - private boolean hasExpiringCert = false; - private boolean notYetValidCert = false; - - private boolean badKeyUsage = false; - private boolean badExtendedKeyUsage = false; - private boolean badNetscapeCertType = false; + /** All of the jar files that were verified for signing */ + private List verifiedJars = new ArrayList(); - private boolean alreadyTrustPublisher = false; - private boolean rootInCacerts = false; - - /** - * The single certPath used in this JarSiging. We're only keeping - * track of one here, since in practice there's only one signer - * for a JNLP Application. - */ - private CertPath certPath = null; + /** All of the jar files that were not verified */ + private List unverifiedJars = new ArrayList(); - private boolean noSigningIssues = true; + /** The certificates used for jar verification linked to their respective information */ + private Map certs = new HashMap(); - private boolean anyJarsSigned = false; + /** Temporary cert path hack to be used to keep track of which one a UI dialog is using */ + private CertPath currentlyUsed; - /** all of the jar files that were verified */ - private ArrayList verifiedJars = null; + /** Absolute location to jars and the number of entries which are possibly signable */ + private Map jarSignableEntries = new HashMap(); - /** all of the jar files that were not verified */ - private ArrayList unverifiedJars = null; + /** The application verifier to use by this instance */ + private AppVerifier appVerifier; - /** the certificates used for jar verification */ - private HashMap certs = new HashMap(); - - /** details of this signing */ - private ArrayList details = new ArrayList(); - - private int totalSignableEntries = 0; - - /* (non-Javadoc) - * @see net.sourceforge.jnlp.tools.CertVerifier2#getAlreadyTrustPublisher() + /** + * Create a new jar certificate verifier utility that uses the provided verifier for its strategy pattern. + * + * @param verifier + * The application verifier to be used by the new instance. */ - public boolean getAlreadyTrustPublisher() { - return alreadyTrustPublisher; + public JarCertVerifier(AppVerifier verifier) { + appVerifier = verifier; } - /* (non-Javadoc) - * @see net.sourceforge.jnlp.tools.CertVerifier2#getRootInCacerts() + /** + * Return true if there are no signable entries in the jar. + * This will return false if any of verified jars have content more than just META-INF/. */ - public boolean getRootInCacerts() { - return rootInCacerts; + public boolean isTriviallySigned() { + return getTotalJarEntries(jarSignableEntries) <= 0 + && certs.size() <= 0; } - public CertPath getCertPath() { - return certPath; + public boolean getAlreadyTrustPublisher() { + boolean allPublishersTrusted = appVerifier.hasAlreadyTrustedPublisher( + certs, jarSignableEntries); + if (JNLPRuntime.isDebug()) { + System.out.println("App already has trusted publisher: " + + allPublishersTrusted); + } + return allPublishersTrusted; } - /* (non-Javadoc) - * @see net.sourceforge.jnlp.tools.CertVerifier2#hasSigningIssues() - */ - public boolean hasSigningIssues() { - return hasExpiredCert || notYetValidCert || badKeyUsage - || badExtendedKeyUsage || badNetscapeCertType; + public boolean getRootInCacerts() { + boolean allRootCAsTrusted = appVerifier.hasRootInCacerts(certs, + jarSignableEntries); + if (JNLPRuntime.isDebug()) { + System.out.println("App has trusted root CA: " + allRootCAsTrusted); + } + return allRootCAsTrusted; } - /* (non-Javadoc) - * @see net.sourceforge.jnlp.tools.CertVerifier2#noSigningIssues() - */ - public boolean noSigningIssues() { - return noSigningIssues; + public CertPath getCertPath(CertPath cPath) { // Parameter ignored. + return currentlyUsed; } - public boolean anyJarsSigned() { - return anyJarsSigned; + public boolean hasSigningIssues(CertPath certPath) { + return certs.get(certPath).hasSigningIssues(); } - /* (non-Javadoc) - * @see net.sourceforge.jnlp.tools.CertVerifier2#getDetails() - */ - public ArrayList getDetails() { - return details; + public List getDetails(CertPath certPath) { + if (certPath != null) { + currentlyUsed = certPath; + } + return certs.get(currentlyUsed).getDetailsAsStrings(); } - /* (non-Javadoc) - * @see net.sourceforge.jnlp.tools.CertVerifier2#getCerts() + /** + * Get a list of the cert paths of all signers across the app. + * + * @return List of CertPath vars representing each of the signers present on any jar. */ - public ArrayList getCerts() { + public List getCertsList() { return new ArrayList(certs.keySet()); } /** - * Returns whether or not all entries have a common signer. - * - * It is possible to create jars where only some entries are signed. In - * such cases, we should not prompt the user to accept anything, as the whole - * application must be treated as unsigned. This method should be called by a - * caller before it is about to ask the user to accept a cert and determine - * whether the application is trusted or not. - * - * @return Whether or not all entries have a common signer + * Find the information the specified cert path has with respect to this application. + * + * @return All the information the path has with this app. */ - public boolean isFullySignedByASingleCert() { + public CertInformation getCertInformation(CertPath cPath) { + return certs.get(cPath); + } - for (CertPath cPath : certs.keySet()) { - // If this cert has signed everything, return true - if (certs.get(cPath) == totalSignableEntries) - return true; + /** + * Returns whether or not the app is considered completely signed. + * + * An app using a JNLP is considered signed if all of the entries of its jars are signed by at least one common signer. + * + * An applet on the other hand only needs to have each individual jar be fully signed by a signer. The signers can differ between jars. + * + * @return Whether or not the app is considered signed. + */ + // FIXME: Change javadoc once applets do not need entire jars signed. + public boolean isFullySigned() { + if (isTriviallySigned()) + return true; + boolean fullySigned = appVerifier.isFullySigned(certs, + jarSignableEntries); + if (JNLPRuntime.isDebug()) { + System.out.println("App already has trusted publisher: " + + fullySigned); } - - // No cert found that signed all entries. Return false. - return false; + return fullySigned; } - public void verifyJars(List jars, ResourceTracker tracker) + /** + * Update the verifier to consider new jars when verifying. + * + * @param jars + * List of new jars to be verified. + * @param tracker + * Resource tracker used to obtain the the jars from cache + * @throws Exception + * Caused by issues with obtaining the jars' entries or interacting with the tracker. + */ + public void add(List jars, ResourceTracker tracker) throws Exception { + verifyJars(jars, tracker); + } - verifiedJars = new ArrayList(); - unverifiedJars = new ArrayList(); + /** + * Verify the jars provided and update the state of this instance to match the new information. + * + * @param jars + * List of new jars to be verified. + * @param tracker + * Resource tracker used to obtain the the jars from cache + * @throws Exception + * Caused by issues with obtaining the jars' entries or interacting with the tracker. + */ + private void verifyJars(List jars, ResourceTracker tracker) + throws Exception { for (JARDesc jar : jars) { @@ -212,14 +229,18 @@ } String localFile = jarFile.getAbsolutePath(); - verifyResult result = verifyJar(localFile); + if (verifiedJars.contains(localFile) + || unverifiedJars.contains(localFile)) { + continue; + } + + VerifyResult result = verifyJar(localFile); - if (result == verifyResult.UNSIGNED) { + if (result == VerifyResult.UNSIGNED) { unverifiedJars.add(localFile); - } else if (result == verifyResult.SIGNED_NOT_OK) { - noSigningIssues = false; + } else if (result == VerifyResult.SIGNED_NOT_OK) { verifiedJars.add(localFile); - } else if (result == verifyResult.SIGNED_OK) { + } else if (result == VerifyResult.SIGNED_OK) { verifiedJars.add(localFile); } } catch (Exception e) { @@ -229,26 +250,20 @@ } } - //we really only want the first certPath - for (CertPath cPath : certs.keySet()) { - - if (certs.get(cPath) != totalSignableEntries) - continue; - else - certPath = cPath; - - // check if the certs added above are in the trusted path - checkTrustedCerts(); - - if (alreadyTrustPublisher || rootInCacerts) - break; - } - + for (CertPath certPath : certs.keySet()) + checkTrustedCerts(certPath); } - private verifyResult verifyJar(String jarName) throws Exception { - boolean anySigned = false; - boolean hasUnsignedEntry = false; + /** + * Checks through all the jar entries of jarName for signers, storing all the common ones in the certs hash map. + * + * @param jarName + * The absolute path to the jar file. + * @return The return of {@link JarCertVerifier#verifyJarEntryCerts} using the entries found in the jar located at jarName. + * @throws Exception + * Will be thrown if there are any problems with the jar. + */ + private VerifyResult verifyJar(String jarName) throws Exception { JarFile jarFile = null; try { @@ -263,10 +278,9 @@ InputStream is = jarFile.getInputStream(je); try { - int n; - while ((n = is.read(buffer, 0, buffer.length)) != -1) { + while (is.read(buffer, 0, buffer.length) != -1) { // we just read. this will throw a SecurityException - // if a signature/digest check fails. + // if a signature/digest check fails. } } finally { if (is != null) { @@ -274,95 +288,9 @@ } } } + return verifyJarEntryCerts(jarName, jarFile.getManifest() != null, + entriesVec); - if (jarFile.getManifest() != null) { - if (verbose) - System.out.println(); - - long now = System.currentTimeMillis(); - - for (JarEntry je : entriesVec) { - String name = je.getName(); - CodeSigner[] signers = je.getCodeSigners(); - boolean isSigned = (signers != null); - anySigned |= isSigned; - - boolean shouldHaveSignature = !je.isDirectory() - && !isMetaInfFile(name); - - hasUnsignedEntry |= shouldHaveSignature && !isSigned; - - if (shouldHaveSignature) - totalSignableEntries++; - - if (shouldHaveSignature && isSigned) { - for (int i = 0; i < signers.length; i++) { - CertPath certPath = signers[i].getSignerCertPath(); - if (!certs.containsKey(certPath)) - certs.put(certPath, 1); - else - certs.put(certPath, certs.get(certPath) + 1); - - Certificate cert = signers[i].getSignerCertPath() - .getCertificates().get(0); - if (cert instanceof X509Certificate) { - checkCertUsage((X509Certificate) cert, null); - if (!showcerts) { - long notBefore = ((X509Certificate) cert) - .getNotBefore().getTime(); - long notAfter = ((X509Certificate) cert) - .getNotAfter().getTime(); - - if (now < notBefore) { - notYetValidCert = true; - } - - if (notAfter < now) { - hasExpiredCert = true; - } else if (notAfter < now + SIX_MONTHS) { - hasExpiringCert = true; - } - } - } - } - } - } //while e has more elements - } else { //if man not null - - // Else increment totalEntries by 1 so that unsigned jars with - // no manifests can't sneak in - totalSignableEntries++; - } - - //Alert the user if any of the following are true. - if (!anySigned) { - return verifyResult.UNSIGNED; - } else { - anyJarsSigned = true; - - //warnings - if (hasUnsignedEntry || hasExpiredCert || hasExpiringCert || - badKeyUsage || badExtendedKeyUsage || badNetscapeCertType || - notYetValidCert) { - - addToDetails(R("SRunWithoutRestrictions")); - - if (badKeyUsage) - addToDetails(R("SBadKeyUsage")); - if (badExtendedKeyUsage) - addToDetails(R("SBadExtendedKeyUsage")); - if (badNetscapeCertType) - addToDetails(R("SBadNetscapeCertType")); - if (hasUnsignedEntry) - addToDetails(R("SHasUnsignedEntry")); - if (hasExpiredCert) - addToDetails(R("SHasExpiredCert")); - if (hasExpiringCert) - addToDetails(R("SHasExpiringCert")); - if (notYetValidCert) - addToDetails(R("SNotYetValidCert")); - } - } } catch (Exception e) { e.printStackTrace(); throw e; @@ -371,51 +299,180 @@ jarFile.close(); } } - - //anySigned does not guarantee that all files were signed. - return (anySigned && !(hasUnsignedEntry || hasExpiredCert - || badKeyUsage || badExtendedKeyUsage || badNetscapeCertType || notYetValidCert)) ? verifyResult.SIGNED_OK : verifyResult.SIGNED_NOT_OK; } /** - * Checks the user's trusted.certs file and the cacerts file to see - * if a publisher's and/or CA's certificate exists there. - */ - private void checkTrustedCerts() throws Exception { - if (certPath != null) { - try { - X509Certificate publisher = (X509Certificate) getPublisher(); - KeyStore[] certKeyStores = KeyStores.getCertKeyStores(); - alreadyTrustPublisher = CertificateUtils.inKeyStores(publisher, certKeyStores); - X509Certificate root = (X509Certificate) getRoot(); - KeyStore[] caKeyStores = KeyStores.getCAKeyStores(); - // Check entire cert path for a trusted CA - for (Certificate c : certPath.getCertificates()) { - if ((rootInCacerts = CertificateUtils.inKeyStores( - (X509Certificate) c, caKeyStores))) { - break; + * Checks through all the jar entries for signers, storing all the common ones in the certs hash map. + * + * @param jarName + * The absolute path to the jar file. + * @param jarHasManifest + * Whether or not the associated jar has a manifest. + * @param entries + * The list of entries in the associated jar. + * @return If there is at least one signable entry that is not signed by a common signer, return UNSIGNED. Otherwise every signable entry is signed by at least one common signer. If the signer has no issues, return SIGNED_OK. If there are any signing issues, return SIGNED_NOT_OK. + * @throws Exception + * Will be thrown if there are issues with entries. + */ + VerifyResult verifyJarEntryCerts(String jarName, boolean jarHasManifest, + Vector entries) throws Exception { + // Contains number of entries the cert with this CertPath has signed. + Map jarSignCount = new HashMap(); + int numSignableEntriesInJar = 0; + + // Record current time just before checking the jar begins. + long now = System.currentTimeMillis(); + if (jarHasManifest) { + + for (JarEntry je : entries) { + String name = je.getName(); + CodeSigner[] signers = je.getCodeSigners(); + boolean isSigned = (signers != null); + + boolean shouldHaveSignature = !je.isDirectory() + && !isMetaInfFile(name); + + if (shouldHaveSignature) { + numSignableEntriesInJar++; + } + + if (shouldHaveSignature && isSigned) { + for (int i = 0; i < signers.length; i++) { + CertPath certPath = signers[i].getSignerCertPath(); + + if (!jarSignCount.containsKey(certPath)) + jarSignCount.put(certPath, 1); + else + jarSignCount.put(certPath, + jarSignCount.get(certPath) + 1); + } + } + } // while e has more elements + } else { // if manifest is null + + // Else increment total entries by 1 so that unsigned jars with + // no manifests can't sneak in + numSignableEntriesInJar++; + } + + jarSignableEntries.put(jarName, numSignableEntriesInJar); + + // Find all signers that have signed every signable entry in this jar. + boolean allEntriesSignedBySingleCert = false; + for (CertPath certPath : jarSignCount.keySet()) { + if (jarSignCount.get(certPath) == numSignableEntriesInJar) { + allEntriesSignedBySingleCert = true; + + boolean wasPreviouslyVerified = certs.containsKey(certPath); + if (!wasPreviouslyVerified) + certs.put(certPath, new CertInformation()); + + CertInformation certInfo = certs.get(certPath); + if (wasPreviouslyVerified) + certInfo.resetForReverification(); + + certInfo.setNumJarEntriesSigned(jarName, + numSignableEntriesInJar); + + Certificate cert = certPath.getCertificates().get(0); + if (cert instanceof X509Certificate) { + checkCertUsage(certPath, (X509Certificate) cert, null); + long notBefore = ((X509Certificate) cert).getNotBefore().getTime(); + long notAfter = ((X509Certificate) cert).getNotAfter().getTime(); + if (now < notBefore) { + certInfo.setNotYetValidCert(); + } + + if (notAfter < now) { + certInfo.setHasExpiredCert(); + } else if (notAfter < now + SIX_MONTHS) { + certInfo.setHasExpiringCert(); } } - } catch (Exception e) { - // TODO: Warn user about not being able to - // look through their cacerts/trusted.certs - // file depending on exception. - throw e; } + } - if (!rootInCacerts) - addToDetails(R("SUntrustedCertificate")); - else - addToDetails(R("STrustedCertificate")); + // Every signable entry of this jar needs to be signed by at least + // one signer for the jar to be considered successfully signed. + VerifyResult result = null; + + if (numSignableEntriesInJar == 0) { + // Allow jars with no signable entries to simply be considered signed. + // There should be no security risk in doing so. + result = VerifyResult.SIGNED_OK; + } else if (allEntriesSignedBySingleCert) { + + // We need to find at least one signer without any issues. + for (CertPath entryCertPath : jarSignCount.keySet()) { + if (certs.containsKey(entryCertPath) + && !hasSigningIssues(entryCertPath)) { + result = VerifyResult.SIGNED_OK; + break; + } + } + if (result == null) { + // All signers had issues + result = VerifyResult.SIGNED_NOT_OK; + } + } else { + result = VerifyResult.UNSIGNED; } + + if (JNLPRuntime.isDebug()) { + System.out.println("Jar found at " + jarName + + "has been verified as " + result); + } + return result; } - /* (non-Javadoc) - * @see net.sourceforge.jnlp.tools.CertVerifier2#getPublisher() + /** + * Checks the user's trusted.certs file and the cacerts file to see if a + * publisher's and/or CA's certificate exists there. + * + * @param certPath + * The cert path of the signer being checked for trust. */ - public Certificate getPublisher() { - if (certPath != null) { - List certList = certPath.getCertificates(); + private void checkTrustedCerts(CertPath certPath) throws Exception { + CertInformation info = certs.get(certPath); + try { + X509Certificate publisher = (X509Certificate) getPublisher(certPath); + KeyStore[] certKeyStores = KeyStores.getCertKeyStores(); + if (CertificateUtils.inKeyStores(publisher, certKeyStores)) + info.setAlreadyTrustPublisher(); + KeyStore[] caKeyStores = KeyStores.getCAKeyStores(); + // Check entire cert path for a trusted CA + for (Certificate c : certPath.getCertificates()) { + if (CertificateUtils.inKeyStores((X509Certificate) c, + caKeyStores)) { + info.setRootInCacerts(); + return; + } + } + } catch (Exception e) { + // TODO: Warn user about not being able to + // look through their cacerts/trusted.certs + // file depending on exception. + if (JNLPRuntime.isDebug()) { + System.out.println("WARNING: Unable to read through cert store files."); + } + throw e; + } + + // Otherwise a parent cert was not found to be trusted. + info.setUntrusted(); + } + + public void setCurrentlyUsedCertPath(CertPath cPath) { + currentlyUsed = cPath; + } + + public Certificate getPublisher(CertPath cPath) { + if (cPath != null) { + currentlyUsed = cPath; + } + if (currentlyUsed != null) { + List certList = currentlyUsed + .getCertificates(); if (certList.size() > 0) { return certList.get(0); } else { @@ -426,12 +483,13 @@ } } - /* (non-Javadoc) - * @see net.sourceforge.jnlp.tools.CertVerifier2#getRoot() - */ - public Certificate getRoot() { - if (certPath != null) { - List certList = certPath.getCertificates(); + public Certificate getRoot(CertPath cPath) { + if (cPath != null) { + currentlyUsed = cPath; + } + if (currentlyUsed != null) { + List certList = currentlyUsed + .getCertificates(); if (certList.size() > 0) { return certList.get(certList.size() - 1); } else { @@ -442,20 +500,10 @@ } } - private void addToDetails(String detail) { - if (!details.contains(detail)) - details.add(detail); - } - /** * Returns whether a file is in META-INF, and thus does not require signing. - * - * Signature-related files under META-INF include: - * . META-INF/MANIFEST.MF - * . META-INF/SIG-* - * . META-INF/*.SF - * . META-INF/*.DSA - * . META-INF/*.RSA + * + * Signature-related files under META-INF include: . META-INF/MANIFEST.MF . META-INF/SIG-* . META-INF/*.SF . META-INF/*.DSA . META-INF/*.RSA */ static boolean isMetaInfFile(String name) { String ucName = name.toUpperCase(); @@ -464,15 +512,19 @@ /** * Check if userCert is designed to be a code signer - * @param userCert the certificate to be examined - * @param bad 3 booleans to show if the KeyUsage, ExtendedKeyUsage, - * NetscapeCertType has codeSigning flag turned on. - * If null, the class field badKeyUsage, badExtendedKeyUsage, + * + * @param userCert + * the certificate to be examined + * @param bad + * 3 booleans to show if the KeyUsage, ExtendedKeyUsage, + * NetscapeCertType has codeSigning flag turned on. If null, + * the class field badKeyUsage, badExtendedKeyUsage, * badNetscapeCertType will be set. - * - * Required for verifyJar() + * + * Required for verifyJar() */ - void checkCertUsage(X509Certificate userCert, boolean[] bad) { + void checkCertUsage(CertPath certPath, X509Certificate userCert, + boolean[] bad) { // Can act as a signer? // 1. if KeyUsage, then [0] should be true @@ -490,7 +542,7 @@ if (bad != null) { bad[0] = true; } else { - badKeyUsage = true; + certs.get(certPath).setBadKeyUsage(); } } } @@ -503,7 +555,7 @@ if (bad != null) { bad[1] = true; } else { - badExtendedKeyUsage = true; + certs.get(certPath).setBadExtendedKeyUsage(); } } } @@ -513,24 +565,24 @@ try { // OID_NETSCAPE_CERT_TYPE - byte[] netscapeEx = userCert.getExtensionValue - ("2.16.840.1.113730.1.1"); + byte[] netscapeEx = userCert + .getExtensionValue("2.16.840.1.113730.1.1"); if (netscapeEx != null) { DerInputStream in = new DerInputStream(netscapeEx); byte[] encoded = in.getOctetString(); encoded = new DerValue(encoded).getUnalignedBitString() .toByteArray(); - NetscapeCertTypeExtension extn = - new NetscapeCertTypeExtension(encoded); + NetscapeCertTypeExtension extn = new NetscapeCertTypeExtension( + encoded); - Boolean val = (Boolean) extn.get( - NetscapeCertTypeExtension.OBJECT_SIGNING); + Boolean val = (Boolean) extn + .get(NetscapeCertTypeExtension.OBJECT_SIGNING); if (!val) { if (bad != null) { bad[2] = true; } else { - badNetscapeCertType = true; + certs.get(certPath).setBadNetscapeCertType(); } } } @@ -541,11 +593,31 @@ /** * Returns if all jars are signed. - * + * * @return True if all jars are signed, false if there are one or more unsigned jars */ public boolean allJarsSigned() { return this.unverifiedJars.size() == 0; } + public void checkTrustWithUser(JNLPFile file) throws LaunchException { + appVerifier.checkTrustWithUser(this, file); + } + + public Map getJarSignableEntries() { + return Collections.unmodifiableMap(jarSignableEntries); + } + + /** + * Get the total number of entries in the provided map. + * + * @return The number of entries. + */ + public static int getTotalJarEntries(Map map) { + int sum = 0; + for (int value : map.values()) { + sum += value; + } + return sum; + } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/UpdateDesc.java icedtea-web-1.4/netx/net/sourceforge/jnlp/UpdateDesc.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/UpdateDesc.java 2013-04-10 11:40:23.857668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/UpdateDesc.java 2013-05-03 19:08:24.219520511 +0000 @@ -1,3 +1,40 @@ +/* UpdateDesc.java + Copyright (C) 2010 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + package net.sourceforge.jnlp; /** diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/FileUtils.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/FileUtils.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/FileUtils.java 2013-04-10 11:40:23.892668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/FileUtils.java 2013-05-03 19:08:24.352518839 +0000 @@ -176,6 +176,39 @@ } } + if (JNLPRuntime.isWindows()) { + // remove all permissions + if (!tempFile.setExecutable(false, false)) { + System.err.println(R("RRemoveXPermFailed", tempFile)); + } + if (!tempFile.setReadable(false, false)) { + System.err.println(R("RRemoveRPermFailed", tempFile)); + } + if (!tempFile.setWritable(false, false)) { + System.err.println(R("RRemoveWPermFailed", tempFile)); + } + + // allow owner to read + if (!tempFile.setReadable(true, true)) { + System.err.println(R("RGetRPermFailed", tempFile)); + } + + // allow owner to write + if (writableByOwner && !tempFile.setWritable(true, true)) { + System.err.println(R("RGetWPermFailed", tempFile)); + } + + // allow owner to enter directories + if (isDir && !tempFile.setExecutable(true, true)) { + System.err.println(R("RGetXPermFailed", tempFile)); + } + // rename this file. Unless the file is moved/renamed, any program that + // opened the file right after it was created might still be able to + // read the data. + if (!tempFile.renameTo(file)) { + System.err.println(R("RCantRename", tempFile, file)); + } + } else { // remove all permissions if (!tempFile.setExecutable(false, false)) { throw new IOException(R("RRemoveXPermFailed", tempFile)); @@ -201,13 +234,15 @@ if (isDir && !tempFile.setExecutable(true, true)) { throw new IOException(R("RGetXPermFailed", tempFile)); } - + // rename this file. Unless the file is moved/renamed, any program that // opened the file right after it was created might still be able to // read the data. if (!tempFile.renameTo(file)) { throw new IOException(R("RCantRename", tempFile, file)); } + } + } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/HttpUtils.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/HttpUtils.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/HttpUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/HttpUtils.java 2013-05-03 19:08:24.353518827 +0000 @@ -0,0 +1,76 @@ +/* + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; + +public class HttpUtils { + + /** + * Ensure a HttpURLConnection is fully read, required for correct behavior. + * Captured IOException is consumed and printed + */ + public static void consumeAndCloseConnectionSilently(HttpURLConnection c) { + try { + consumeAndCloseConnection(c); + } catch (IOException ex) { + ex.printStackTrace(System.err); + } + } + + /** + * Ensure a HttpURLConnection is fully read, required for correct behavior + * + * @throws IOException + */ + public static void consumeAndCloseConnection(HttpURLConnection c) throws IOException { + InputStream in = null; + try { + in = c.getInputStream(); + byte[] throwAwayBuffer = new byte[256]; + while (in.read(throwAwayBuffer) > 0) { + /* ignore contents */ + } + } finally { + if (in != null) { + in.close(); + } + } + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/JarFile.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/JarFile.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/JarFile.java 2013-04-10 14:30:03.343821000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/JarFile.java 2013-05-03 19:08:24.354518815 +0000 @@ -36,14 +36,16 @@ exception statement from your version. */ package net.sourceforge.jnlp.util; +import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.util.zip.ZipFile; import net.sourceforge.jnlp.runtime.JNLPRuntime; -public class JarFile extends java.util.jar.JarFile { +//in jdk6 java.util.jar.JarFile is not Closeable - fixing +//overwritening class can add duplicate occurence of interface so this should be perfectly safe +public class JarFile extends java.util.jar.JarFile implements Closeable{ public JarFile(String name) throws IOException { super(name); diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java 2013-05-03 19:08:24.394518311 +0000 @@ -0,0 +1,166 @@ +/* + Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.util.lockingfile; + +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.channels.FileChannel; +import java.nio.channels.FileLock; +import java.util.Map; +import java.util.WeakHashMap; +import java.util.concurrent.locks.ReentrantLock; +import net.sourceforge.jnlp.runtime.JNLPRuntime; + +/* + * Process & thread locked access to a file. Creates file if it does not already exist. + */ +public class LockedFile { + + // The file for access + private RandomAccessFile randomAccessFile; + private FileChannel fileChannel; + private File file; + // A file lock will protect against locks for multiple + // processes, while a thread lock is still needed within a single JVM. + private FileLock processLock = null; + private ReentrantLock threadLock = new ReentrantLock(); + private boolean readOnly; + + private LockedFile(File file) { + this.file = file; + try { + //just try to create + this.file.createNewFile(); + } catch (Exception ex) { + //intentionaly silent + } + if (!this.file.isFile() && file.getParentFile() != null && !file.getParentFile().canWrite()) { + readOnly = true; + } else { + this.readOnly = !file.canWrite(); + if (!readOnly && file.getParentFile() != null && !file.getParentFile().canWrite()) { + readOnly = true; + } + } + } + + public boolean isReadOnly() { + return readOnly; + } + // Provide shared access to LockedFile's via weak map + static private final Map instanceCache = new WeakHashMap(); + + /** + * Get a LockedFile for a given File. Ensures that we share the same + * instance for all threads + * + * @param file the file to lock + * @return a LockedFile instance + */ + synchronized public static LockedFile getInstance(File file) { + if (!instanceCache.containsKey(file)) { + instanceCache.put(file, new LockedFile(file)); + } + + return instanceCache.get(file); + } + + /** + * Get the file being locked. + * + * @return the file + */ + public File getFile() { + return file; + } + + /** + * Lock access to the file. Lock is reentrant. + */ + public void lock() throws IOException { + if (JNLPRuntime.isWindows()) { + return; + } + // Create if does not already exist, cannot lock non-existing file + if (!isReadOnly()) { + this.file.createNewFile(); + } + + this.threadLock.lock(); + + if (this.processLock != null) { + return; + } + + if (this.file.exists()) { + this.randomAccessFile = new RandomAccessFile(this.file, isReadOnly() ? "r" : "rws"); + this.fileChannel = randomAccessFile.getChannel(); + if (!isReadOnly()){ + this.processLock = this.fileChannel.lock(); + } + } + } + + /** + * Unlock access to the file. Lock is reentrant. + */ + public void unlock() throws IOException { + if (JNLPRuntime.isWindows()) { + return; + } + boolean releaseProcessLock = (this.threadLock.getHoldCount() == 1); + try { + if (releaseProcessLock) { + if (this.processLock != null){ + this.processLock.release(); + } + this.processLock = null; + //necessary for read only file + if (this.randomAccessFile != null){ + this.randomAccessFile.close(); + } + //necessary for not existing parent direcotry + if (this.fileChannel != null){ + this.fileChannel.close(); + } + } + } finally { + this.threadLock.unlock(); + } + } +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java 2013-05-03 19:08:24.401518222 +0000 @@ -0,0 +1,200 @@ +/* +Copyright (C) 2013 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.util.lockingfile; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; + +/** + * Process-locked string storage backed by a file. + * Each string is stored on its own line. + * Any new-lines must be encoded somehow if they are to be stored. + */ +public abstract class LockingReaderWriter { + + private LockedFile lockedFile; + + /** + * Create locking file-backed storage. + * @param file the storage file + */ + public LockingReaderWriter(File file) { + this.lockedFile = LockedFile.getInstance(file); + } + + /** + * Get the underlying file. + * Any access to this file should use lock() & unlock(). + * + * @return the file + */ + public File getBackingFile() { + return this.lockedFile.getFile(); + } + + public boolean isReadOnly() { + return this.lockedFile.isReadOnly(); + } + + /** + * Lock the underlying storage. Lock is reentrant. + */ + public void lock() { + try { + lockedFile.lock(); + } catch (IOException e) { + throw new StorageIoException(e); + } + } + + /** + * Unlock the underlying storage. Lock is reentrant. + */ + public void unlock() { + try { + lockedFile.unlock(); + } catch (IOException e) { + throw new StorageIoException(e); + } + } + + /** + * Writes stored contents to file. Assumes lock is held. + * @throws IOException + */ + protected void writeContents() throws IOException { + if (!getBackingFile().isFile()){ + return; + } + if (isReadOnly()){ + return; + } + BufferedWriter writer = null; + try { + writer = new BufferedWriter(new OutputStreamWriter( + new FileOutputStream(getBackingFile()), "UTF-8")); + writeContent(writer); + writer.flush(); + } finally { + if (writer != null) { + writer.close(); + } + } + } + + protected abstract void writeContent(BufferedWriter writer) throws IOException; + + /** + * Reads contents from file. Assumes lock is held. + * @throws IOException + */ + protected void readContents() throws IOException { + if (!getBackingFile().isFile()){ + return; + } + BufferedReader reader = null; + try { + reader = new BufferedReader(new InputStreamReader( + new FileInputStream(getBackingFile()), "UTF-8")); + + while (true) { + String line = reader.readLine(); + if (line == null) { + break; + } + readLine(line); + } + } finally { + if (reader != null) { + reader.close(); + } + } + } + + /** + * Reads contents from the file, first acquring a lock. + * @throws IOException + */ + protected synchronized void readContentsLocked() throws IOException { + doLocked(new Runnable() { + + @Override + public void run() { + try { + readContents(); + } catch (IOException ex) { + throw new StorageIoException(ex); + } + } + }); + } + + /** + * Write contents to the file, first acquring a lock. + * @throws IOException + */ + protected synchronized void writeContentsLocked() throws IOException { + doLocked(new Runnable() { + + public void run() { + try { + writeContents(); + } catch (IOException ex) { + throw new StorageIoException(ex); + } + } + }); + + } + + protected void doLocked(Runnable r) { + lock(); + try { + r.run(); + } finally { + unlock(); + } + } + + protected abstract void readLine(String line); +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java 2013-05-03 19:08:24.401518222 +0000 @@ -0,0 +1,58 @@ +/* Copyright (C) 2013 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.util.lockingfile; + +/** + * Thrown when an exception occurs using the storage (namely IOException) + */ +public class StorageIoException extends RuntimeException { + + LockingReaderWriter outer; + + public StorageIoException(Exception e) { + super(e); + } + + public StorageIoException(String e) { + super(e); + } + + public StorageIoException(Exception e, LockingReaderWriter outer) { + super(e); + this.outer = outer; + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/ScreenFinder.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/ScreenFinder.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/ScreenFinder.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/ScreenFinder.java 2013-05-03 19:08:24.355518802 +0000 @@ -0,0 +1,100 @@ +/* ScreenFinder.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ +package net.sourceforge.jnlp.util; + +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Insets; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.Window; + +public class ScreenFinder { + + public static GraphicsDevice getCurrentScreen() { + Point p = MouseInfo.getPointerInfo().getLocation(); + return getScreenOnCoords(p); + + } + public static Rectangle getCurrentScreenSizeWithoutBounds() { + Point p = MouseInfo.getPointerInfo().getLocation(); + return getScreenOnCoordsWithutBounds(p); + + } + + public static void centerWindowsToCurrentScreen(Window w) { + Rectangle bounds = getCurrentScreenSizeWithoutBounds(); + w.setLocation(bounds.x + (bounds.width - w.getWidth())/2, + bounds.y + (bounds.height - w.getHeight())/2); + + } + + public static GraphicsDevice getScreenOnCoords(Point point) { + GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); + GraphicsDevice[] devices = e.getScreenDevices(); + GraphicsDevice result = null; + //now get the configuration(s) for each device + for (GraphicsDevice device : devices) { + //GraphicsConfiguration[] configurations = device.getConfigurations(); + //or? + GraphicsConfiguration[] configurations = new GraphicsConfiguration[]{device.getDefaultConfiguration()}; + for (GraphicsConfiguration config : configurations) { + Rectangle gcBounds = config.getBounds(); + if (gcBounds.contains(point)) { + result = device; + } + } + } + if (result == null) { + //not found, get the default display + result = e.getDefaultScreenDevice(); + } + return result; + } + + public static Rectangle getScreenOnCoordsWithutBounds(Point p) { + GraphicsDevice device = getScreenOnCoords(p); + Rectangle screenSize = device.getDefaultConfiguration().getBounds(); + Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(device.getDefaultConfiguration()); + return new Rectangle((int)screenSize.getX()+insets.left, (int)screenSize.getY()+insets.top, (int)screenSize.getWidth()-insets.left, (int)screenSize.getHeight()-insets.bottom); + } + + +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/StreamUtils.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/StreamUtils.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/StreamUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/StreamUtils.java 2013-05-03 19:08:24.355518802 +0000 @@ -0,0 +1,80 @@ +/* +Copyright (C) 2013 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.util; + +import java.io.BufferedReader; +import java.io.Closeable; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +public class StreamUtils { + + /*** + * Closes a stream, without throwing IOException. + * In case of IOException, prints the stack trace to System.err. + * + * @param stream the stream that will be closed + */ + public static void closeSilently (Closeable stream) { + if (stream != null) { + try { + stream.close(); + } catch (IOException e) { + e.printStackTrace(System.err); + } + } + } + + + public static String readStreamAsString(InputStream stream) throws IOException { + InputStreamReader is = new InputStreamReader(stream); + StringBuilder sb = new StringBuilder(); + BufferedReader br = new BufferedReader(is); + while (true) { + String read = br.readLine(); + if (read == null) { + break; + } + sb.append(read); + + } + + return sb.toString(); + } +} diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/UrlUtils.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/UrlUtils.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/UrlUtils.java 2013-04-10 11:40:23.894668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/UrlUtils.java 2013-05-03 19:08:24.356518789 +0000 @@ -37,9 +37,34 @@ package net.sourceforge.jnlp.util; +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; +import java.net.URLDecoder; public class UrlUtils { + private static final String UTF8 = "utf-8"; + + public static URL normalizeUrlAndStripParams(URL url, boolean encodeFileUrls) { + try { + String[] urlParts = url.toString().split("\\?"); + URL strippedUrl = new URL(urlParts[0]); + return normalizeUrl(strippedUrl, encodeFileUrls); + } catch (IOException e) { + e.printStackTrace(); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + return url; + } + + public static URL normalizeUrlAndStripParams(URL url) { + return normalizeUrlAndStripParams(url, false); + } public static boolean isLocalFile(URL url) { @@ -50,4 +75,68 @@ } return false; } + + /* Decode a percent-encoded URL. Catch checked exceptions and log. */ + public static URL decodeUrlQuietly(URL url) { + try { + return new URL(URLDecoder.decode(url.toString(), UTF8)); + } catch (IOException e) { + e.printStackTrace(); + return url; + } + } + + /* Ensure a URL is properly percent-encoded. + * Certain usages require local-file URLs to be encoded, eg for code-base & document-base. */ + public static URL normalizeUrl(URL url, boolean encodeFileUrls) throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { + if (url == null) { + return null; + } + String protocol = url.getProtocol(); + boolean shouldEncode = (encodeFileUrls || !"file".equals(protocol)); + + if (protocol == null || !shouldEncode || url.getPath() == null) { + return url; + } + + //Decode the URL before encoding + URL decodedURL = new URL(URLDecoder.decode(url.toString(), UTF8)); + + //Create URI with the decoded URL + URI uri = new URI(decodedURL.getProtocol(), null, decodedURL.getHost(), decodedURL.getPort(), decodedURL.getPath(), decodedURL.getQuery(), null); + + //Returns the encoded URL + URL encodedURL = new URL(uri.toASCIIString()); + + return encodedURL; + } + + /* Ensure a URL is properly percent-encoded. Does not encode local-file URLs. */ + public static URL normalizeUrl(URL url) throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { + return normalizeUrl(url, false); + } + + /* Ensure a URL is properly percent-encoded. Catch checked exceptions and log. */ + public static URL normalizeUrlQuietly(URL url, boolean encodeFileUrls) { + try { + return normalizeUrl(url, encodeFileUrls); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + return url; + } + + /* Ensure a URL is properly percent-encoded. Catch checked exceptions and log. */ + public static URL normalizeUrlQuietly(URL url) { + return normalizeUrlQuietly(url, false); + } + + /* Decode a URL as a file, being tolerant of URLs with mixed encoded & decoded portions. */ + public static File decodeUrlAsFile(URL url) { + return new File(decodeUrlQuietly(url).getFile()); + } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/XDesktopEntry.java icedtea-web-1.4/netx/net/sourceforge/jnlp/util/XDesktopEntry.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/util/XDesktopEntry.java 2013-04-10 11:40:23.894668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/util/XDesktopEntry.java 2013-05-03 19:08:24.357518776 +0000 @@ -16,16 +16,25 @@ package net.sourceforge.jnlp.util; +import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.FileReader; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.StringReader; import java.net.URL; import java.nio.charset.Charset; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; import net.sourceforge.jnlp.IconDesc; import net.sourceforge.jnlp.JNLPFile; @@ -78,7 +87,7 @@ String fileContents = "[Desktop Entry]\n"; fileContents += "Version=1.0\n"; - fileContents += "Name=" + sanitize(file.getTitle()) + "\n"; + fileContents += "Name=" + getDesktopIconName() + "\n"; fileContents += "GenericName=Java Web Start Application\n"; fileContents += "Comment=" + sanitize(file.getInformation().getDescription()) + "\n"; fileContents += "Type=Application\n"; @@ -122,6 +131,12 @@ return iconSize; } + public File getShortcutTmpFile() { + String userTmp = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR); + File shortcutFile = new File(userTmp + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop"); + return shortcutFile; + } + /** * Set the icon size to use for the desktop shortcut * @@ -148,9 +163,7 @@ * Install this XDesktopEntry into the user's desktop as a launcher */ private void installDesktopLauncher() { - File shortcutFile = new File(JNLPRuntime.getConfiguration() - .getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR) - + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop"); + File shortcutFile = getShortcutTmpFile(); try { if (!shortcutFile.getParentFile().isDirectory() && !shortcutFile.getParentFile().mkdirs()) { @@ -234,4 +247,102 @@ } } + public String getDesktopIconName() { + return sanitize(file.getTitle()); + } + + public File getLinuxDesktopIconFile() { + return new File(findFreedesktopOrgDesktopPathCatch() + "/" + getDesktopIconName() + ".desktop"); + } + + private static String findFreedesktopOrgDesktopPathCatch() { + try { + return findFreedesktopOrgDesktopPath(); + } catch (Exception ex) { + ex.printStackTrace(); + return System.getProperty("user.home") + "/Desktop/"; + } + } + + /** + * Instead of having all this parsing of user-dirs.dirs and replacing + * variables we can execute `echo $(xdg-user-dir DESKTOP)` and it will do + * all the job in case approaches below become failing + * + * @return variables (if declared) and quotation marks (unless escaped) free + * path + * @throws IOException if no file do not exists or key with desktop do not + * exists + */ + private static String findFreedesktopOrgDesktopPath() throws IOException { + File userDirs = new File(System.getProperty("user.home") + "/.config/user-dirs.dirs"); + if (!userDirs.exists()) { + return System.getProperty("user.home") + "/Desktop/"; + } + return getFreedesktopOrgDesktopPathFrom(userDirs); + } + + private static String getFreedesktopOrgDesktopPathFrom(File userDirs) throws IOException { + BufferedReader r = new BufferedReader(new FileReader(userDirs)); + try { + return getFreedesktopOrgDesktopPathFrom(r); + } finally { + r.close(); + } + + } + static final String XDG_DESKTOP_DIR = "XDG_DESKTOP_DIR"; + + static String getFreedesktopOrgDesktopPathFrom(BufferedReader r) throws IOException { + while (true) { + String s = r.readLine(); + if (s == null) { + throw new IOException("End of user-dirs found, but no " + XDG_DESKTOP_DIR + " key found"); + } + s = s.trim(); + if (s.startsWith(XDG_DESKTOP_DIR)) { + if (!s.contains("=")) { + throw new IOException(XDG_DESKTOP_DIR + " has no value"); + } + String[] keyAndValue = s.split("="); + keyAndValue[1] = keyAndValue[1].trim(); + String filteredQuotes = filterQuotes(keyAndValue[1]); + return evaluateLinuxVariables(filteredQuotes); + } + } + } + private static final String MIC = "MAGIC_QUOTIN_ITW_CONSTANT_FOR_DUMMIES"; + + private static String filterQuotes(String string) { + //get rid of " but not of + String s = string.replaceAll("\\\\\"", MIC); + s = s.replaceAll("\"", ""); + s = s.replaceAll(MIC, "\\\""); + return s; + } + + private static String evaluateLinuxVariables(String orig) { + return evaluateLinuxVariables(orig, System.getenv()); + } + + private static String evaluateLinuxVariables(String orig, Map variables) { + Set> env = variables.entrySet(); + List> envVariables = new ArrayList>(env); + Collections.sort(envVariables, new Comparator>() { + @Override + public int compare(Entry o1, Entry o2) { + return o2.getKey().length() - o1.getKey().length(); + } + }); + while (true) { + String before = orig; + for (Entry entry : envVariables) { + orig = orig.replaceAll("\\$" + entry.getKey(), entry.getValue()); + } + if (before.equals(orig)) { + return orig; + } + } + + } } diff -Nru icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Version.java icedtea-web-1.4/netx/net/sourceforge/jnlp/Version.java --- icedtea-web-1.3.2/netx/net/sourceforge/jnlp/Version.java 2013-04-10 11:40:23.858668000 +0000 +++ icedtea-web-1.4/netx/net/sourceforge/jnlp/Version.java 2013-05-03 19:08:24.219520511 +0000 @@ -308,42 +308,6 @@ public String toString() { return versionString; - } - - /** - * Test. - */ - /* - public static void main(String args[]) { - Version jvms[] = { - new Version("1.1* 1.3*"), - new Version("1.2+"), - }; - - Version versions[] = { - new Version("1.1"), - new Version("1.1.8"), - new Version("1.2"), - new Version("1.3"), - new Version("2.0"), - new Version("1.3.1"), - new Version("1.2.1"), - new Version("1.3.1-beta"), - new Version("1.1 1.2"), - new Version("1.2 1.3"), - }; - - for (int j = 0; j < jvms.length; j++) { - for (int v = 0; v < versions.length; v++) { - System.out.print( jvms[j].toString() + " " ); - if (!jvms[j].matches(versions[v])) - System.out.print( "!" ); - System.out.println( "matches " + versions[v].toString() ); - } - } - - System.out.println("Test completed"); - } - */ + } } diff -Nru icedtea-web-1.3.2/NEWS icedtea-web-1.4/NEWS --- icedtea-web-1.3.2/NEWS 2013-04-11 13:23:09.524057000 +0000 +++ icedtea-web-1.4/NEWS 2013-05-03 19:08:24.129521641 +0000 @@ -8,28 +8,45 @@ CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY -New in release 1.3.2 (2013-04-17): -* Security Updates - - CVE-2013-1927, RH884705: fixed gifar vulnerability +New in release 1.4 (2013-05-02): +* Added cs localization +* Added de localization +* Added pl localization +* Splash screen for javaws and plugin +* Better error reporting for plugin via Error-splash-screen +* All IcedTea-Web dialogues are centered to middle of active screen +* Download indicator made compact for more then one jar +* User can select its own JVM via itw-settings and deploy.properties. +* Added extended applets security settings and dialogue +* Security updates - CVE-2013-1926, RH916774: Class-loader incorrectly shared for applets with same relative-path. -* Common - - Added new option in itw-settings which allows users to set JVM arguments when plugin is initialized. + - CVE-2013-1927, RH884705: fixed gifar vulnerabilit + - CVE-2012-3422, RH840592: Potential read from an uninitialized memory location + - CVE-2012-3423, RH841345: Incorrect handling of not 0-terminated strings * NetX - - PR580: http://www.horaoficial.cl/ loads improperly + - PR1027: DownloadService is not supported by IcedTea-Web + - PR725: JNLP applications will prompt for creating desktop shortcuts every time they are run + - PR1292: Javaws does not resolve versioned jar names with periods correctly * Plugin - PR1260: IcedTea-Web should not rely on GTK - PR1157: Applets can hang browser after fatal exception - -New in release 1.3.1 (2012-11-07): -* Security Updates - - CVE-2012-4540, RH869040: Heap-based buffer overflow after triggering event attached to applet + - PR1106: Buffer overflow in plugin table- + - PR1166: Embedded JNLP File is not supported in applet tag + - PR1217: Add command line arguments for plugins + - PR1189: Icedtea-plugin requires code attribute when using jnlp_href + - PR1198: JSObject is not passed to javascript correctly + - PR1260: IcedTea-Web should not rely on GTK + - PR1157: Applets can hang browser after fatal exception + - PR580: http://www.horaoficial.cl/ loads improperly * Common + - PR1049: Extension jnlp's signed jar with the content of only META-INF/* is considered + - PR955: regression: SweetHome3D fails to run + - PR1145: IcedTea-Web can cause ClassCircularityError - PR1161: X509VariableTrustManager does not work correctly with OpenJDK7 + - PR822: Applets fail to load if jars have different signers + - PR1186: System.getProperty("deployment.user.security.trusted.cacerts") is null + - PR909: The Java applet at http://de.gosupermodel.com/games/wardrobegame.jsp fails + - PR1299: WebStart doesn't read socket proxy settings from firefox correctly -New in release 1.3 (2012-09-04): -* Security updates - - CVE-2012-3422, RH840592: Potential read from an uninitialized memory location - - CVE-2012-3423, RH841345: Incorrect handling of not 0-terminated strings +New in release 1.3 (2012-XX-XX): * NetX - PR898: signed applications with big jnlp-file doesn't start (webstart affect like "frozen") - PR811: javaws is not handling urls with spaces (and other characters needing encoding) correctly @@ -42,16 +59,13 @@ - PR722: META-INF/ unsigned entries should be ignored in signing - PR855: AppletStub getDocumentBase() doesn't return full URL - PR1011: Folders treated as jar files in archive tag - - PR1106: Buffer overflow in plugin table - - PR975: Plugin should not include classpaths specified in jar manifests when using jnlp_href - PR588: Cookies not written from cookie jar to browser cookies + - PR920: Classes attempted to load twice when class extends from outside jar * Common - PR918: java applet windows uses a low resulution black/white icon - RH838417: Disambiguate signed applet security prompt from certificate warning - RH838559: Disambiguate signed applet security prompt from certificate warning - RH720836: project can be compiled against GTK+ 2 or 3 librarie - - PR955: regression: SweetHome3D fails to run - - PR1161: X509VariableTrustManager does not work correctly with OpenJDK7 New in release 1.2 (2011-XX-XX): * Security updates: diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc icedtea-web-1.4/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc 2013-04-10 11:40:23.899668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc 2013-05-03 19:08:24.420517985 +0000 @@ -131,7 +131,7 @@ !message_parts->at(4)->find("GetObjectArrayElement")) { - if (!message_parts->at(5)->find("literalreturn")) + if (!message_parts->at(5)->find("literalreturn") || !message_parts->at(5)->find("jsobject")) { // literal returns don't have a corresponding jni id result->return_identifier = 0; diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaNPPlugin.cc icedtea-web-1.4/plugin/icedteanp/IcedTeaNPPlugin.cc --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaNPPlugin.cc 2013-04-10 11:40:23.911668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaNPPlugin.cc 2013-05-03 19:13:35.986601465 +0000 @@ -43,35 +43,18 @@ #include #include #include +#include #include #include #include +//IcedTea-plugin includes +#include "IcedTeaPluginUtils.h" +#include "IcedTeaParseProperties.h" // Liveconnect extension #include "IcedTeaScriptablePluginObject.h" #include "IcedTeaNPPlugin.h" -#if MOZILLA_VERSION_COLLAPSED < 1090100 -// Documentbase retrieval includes. -#include -#include -#include - -// API's into Mozilla -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif // Error reporting macros. #define PLUGIN_ERROR(message) \ @@ -148,16 +131,12 @@ #define FAILURE_MESSAGE "icedteanp plugin error: Failed to run %s." \ " For more detail rerun \"firefox -g\" in a terminal window." -#if MOZILLA_VERSION_COLLAPSED < 1090100 -// Documentbase retrieval required definition. -static NS_DEFINE_IID (kIPluginTagInfo2IID, NS_IPLUGINTAGINFO2_IID); -#endif - // Data directory for plugin. -static gchar* data_directory = NULL; +static std::string data_directory; -// Fully-qualified appletviewer executable. -static gchar* appletviewer_executable = NULL; +// Fully-qualified appletviewer default executable and rt.jar +static const char* appletviewer_default_executable = ICEDTEA_WEB_JRE "/bin/java"; +static const char* appletviewer_default_rtjar = ICEDTEA_WEB_JRE "/lib/rt.jar"; // Applet viewer input channel (needs to be static because it is used in plugin_in_pipe_callback) static GIOChannel* in_from_appletviewer = NULL; @@ -204,14 +183,6 @@ // Sends messages to Java over the bus JavaMessageSender* java_req_proc; -#if MOZILLA_VERSION_COLLAPSED < 1090100 -// Documentbase retrieval type-punning union. -typedef union -{ - void** void_field; - nsIPluginTagInfo2** info_field; -} info_union; -#endif // Static instance helper functions. // Have the browser allocate a new ITNPPluginData structure. @@ -227,8 +198,7 @@ GIOCondition condition, gpointer plugin_data); static NPError plugin_start_appletviewer (ITNPPluginData* data); -static gchar* plugin_create_applet_tag (int16_t argc, char* argn[], - char* argv[]); +std::string plugin_parameters_string (int argc, char* argn[], char* argv[]); static void plugin_stop_appletviewer (); // Uninitialize ITNPPluginData structure static void plugin_data_destroy (NPP instance); @@ -242,7 +212,7 @@ int width, int height, char* url); /* Returns JVM options set in itw-settings */ -static std::vector* get_jvm_args(); +std::vector* get_jvm_args(); // Global instance counter. // Mutex to protect plugin_instance_counter. @@ -285,6 +255,32 @@ #endif +static std::string get_plugin_executable(){ + std::string custom_jre; + bool custom_jre_defined = find_custom_jre(custom_jre); + if (custom_jre_defined) { + if (IcedTeaPluginUtilities::file_exists(custom_jre+"/bin/java")){ + return custom_jre+"/bin/java"; + } else { + fprintf(stderr, "Your custom jre (/bin/java check) %s is not valid. Please fix %s in your %s. In attempt to run using default one. \n", custom_jre.c_str(), custom_jre_key.c_str(), default_file_ITW_deploy_props_name.c_str()); + } + } + return appletviewer_default_executable; +} + +static std::string get_plugin_rt_jar(){ + std::string custom_jre; + bool custom_jre_defined = find_custom_jre(custom_jre); + if (custom_jre_defined) { + if (IcedTeaPluginUtilities::file_exists(custom_jre+"/lib/rt.jar")){ + return custom_jre+"/lib/rt.jar"; + } else { + fprintf(stderr, "Your custom jre (/lib/rt.jar check) %s is not valid. Please fix %s in your %s. In attempt to run using default one. \n", custom_jre.c_str(), custom_jre_key.c_str(), default_file_ITW_deploy_props_name.c_str()); + } + } + return appletviewer_default_rtjar; +} + /* * Find first member in GHashTable* depending on version of glib @@ -313,7 +309,7 @@ // Creates a new icedtea np plugin instance. This function creates a // ITNPPluginData* and stores it in instance->pdata. The following -// ITNPPluginData fiels are initialized: instance_id, in_pipe_name, +// ITNPPluginData fields are initialized: instance_id, in_pipe_name, // in_from_appletviewer, in_watch_source, out_pipe_name, // out_to_appletviewer, out_watch_source, appletviewer_mutex, owner, // appletviewer_alive. In addition two pipe files are created. All @@ -347,7 +343,6 @@ gchar* documentbase = NULL; gchar* read_message = NULL; - gchar* applet_tag = NULL; gchar* cookie_info = NULL; NPObject* npPluginObj = NULL; @@ -395,11 +390,10 @@ documentbase = plugin_get_documentbase (instance); if (documentbase && argc != 0) { - // Send applet tag message to appletviewer. - applet_tag = plugin_create_applet_tag (argc, argn, argv); + // Send parameters to appletviewer. + std::string params_string = plugin_parameters_string(argc, argn, argv); - data->applet_tag = (gchar*) malloc(strlen(applet_tag)*sizeof(gchar) + strlen(documentbase)*sizeof(gchar) + 32); - g_sprintf(data->applet_tag, "tag %s %s", documentbase, applet_tag); + data->parameters_string = g_strdup_printf("tag %s %s", documentbase, params_string.c_str()); data->is_applet_instance = true; } @@ -424,33 +418,7 @@ instance->pdata = data; - goto cleanup_done; - - cleanup_appletviewer_mutex: - g_mutex_free (data->appletviewer_mutex); - data->appletviewer_mutex = NULL; - - // cleanup_instance_string: - g_free (data->instance_id); - data->instance_id = NULL; - - // cleanup applet tag: - g_free (data->applet_tag); - data->applet_tag = NULL; - - // cleanup_data: - // Eliminate back-pointer to plugin instance. - data->owner = NULL; - (*browser_functions.memfree) (data); - data = NULL; - - // Initialization failed so return a NULL pointer for the browser - // data. - instance->pdata = NULL; - cleanup_done: - g_free (applet_tag); - applet_tag = NULL; g_free (read_message); read_message = NULL; g_free (documentbase); @@ -496,7 +464,7 @@ // in_pipe_name in_pipe_name = g_strdup_printf ("%s/%d-icedteanp-appletviewer-to-plugin", - data_directory, getpid()); + data_directory.c_str(), getpid()); if (!in_pipe_name) { PLUGIN_ERROR ("Failed to create input pipe name."); @@ -523,7 +491,7 @@ // out_pipe_name out_pipe_name = g_strdup_printf ("%s/%d-icedteanp-plugin-to-appletviewer", - data_directory, getpid()); + data_directory.c_str(), getpid()); if (!out_pipe_name) { @@ -834,7 +802,7 @@ // Now we have everything. Send this data to the Java side plugin_send_initialization_message( data->instance_id, (gulong) data->window_handle, - data->window_width, data->window_height, data->applet_tag); + data->window_width, data->window_height, data->parameters_string); g_mutex_unlock (data->appletviewer_mutex); @@ -930,38 +898,6 @@ { return NPERR_GENERIC_ERROR; } -#if MOZILLA_VERSION_COLLAPSED < 1090100 - nsresult rv; - nsCOMPtr sec_man = - do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv); - - if (!sec_man) { - return NPERR_GENERIC_ERROR; - } - - nsCOMPtr io_svc = do_GetService("@mozilla.org/network/io-service;1", &rv); - - if (NS_FAILED(rv) || !io_svc) { - return NPERR_GENERIC_ERROR; - } - - nsCOMPtr uri; - io_svc->NewURI(nsCString(siteAddr), NULL, NULL, getter_AddRefs(uri)); - - nsCOMPtr cookie_svc = do_GetService("@mozilla.org/cookieService;1", &rv); - - if (NS_FAILED(rv) || !cookie_svc) { - return NPERR_GENERIC_ERROR; - } - - rv = cookie_svc->GetCookieString(uri, NULL, cookieString); - - if (NS_FAILED(rv) || !*cookieString) { - return NPERR_GENERIC_ERROR; - } - -#else - // getvalueforurl needs an NPP instance. Quite frankly, there is no easy way // to know which instance needs the information, as applets on Java side can // be multi-threaded and the thread making a proxy.cookie request cannot be @@ -980,8 +916,6 @@ return NPERR_GENERIC_ERROR; } -#endif - return NPERR_NO_ERROR; } @@ -1022,71 +956,7 @@ // Documentbase retrieval. This function gets the current document's // documentbase. This function relies on browser-private data so it // will only work when the plugin is loaded in a Mozilla-based -// browser. We could not find a way to retrieve the documentbase -// using the original Netscape plugin API so we use the XPCOM API -// instead. -#if MOZILLA_VERSION_COLLAPSED < 1090100 -static gchar* -plugin_get_documentbase (NPP instance) -{ - PLUGIN_DEBUG ("plugin_get_documentbase\n"); - - nsIPluginInstance* xpcom_instance = NULL; - nsIPluginInstancePeer* peer = NULL; - nsresult result = 0; - nsIPluginTagInfo2* pluginTagInfo2 = NULL; - info_union u = { NULL }; - char const* documentbase = NULL; - gchar* documentbase_copy = NULL; - - xpcom_instance = (nsIPluginInstance*) (instance->ndata); - if (!xpcom_instance) - { - PLUGIN_ERROR ("xpcom_instance is NULL."); - goto cleanup_done; - } - - xpcom_instance->GetPeer (&peer); - if (!peer) - { - PLUGIN_ERROR ("peer is NULL."); - goto cleanup_done; - } - - u.info_field = &pluginTagInfo2; - - result = peer->QueryInterface (kIPluginTagInfo2IID, - u.void_field); - if (result || !pluginTagInfo2) - { - PLUGIN_ERROR ("pluginTagInfo2 retrieval failed."); - goto cleanup_peer; - } - - pluginTagInfo2->GetDocumentBase (&documentbase); - - if (!documentbase) - { - // NULL => dummy instantiation for LiveConnect - goto cleanup_plugintaginfo2; - } - - documentbase_copy = g_strdup (documentbase); - - // Release references. - cleanup_plugintaginfo2: - NS_RELEASE (pluginTagInfo2); - - cleanup_peer: - NS_RELEASE (peer); - - cleanup_done: - PLUGIN_DEBUG ("plugin_get_documentbase return\n"); - - PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy); - return documentbase_copy; -} -#else +// browser. static gchar* plugin_get_documentbase (NPP instance) { @@ -1125,7 +995,6 @@ return documentbase_copy; } -#endif // plugin_in_pipe_callback is called when data is available on the // input pipe, or when the appletviewer crashes or is killed. It may @@ -1186,7 +1055,7 @@ gchar** parts = g_strsplit (message, " ", 5); if (g_str_has_prefix(parts[1], "PluginProxyInfo")) { - gchar* proxy; + gchar* proxy = NULL; uint32_t len; gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, sizeof(gchar)); @@ -1195,10 +1064,6 @@ gchar* proxy_info; -#if MOZILLA_VERSION_COLLAPSED < 1090100 - proxy = (char*) malloc(sizeof(char)*2048); -#endif - proxy_info = g_strconcat ("plugin PluginProxyInfo reference ", parts[3], " ", NULL); if (get_proxy_info(decoded_url, &proxy, &len) == NPERR_NO_ERROR) { @@ -1213,10 +1078,8 @@ g_free(proxy_info); proxy_info = NULL; -#if MOZILLA_VERSION_COLLAPSED < 1090100 - g_free(proxy); - proxy = NULL; -#endif + g_free(proxy); + proxy = NULL; } else if (g_str_has_prefix(parts[1], "PluginCookieInfo")) { @@ -1224,7 +1087,7 @@ IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url); gchar* cookie_info = g_strconcat ("plugin PluginCookieInfo reference ", parts[3], " ", NULL); - gchar* cookie_string; + gchar* cookie_string = NULL; uint32_t len; if (get_cookie_info(decoded_url, &cookie_string, &len) == NPERR_NO_ERROR) { @@ -1238,6 +1101,8 @@ decoded_url = NULL; g_free(cookie_info); cookie_info = NULL; + g_free(cookie_string); + cookie_string = NULL; } else if (g_str_has_prefix(parts[1], "PluginSetCookie")) { // Message structure: plugin PluginSetCookie reference -1 @@ -1366,76 +1231,6 @@ { return NPERR_GENERIC_ERROR; } -#if MOZILLA_VERSION_COLLAPSED < 1090100 - nsresult rv; - - // Initialize service variables - nsCOMPtr proxy_svc = do_GetService("@mozilla.org/network/protocol-proxy-service;1", &rv); - - if (!proxy_svc) { - printf("Cannot initialize proxy service\n"); - return NPERR_GENERIC_ERROR; - } - - nsCOMPtr io_svc = do_GetService("@mozilla.org/network/io-service;1", &rv); - - if (NS_FAILED(rv) || !io_svc) { - printf("Cannot initialize io service\n"); - return NPERR_GENERIC_ERROR; - } - - // uri which needs to be accessed - nsCOMPtr uri; - io_svc->NewURI(nsCString(siteAddr), NULL, NULL, getter_AddRefs(uri)); - - // find the proxy address if any - nsCOMPtr info; - proxy_svc->Resolve(uri, 0, getter_AddRefs(info)); - - // if there is no proxy found, return immediately - if (!info) { - PLUGIN_DEBUG("%s does not need a proxy\n", siteAddr); - return NPERR_GENERIC_ERROR; - } - - // if proxy info is available, extract it - nsCString phost; - PRInt32 pport; - nsCString ptype; - - info->GetHost(phost); - info->GetPort(&pport); - info->GetType(ptype); - - // resolve the proxy address to an IP - nsCOMPtr dns_svc = do_GetService("@mozilla.org/network/dns-service;1", &rv); - - if (!dns_svc) { - printf("Cannot initialize DNS service\n"); - return NPERR_GENERIC_ERROR; - } - - nsCOMPtr record; - dns_svc->Resolve(phost, 0U, getter_AddRefs(record)); - - // TODO: Add support for multiple ips - nsDependentCString ipAddr; - record->GetNextAddrAsString(ipAddr); - - if (!strcmp(ptype.get(), "http")) - { - snprintf(*proxy, sizeof(char)*1024, "%s %s:%d", "PROXY", ipAddr.get(), pport); - } else - { - snprintf(*proxy, sizeof(char)*1024, "%s %s:%d", "SOCKS", ipAddr.get(), pport); - } - - *len = strlen(*proxy); - - PLUGIN_DEBUG("Proxy info for %s: %s\n", siteAddr, *proxy); - -#else - if (browser_functions.getvalueforurl) { @@ -1446,7 +1241,6 @@ { return NPERR_GENERIC_ERROR; } -#endif return NPERR_NO_ERROR; } @@ -1546,13 +1340,14 @@ static NPError plugin_test_appletviewer () { - PLUGIN_DEBUG ("plugin_test_appletviewer: %s\n", appletviewer_executable); + + PLUGIN_DEBUG ("plugin_test_appletviewer: %s\n", get_plugin_executable().c_str()); NPError error = NPERR_NO_ERROR; gchar* command_line[3] = { NULL, NULL, NULL }; gchar** environment; - command_line[0] = g_strdup (appletviewer_executable); + command_line[0] = g_strdup (get_plugin_executable().c_str()); command_line[1] = g_strdup("-version"); command_line[2] = NULL; @@ -1599,7 +1394,7 @@ // Construct command line parameters - command_line.push_back(appletviewer_executable); + command_line.push_back(get_plugin_executable()); //Add JVM args to command_line for (int i = 0; i < jvm_args->size(); i++) @@ -1610,7 +1405,12 @@ command_line.push_back(PLUGIN_BOOTCLASSPATH); // set the classpath to avoid using the default (cwd). command_line.push_back("-classpath"); - command_line.push_back(ICEDTEA_WEB_JRE "/lib/rt.jar"); + command_line.push_back(get_plugin_rt_jar()); + + // Enable coverage agent if we are running instrumented plugin +#ifdef COVERAGE_AGENT + command_line.push_back(COVERAGE_AGENT); +#endif if (plugin_debug) { @@ -1669,202 +1469,80 @@ /* * Returns JVM options set in itw-settings */ -static std::vector* +std::vector* get_jvm_args() { - std::vector < std::string> commands; - gchar *output = NULL; + std::string output; std::vector* tokenOutput = NULL; - - commands.push_back(appletviewer_executable); - commands.push_back(PLUGIN_BOOTCLASSPATH); - commands.push_back("-classpath"); - commands.push_back(ICEDTEA_WEB_JRE "/lib/rt.jar"); - commands.push_back("net.sourceforge.jnlp.controlpanel.CommandLine"); - commands.push_back("get"); - commands.push_back("deployment.plugin.jvm.arguments"); - - std::vector vector_gchar = IcedTeaPluginUtilities::vectorStringToVectorGchar(&commands); - gchar **command_line_args = &vector_gchar[0]; - - if (!g_spawn_sync(NULL, command_line_args, NULL, - (GSpawnFlags) G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, &output, NULL, NULL, - &channel_error)) - { - PLUGIN_ERROR("Failed to get JVM arguments set for plugin."); - output = NULL; - } - - tokenOutput = IcedTeaPluginUtilities::strSplit(output, " \n"); - - if (!tokenOutput->empty() && *tokenOutput->at(0) =="null") - { - delete tokenOutput->at(0); - tokenOutput->erase(tokenOutput->begin()); + bool args_defined = read_deploy_property_value("deployment.plugin.jvm.arguments", output); + if (!args_defined){ + return new std::vector(); } - - //Free memory - g_free(output); - output = NULL; - command_line_args = NULL; - + tokenOutput = IcedTeaPluginUtilities::strSplit(output.c_str(), " \n"); return tokenOutput; } /* - * Replaces certain characters (\r, \n, etc) with HTML escape equivalents. - * - * Return string is allocated on the heap. Caller assumes responsibility - * for freeing the memory via free() + * Escape characters for passing to Java. + * "\n" for new line, "\\" for "\", "\:" for ";" */ -static char* -encode_string(char* to_encode) -{ +std::string +escape_parameter_string(const char* to_encode) { + std::string encoded; - // Do nothing for an empty string - if (to_encode == '\0') - return to_encode; - - // worst case scenario -> all characters are newlines or - // returns, each of which translates to 5 substitutions - char* encoded = (char*) calloc(((strlen(to_encode)*5)+1), sizeof(char)); - - strcpy(encoded, ""); - - for (int i=0; i < strlen(to_encode); i++) - { - if (to_encode[i] == '\r') - encoded = strcat(encoded, " "); - else if (to_encode[i] == '\n') - encoded = strcat(encoded, " "); - else if (to_encode[i] == '>') - encoded = strcat(encoded, ">"); - else if (to_encode[i] == '<') - encoded = strcat(encoded, "<"); - else if (to_encode[i] == '&') - encoded = strcat(encoded, "&"); - else if (to_encode[i] == '"') - encoded = strcat(encoded, """); + if (to_encode == NULL) + { + return encoded; + } + + size_t length = strlen(to_encode); + for (int i = 0; i < length; i++) + { + if (to_encode[i] == '\n') + encoded += "\\n"; + else if (to_encode[i] == '\\') + encoded += "\\\\"; + else if (to_encode[i] == ';') + encoded += "\\:"; else - { - char* orig_char = (char*) calloc(2, sizeof(char)); - orig_char[0] = to_encode[i]; - orig_char[1] = '\0'; - - strcat(encoded, orig_char); - - free(orig_char); - orig_char = NULL; - } + encoded += to_encode[i]; } return encoded; } -// Build up the applet tag string that we'll send to the applet -// viewer. -static gchar* -plugin_create_applet_tag (int16_t argc, char* argn[], char* argv[]) +/* + * Build a string containing an encoded list of parameters to send to the applet viewer. + * The parameters are separated as 'key1;value1;key2;value2;'. As well, they are + * separated and escaped as: + * "\n" for new line, "\\" for "\", "\:" for ";" + */ +std::string +plugin_parameters_string (int argc, char* argn[], char* argv[]) { - PLUGIN_DEBUG ("plugin_create_applet_tag\n"); + PLUGIN_DEBUG ("plugin_parameters_string\n"); - gchar* applet_tag = g_strdup ("", NULL); - } - } - - free(argn_escaped); - free(argv_escaped); - - argn_escaped = NULL; - argv_escaped = NULL; - } - - applet_tag = g_strconcat (applet_tag, ">", parameters, "", NULL); - - g_free (parameters); - parameters = NULL; + } - PLUGIN_DEBUG ("plugin_create_applet_tag return\n"); + PLUGIN_DEBUG ("plugin_parameters_string return\n"); - return applet_tag; + return parameters; } // plugin_send_message_to_appletviewer must be called while holding @@ -2075,8 +1753,8 @@ tofree->instance_id = NULL; // cleanup applet tag - g_free (tofree->applet_tag); - tofree->applet_tag = NULL; + g_free (tofree->parameters_string); + tofree->parameters_string = NULL; g_free(tofree->source); tofree->source = NULL; @@ -2093,11 +1771,7 @@ static bool initialize_browser_functions(const NPNetscapeFuncs* browserTable) { -#if MOZILLA_VERSION_COLLAPSED < 1090100 -#define NPNETSCAPEFUNCS_LAST_FIELD_USED (browserTable->pluginthreadasynccall) -#else #define NPNETSCAPEFUNCS_LAST_FIELD_USED (browserTable->setvalueforurl) -#endif //Determine the size in bytes, as a difference of the address past the last used field //And the browser table address @@ -2139,20 +1813,6 @@ pluginTable->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; pluginTable->size = sizeof (NPPluginFuncs); - -#if MOZILLA_VERSION_COLLAPSED < 1090100 - pluginTable->newp = NewNPP_NewProc (ITNP_New); - pluginTable->destroy = NewNPP_DestroyProc (ITNP_Destroy); - pluginTable->setwindow = NewNPP_SetWindowProc (ITNP_SetWindow); - pluginTable->newstream = NewNPP_NewStreamProc (ITNP_NewStream); - pluginTable->destroystream = NewNPP_DestroyStreamProc (ITNP_DestroyStream); - pluginTable->asfile = NewNPP_StreamAsFileProc (ITNP_StreamAsFile); - pluginTable->writeready = NewNPP_WriteReadyProc (ITNP_WriteReady); - pluginTable->write = NewNPP_WriteProc (ITNP_Write); - pluginTable->print = NewNPP_PrintProc (ITNP_Print); - pluginTable->urlnotify = NewNPP_URLNotifyProc (ITNP_URLNotify); - pluginTable->getvalue = NewNPP_GetValueProc (ITNP_GetValue); -#else pluginTable->newp = NPP_NewProcPtr (ITNP_New); pluginTable->destroy = NPP_DestroyProcPtr (ITNP_Destroy); pluginTable->setwindow = NPP_SetWindowProcPtr (ITNP_SetWindow); @@ -2164,7 +1824,6 @@ pluginTable->print = NPP_PrintProcPtr (ITNP_Print); pluginTable->urlnotify = NPP_URLNotifyProcPtr (ITNP_URLNotify); pluginTable->getvalue = NPP_GetValueProcPtr (ITNP_GetValue); -#endif return true; } @@ -2180,6 +1839,7 @@ // this function, then it is evident that NP_Initialize has already // been called. There is no need to call this function more than once and // this workaround avoids any duplicate calls. +__attribute__ ((visibility ("default"))) NPError NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable) { @@ -2234,91 +1894,67 @@ if (initialized) return NPERR_NO_ERROR; + NPError np_error = NPERR_NO_ERROR; + // Make sure the plugin data directory exists, creating it if // necessary. - data_directory = g_strconcat (P_tmpdir, NULL); - if (!data_directory) + + const char* tmpdir_env = getenv("TMPDIR"); + if (tmpdir_env != NULL && g_file_test (tmpdir_env, + (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { - PLUGIN_ERROR ("Failed to create data directory name."); - return NPERR_OUT_OF_MEMORY_ERROR; + data_directory = tmpdir_env; } - NPError np_error = NPERR_NO_ERROR; - gchar* filename = NULL; - - // If P_tmpdir does not exist, try /tmp directly - - if (!g_file_test (data_directory, + else if (g_file_test (P_tmpdir, (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { - int file_error = 0; - - data_directory = g_strconcat ("/tmp", NULL); - if (!data_directory) - { - PLUGIN_ERROR ("Failed to create data directory name."); - return NPERR_OUT_OF_MEMORY_ERROR; - } - + data_directory = P_tmpdir; + } + else + { + // If TMPDIR and P_tmpdir do not exist, try /tmp directly + data_directory = "/tmp"; } - data_directory = g_strconcat (data_directory, "/icedteaplugin-", getenv("USER"), NULL); - - if (!data_directory) - { - PLUGIN_ERROR ("Failed to create data directory name."); - return NPERR_OUT_OF_MEMORY_ERROR; - } + data_directory += "/icedteaplugin-"; + if (getenv("USER") != NULL) + data_directory += getenv("USER"); // Now create a icedteaplugin subdir - if (!g_file_test (data_directory, + if (!g_file_test (data_directory.c_str(), (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { int file_error = 0; - file_error = g_mkdir (data_directory, 0700); + file_error = g_mkdir (data_directory.c_str(), 0700); if (file_error != 0) { PLUGIN_ERROR_THREE ("Failed to create data directory", - data_directory, + data_directory.c_str(), strerror (errno)); - np_error = NPERR_GENERIC_ERROR; - goto cleanup_data_directory; + return NPERR_GENERIC_ERROR; } } - // If data directory doesn't exit by this point, bail - if (!g_file_test (data_directory, + // If data directory doesn't exist by this point, bail + if (!g_file_test (data_directory.c_str(), (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { PLUGIN_ERROR_THREE ("Temp directory does not exist: ", - data_directory, + data_directory.c_str(), strerror (errno)); - - np_error = NPERR_GENERIC_ERROR; - goto cleanup_data_directory; - + return NPERR_GENERIC_ERROR; } // Set appletviewer_executable. - filename = g_strdup(ICEDTEA_WEB_JRE); - appletviewer_executable = g_strdup_printf ("%s/bin/java", - filename); - PLUGIN_DEBUG("Executing java at %s\n", appletviewer_executable); - if (!appletviewer_executable) - { - PLUGIN_ERROR ("Failed to create appletviewer executable name."); - np_error = NPERR_OUT_OF_MEMORY_ERROR; - goto cleanup_filename; - } - + PLUGIN_DEBUG("Executing java at %s\n", get_plugin_executable().c_str()); np_error = plugin_test_appletviewer (); if (np_error != NPERR_NO_ERROR) { - fprintf(stderr, "Unable to find java executable %s\n", appletviewer_executable); - goto cleanup_appletviewer_executable; + fprintf(stderr, "Unable to find java executable %s\n", get_plugin_executable().c_str()); + return np_error; } - g_free (filename); initialized = true; @@ -2328,7 +1964,7 @@ plugin_instance_mutex = g_mutex_new (); - PLUGIN_DEBUG ("NP_Initialize: using %s\n", appletviewer_executable); + PLUGIN_DEBUG ("NP_Initialize: using %s\n", get_plugin_executable().c_str()); plugin_req_proc = new PluginRequestProcessor(); java_req_proc = new JavaMessageSender(); @@ -2354,34 +1990,11 @@ PLUGIN_DEBUG ("NP_Initialize return\n"); return NPERR_NO_ERROR; - - cleanup_appletviewer_executable: - if (appletviewer_executable) - { - g_free (appletviewer_executable); - appletviewer_executable = NULL; - } - - cleanup_filename: - if (filename) - { - g_free (filename); - filename = NULL; - } - - cleanup_data_directory: - if (data_directory) - { - g_free (data_directory); - data_directory = NULL; - } - - - return np_error; } // Returns a string describing the MIME type that this plugin // handles. +__attribute__ ((visibility ("default"))) #ifdef LEGACY_XULRUNNERAPI char* #else @@ -2398,6 +2011,7 @@ // Returns a value relevant to the plugin as a whole. The browser // calls this function to obtain information about the plugin. +__attribute__ ((visibility ("default"))) NPError NP_GetValue (void* future, NPPVariable variable, void* value) { @@ -2431,6 +2045,7 @@ // Shuts down the plugin. Called after the last plugin instance is // destroyed. +__attribute__ ((visibility ("default"))) NPError NP_Shutdown (void) { @@ -2443,18 +2058,6 @@ plugin_instance_mutex = NULL; } - if (data_directory) - { - g_free (data_directory); - data_directory = NULL; - } - - if (appletviewer_executable) - { - g_free (appletviewer_executable); - appletviewer_executable = NULL; - } - // stop the appletviewer plugin_stop_appletviewer(); @@ -2551,7 +2154,7 @@ // a 0 handle if (!data->window_handle) { - plugin_send_initialization_message(data->instance_id, 0, 0, 0, data->applet_tag); + plugin_send_initialization_message(data->instance_id, 0, 0, 0, data->parameters_string); } java_result = java_request.getAppletObjectInstance(id_str); diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaNPPlugin.h icedtea-web-1.4/plugin/icedteanp/IcedTeaNPPlugin.h --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaNPPlugin.h 2013-04-10 11:40:23.912668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaNPPlugin.h 2013-05-03 19:08:24.423517946 +0000 @@ -39,13 +39,9 @@ #ifndef __ICEDTEANPPLUGIN_H__ #define __ICEDTEANPPLUGIN_H__ -#if MOZILLA_VERSION_COLLAPSED < 1090100 -#include -#else #include #include #include -#endif // GLib includes. #include @@ -63,8 +59,8 @@ { // A unique identifier for this plugin window. gchar* instance_id; - // The applet tag sent to Java side - gchar* applet_tag; + // The parameter list string sent to Java side + gchar* parameters_string; // Mutex to protect appletviewer_alive. GMutex* appletviewer_mutex; // Back-pointer to the plugin instance to which this data belongs. diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaParseProperties.cc icedtea-web-1.4/plugin/icedteanp/IcedTeaParseProperties.cc --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaParseProperties.cc 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaParseProperties.cc 2013-05-03 19:08:24.423517946 +0000 @@ -0,0 +1,244 @@ +/* IcedTeaRunnable.cc + + Copyright (C) 2013 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "IcedTeaPluginUtils.h" + +#include "IcedTeaParseProperties.h" +/* + The public api is nearly impossible to test due to "hardcoded paths" + All public methods have theirs equivalents wit set-up-able files, and those are + tested. +*/ + +using namespace std; +//private api + +void remove_all_spaces(string& str); +bool get_property_value(string c, string& dest); +bool starts_with(string c1, string c2); +string user_properties_file(); +string main_properties_file(); +string default_java_properties_file(); +//for passing three dummy files +bool find_system_config_file(string main_file, string custom_jre_file, bool usecustom_jre, string default_java_file, string& dest); +bool find_property(string filename, string property, string& dest); +//for passing two dummy files +bool read_deploy_property_value(string user_file, string system_file, bool usesystem_file, string property, string& dest); +//for passing two dummy files +bool find_custom_jre(string user_file, string main_file,string& dest); +//end of non-public IcedTeaParseProperties api + + +void remove_all_spaces(string& str) +{ + for(int i=0; ipw_dir)+"/.icedtea/"+default_file_ITW_deploy_props_name; +} + + +string main_properties_file(){ + return "/etc/.java/deployment/"+default_file_ITW_deploy_props_name; +} + +string default_java_properties_file(){ + return ICEDTEA_WEB_JRE "/lib/"+default_file_ITW_deploy_props_name; +} + + +/* this is the same search done by icedtea-web settings: + try the main file in /etc/.java/deployment + if found, then return this file + try to find setUp jre + if found, then try if this file exists and end + if no jre custom jvm is set, then tries default jre + if its deploy file exists, then return + not found otherwise*/ +bool find_system_config_file(string& dest){ + string jdest; + bool found = find_custom_jre(jdest); + if (found) { + jdest = jdest + "/lib/"+default_file_ITW_deploy_props_name; + } + return find_system_config_file(main_properties_file(), jdest, found, default_java_properties_file(), dest); +} +//abstraction for testing purposes +bool find_system_config_file(string main_file, string custom_jre_file, bool usecustom_jre, string default_java_file, string& dest){ + if (IcedTeaPluginUtilities::file_exists(main_file)) { + dest = main_file; + return true; + } else { + if (usecustom_jre){ + if(IcedTeaPluginUtilities::file_exists(custom_jre_file) ) { + dest = custom_jre_file; + return true; + } + } else { + if(IcedTeaPluginUtilities::file_exists(default_java_file)) { + dest = default_java_file; + return true; + } + } + } +return false; //nothing of above found +} + +//Returns whether property was found, if found stores result in 'dest' +bool find_property(string filename, string property, string& dest){ + string property_matcher(property); + IcedTeaPluginUtilities::trim( property_matcher); + property_matcher= property_matcher+"="; + ifstream input( filename.c_str() ); + for( string line; getline( input, line ); ){ /* read a line */ + string copy = line; + //java tolerates spaces around = char, remove them for matching + remove_all_spaces(copy); + if (starts_with(copy, property_matcher)) { + //provide non-spaced value, trimming is done in get_property_value + get_property_value(line, dest); + return true; + } + } + + return false; + } + + +/* this is reimplementation of itw-settings operations + first check in user's settings, if found, return + then check in global file (see the magic of find_system_config_file)*/ +bool read_deploy_property_value(string property, string& dest){ + string futurefile; + bool found = find_system_config_file(futurefile); + return read_deploy_property_value(user_properties_file(), futurefile, found, property, dest); +} +//abstraction for testing purposes +bool read_deploy_property_value(string user_file, string system_file, bool usesystem_file, string property, string& dest){ + //is it in user's file? + bool found = find_property(user_file, property, dest); + if (found) { + return true; + } + //is it in global file? + if (usesystem_file) { + return find_property(system_file, property, dest); + } + return false; +} + +//This is different from common get property, as it is avoiding to search in *java* +//properties files +bool find_custom_jre(string& dest){ + return find_custom_jre(user_properties_file(), main_properties_file(), dest); +} +//abstraction for testing purposes +bool find_custom_jre(string user_file, string main_file,string& dest){ + string key = custom_jre_key; + if(IcedTeaPluginUtilities::file_exists(user_file)) { + bool a = find_property(user_file, key, dest); + if (a) { + return true; + } + } + if(IcedTeaPluginUtilities::file_exists(main_file)) { + return find_property(main_file, key, dest); + } +return false; +} + + + +int test_main(void){ + cout << ("user's settings file\n"); + cout << user_properties_file(); + cout << ("\nmain settings file:\n"); + cout << (main_properties_file()); + cout << ("\njava settings file \n"); + cout << (default_java_properties_file()); + cout << ("\nsystem config file\n"); + string a1; + find_system_config_file(a1); + cout << a1; + cout << ("\ncustom jre\n"); + string a2; + find_custom_jre(a2); + cout << a2; + cout << ("\nsome custom property\n"); + string a3; + read_deploy_property_value("deployment.security.level", a3); + cout << a3; + cout << ("\n"); + return 0; +} diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaParseProperties.h icedtea-web-1.4/plugin/icedteanp/IcedTeaParseProperties.h --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaParseProperties.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaParseProperties.h 2013-05-03 19:08:24.424517933 +0000 @@ -0,0 +1,53 @@ +/* IcedTeaPluginUtils.h + + Copyright (C) 2013 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +/** + * Utility classes for parsing values from properties files + */ +#include + + +//public api +std::string user_properties_file(); +bool find_system_config_file(std::string& dest); +bool find_custom_jre(std::string& dest); +bool read_deploy_property_value(std::string property, std::string& dest); +//half public api +const std::string default_file_ITW_deploy_props_name = "deployment.properties"; +const std::string custom_jre_key = "deployment.jre.dir"; +//end of public api diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc icedtea-web-1.4/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc 2013-04-10 11:40:23.914668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc 2013-05-03 19:08:24.425517921 +0000 @@ -413,7 +413,7 @@ member = (NPVariant*) (IcedTeaPluginUtilities::stringToJSID(*(message_parts->at(5)))); propertyNameID = *(message_parts->at(6)); - if (*(message_parts->at(7)) == "literalreturn") + if (*(message_parts->at(7)) == "literalreturn" || *(message_parts->at(7)) == "jsobject" ) { value.append(*(message_parts->at(7))); value.append(" "); @@ -471,7 +471,7 @@ * * This is a static function, called in another thread. Since certain data * can only be requested from the main thread in Mozilla, this function - * does whatever it can seperately, and then makes an internal request that + * does whatever it can separately, and then makes an internal request that * causes _getMember to do the rest of the work. * * @param message_parts The request message @@ -838,17 +838,10 @@ window_ptr = (NPObject*) call_data->at(1); script_str = (std::string*) call_data->at(2); -#if MOZILLA_VERSION_COLLAPSED < 1090200 - script.utf8characters = script_str->c_str(); - script.utf8length = script_str->size(); - - PLUGIN_DEBUG("Evaluating: %s\n", script_str->c_str()); -#else script.UTF8Characters = script_str->c_str(); script.UTF8Length = script_str->size(); PLUGIN_DEBUG("Evaluating: %s\n", script_str->c_str()); -#endif ((AsyncCallThreadData*) data)->call_successful = browser_functions.evaluate(instance, window_ptr, &script, eval_variant); IcedTeaPluginUtilities::printNPVariant(*eval_variant); diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaPluginRequestProcessor.h icedtea-web-1.4/plugin/icedteanp/IcedTeaPluginRequestProcessor.h --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaPluginRequestProcessor.h 2013-04-10 11:40:23.915668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaPluginRequestProcessor.h 2013-05-03 19:08:24.425517921 +0000 @@ -46,13 +46,7 @@ #include #include - -#if MOZILLA_VERSION_COLLAPSED < 1090100 -#include -#else -#include #include -#endif #include "IcedTeaPluginUtils.h" #include "IcedTeaJavaRequestProcessor.h" diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaPluginUtils.cc icedtea-web-1.4/plugin/icedteanp/IcedTeaPluginUtils.cc --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaPluginUtils.cc 2013-04-10 11:40:23.917668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaPluginUtils.cc 2013-05-03 19:08:24.426517909 +0000 @@ -39,6 +39,7 @@ #include "IcedTeaNPPlugin.h" #include "IcedTeaScriptablePluginObject.h" #include "IcedTeaPluginUtils.h" +#include /** * Misc. utility functions used by the plugin @@ -715,116 +716,137 @@ } } -bool -IcedTeaPluginUtilities::javaResultToNPVariant(NPP instance, - std::string* java_value, - NPVariant* variant) +/** + * Convert either a void, boolean, or a number + */ +static void +javaPrimitiveResultToNPVariant(const std::string& value, NPVariant* variant) { - JavaRequestProcessor java_request = JavaRequestProcessor(); - JavaResultData* java_result; - - if (java_value->find("literalreturn") == 0) + if (value == "void") { - // 'literalreturn ' == 14 to skip - std::string value = java_value->substr(14); - - // VOID/BOOLEAN/NUMBER + PLUGIN_DEBUG("Method call returned void\n"); + VOID_TO_NPVARIANT(*variant); + } else if (value == "null") + { + PLUGIN_DEBUG("Method call returned null\n"); + NULL_TO_NPVARIANT(*variant); + } else if (value == "true") + { + PLUGIN_DEBUG("Method call returned a boolean (true)\n"); + BOOLEAN_TO_NPVARIANT(true, *variant); + } else if (value == "false") + { + PLUGIN_DEBUG("Method call returned a boolean (false)\n"); + BOOLEAN_TO_NPVARIANT(false, *variant); + } else + { + double d = strtod(value.c_str(), NULL); - if (value == "void") - { - PLUGIN_DEBUG("Method call returned void\n"); - VOID_TO_NPVARIANT(*variant); - } else if (value == "null") - { - PLUGIN_DEBUG("Method call returned null\n"); - NULL_TO_NPVARIANT(*variant); - }else if (value == "true") + // See if it is convertible to int + if (value.find(".") != std::string::npos || d < -(0x7fffffffL - 1L) || d > 0x7fffffffL) { - PLUGIN_DEBUG("Method call returned a boolean (true)\n"); - BOOLEAN_TO_NPVARIANT(true, *variant); - } else if (value == "false") - { - PLUGIN_DEBUG("Method call returned a boolean (false)\n"); - BOOLEAN_TO_NPVARIANT(false, *variant); + PLUGIN_DEBUG("Method call returned a double %f\n", d); + DOUBLE_TO_NPVARIANT(d, *variant); } else { - double d = strtod(value.c_str(), NULL); - - // See if it is convertible to int - if (value.find(".") != std::string::npos || - d < -(0x7fffffffL - 1L) || - d > 0x7fffffffL) - { - PLUGIN_DEBUG("Method call returned a double %f\n", d); - DOUBLE_TO_NPVARIANT(d, *variant); - } else - { - int32_t i = (int32_t) d; - PLUGIN_DEBUG("Method call returned an int %d\n", i); - INT32_TO_NPVARIANT(i, *variant); - } + int32_t i = (int32_t) d; + PLUGIN_DEBUG("Method call returned an int %d\n", i); + INT32_TO_NPVARIANT(i, *variant); } - } else { - // Else this is a complex java object + } +} + +static bool +javaStringResultToNPVariant(const std::string& jobject_id, NPVariant* variant) +{ + JavaRequestProcessor jrequest_processor; + JavaResultData* jstring_result = jrequest_processor.getString(jobject_id); - // To keep code a little bit cleaner, we create variables with proper descriptive names - std::string return_obj_instance_id = std::string(); - std::string return_obj_class_id = std::string(); - std::string return_obj_class_name = std::string(); - return_obj_instance_id.append(*java_value); + if (jstring_result->error_occurred) + { + return false; + } + + std::string str = *jstring_result->return_string; + + PLUGIN_DEBUG( "Method call returned a string:\"%s\"\n", str.c_str()); - // Find out the class name first, because string is a special case - java_result = java_request.getClassName(return_obj_instance_id); + *variant = IcedTeaPluginUtilities::NPVariantStringCopy(str); + + return true; +} + +static bool +javaJSObjectResultToNPVariant(const std::string& js_id, NPVariant* variant) +{ + NPVariant* result_variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(js_id); + *variant = *result_variant; + return true; +} + +static bool +javaObjectResultToNPVariant(NPP instance, const std::string& jobject_id, NPVariant* variant) +{ + // Reference the class object so we can construct an NPObject with it and the instance + + JavaRequestProcessor jrequest_processor; + JavaResultData* jclass_result = jrequest_processor.getClassID(jobject_id); + + if (jclass_result->error_occurred) + { + return false; + } - if (java_result->error_occurred) + std::string jclass_id = *jclass_result->return_string; + + NPObject* obj; + if (jclass_id.at(0) == '[') // array + { + obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(instance, jclass_id, + jobject_id, true); + } else + { + obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(instance, jclass_id, + jobject_id, false); + } + + OBJECT_TO_NPVARIANT(obj, *variant); + + return true; +} + +bool +IcedTeaPluginUtilities::javaResultToNPVariant(NPP instance, + std::string* java_value, NPVariant* variant) +{ + int literal_n = sizeof("literalreturn"); // Accounts for one space char + int jsobject_n = sizeof("jsobject"); // Accounts for one space char + + if (strncmp("literalreturn ", java_value->c_str(), literal_n) == 0) + { + javaPrimitiveResultToNPVariant(java_value->substr(literal_n), variant); + } else if (strncmp("jsobject ", java_value->c_str(), jsobject_n) == 0) + { + javaJSObjectResultToNPVariant(java_value->substr(jsobject_n), variant); + } else + { + std::string jobject_id = *java_value; + + JavaRequestProcessor jrequest_processor; + JavaResultData* jclassname_result = jrequest_processor.getClassName(jobject_id); + + if (jclassname_result->error_occurred) { return false; } - return_obj_class_name.append(*(java_result->return_string)); - - if (return_obj_class_name == "java.lang.String") + // Special-case for NPString if string + if (*jclassname_result->return_string == "java.lang.String") { - // String is a special case as NPVariant can handle it directly - java_result = java_request.getString(return_obj_instance_id); - - if (java_result->error_occurred) - { - return false; - } - - // needs to be on the heap - NPUTF8* return_str = (NPUTF8*) malloc(sizeof(NPUTF8)*java_result->return_string->size() + 1); - strcpy(return_str, java_result->return_string->c_str()); - - PLUGIN_DEBUG("Method call returned a string: \"%s\"\n", return_str); - STRINGZ_TO_NPVARIANT(return_str, *variant); - - } else { - - // Else this is a regular class. Reference the class object so - // we can construct an NPObject with it and the instance - java_result = java_request.getClassID(return_obj_instance_id); - - if (java_result->error_occurred) - { - return false; - } - - return_obj_class_id.append(*(java_result->return_string)); - - NPObject* obj; - - if (return_obj_class_name.find('[') == 0) // array - obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object( - instance, - return_obj_class_id, return_obj_instance_id, true); - else - obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object( - instance, - return_obj_class_id, return_obj_instance_id, false); - - OBJECT_TO_NPVARIANT(obj, *variant); + return javaStringResultToNPVariant(jobject_id, variant); + } else // Else this needs a java object wrapper + { + return javaObjectResultToNPVariant(instance, jobject_id, variant); } } @@ -898,15 +920,9 @@ std::string IcedTeaPluginUtilities::NPVariantAsString(NPVariant variant) { -#if MOZILLA_VERSION_COLLAPSED < 1090200 - return std::string( - NPVARIANT_TO_STRING(variant).utf8characters, - NPVARIANT_TO_STRING(variant).utf8length); -#else return std::string( NPVARIANT_TO_STRING(variant).UTF8Characters, NPVARIANT_TO_STRING(variant).UTF8Length); -#endif } /** @@ -916,6 +932,21 @@ * @param func The function to post * @param data Arguments to *func */ +NPString IcedTeaPluginUtilities::NPStringCopy(const std::string& result) { + char* utf8 = (char*)browser_functions.memalloc(result.size() + 1); + strncpy(utf8, result.c_str(), result.size() + 1); + + NPString npstr = {utf8, result.size()}; + return npstr; +} + +NPVariant IcedTeaPluginUtilities::NPVariantStringCopy(const std::string& result) { + NPString npstr = NPStringCopy(result); + NPVariant npvar; + STRINGN_TO_NPVARIANT(npstr.UTF8Characters, npstr.UTF8Length, npvar); + return npvar; +} + void IcedTeaPluginUtilities::callAndWaitForResult(NPP instance, void (*func) (void *), AsyncCallThreadData* data) { @@ -1028,6 +1059,21 @@ } while(1); } +void IcedTeaPluginUtilities::trim(std::string& str) { + size_t start = str.find_first_not_of(" \t\n"), end = str.find_last_not_of(" \t\n"); + if (start == std::string::npos) { + return; + } + str = str.substr(start, end - start + 1); +} + +bool IcedTeaPluginUtilities::file_exists(std::string filename) +{ + std::ifstream infile(filename.c_str()); + return infile.good(); +} + + /****************************************** * Begin JavaMessageSender implementation * ****************************************** @@ -1163,3 +1209,4 @@ PLUGIN_DEBUG("%p unlocked...\n", &msg_queue_mutex); } + diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaPluginUtils.h icedtea-web-1.4/plugin/icedteanp/IcedTeaPluginUtils.h --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaPluginUtils.h 2013-04-10 11:40:23.919668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaPluginUtils.h 2013-05-03 19:08:24.427517897 +0000 @@ -56,15 +56,8 @@ #include #include - -#if MOZILLA_VERSION_COLLAPSED < 1090100 -#include -#else -#include +#include #include -#endif - -#include "IcedTeaNPPlugin.h" #define PLUGIN_DEBUG(...) \ do \ @@ -212,6 +205,12 @@ /* Copies a variant data type into a C++ string */ static std::string NPVariantAsString(NPVariant variant); + /* This must be freed with browserfunctions.memfree */ + static NPString NPStringCopy(const std::string& result); + + /* This must be freed with browserfunctions.releasevariantvalue */ + static NPVariant NPVariantStringCopy(const std::string& result); + /* Frees the given vector and the strings that its contents point to */ static void freeStringPtrVector(std::vector* v); @@ -243,7 +242,7 @@ static void printNPVariant(NPVariant variant); - static void NPVariantToString(NPVariant variant, std::string* result); + static void NPVariantToString(NPVariant variant, std::string* result); static bool javaResultToNPVariant(NPP instance, std::string* java_result, @@ -274,6 +273,11 @@ /* Posts call in async queue and waits till execution completes */ static void callAndWaitForResult(NPP instance, void (*func) (void *), AsyncCallThreadData* data); + + /*cutting whitespaces from end and start of string*/ + static void trim(std::string& str); + static bool file_exists(std::string filename); + }; /* @@ -340,4 +344,6 @@ void post(const char* message); }; + + #endif // __ICEDTEAPLUGINUTILS_H__ diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaRunnable.h icedtea-web-1.4/plugin/icedteanp/IcedTeaRunnable.h --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaRunnable.h 2013-04-10 11:40:23.920668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaRunnable.h 2013-05-03 19:08:24.427517897 +0000 @@ -42,10 +42,8 @@ #define MOZILLA 1 #if MOZILLA -#if MOZILLA_VERSION_COLLAPSED < 1090100 -#include #include -#endif +#include /* * This struct holds the result from the main-thread dispatched method diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaScriptablePluginObject.cc icedtea-web-1.4/plugin/icedteanp/IcedTeaScriptablePluginObject.cc --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaScriptablePluginObject.cc 2013-04-10 11:40:23.921668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaScriptablePluginObject.cc 2013-05-03 19:08:24.428517885 +0000 @@ -197,7 +197,7 @@ void IcedTeaScriptableJavaPackageObject::deAllocate(NPObject *npobj) { - browser_functions.releaseobject(npobj); + delete (IcedTeaScriptableJavaPackageObject*)npobj; } void @@ -489,7 +489,7 @@ void IcedTeaScriptableJavaObject::deAllocate(NPObject *npobj) { - browser_functions.releaseobject(npobj); + delete (IcedTeaScriptableJavaObject*)npobj; } void @@ -591,7 +591,10 @@ if (java_result->error_occurred) { - browser_functions.setexception(npobj, java_result->error_msg->c_str()); + // error message must be allocated on heap + char* error_msg = (char*) malloc(java_result->error_msg->length()*sizeof(char)); + strcpy(error_msg, java_result->error_msg->c_str()); + browser_functions.setexception(npobj, error_msg); return false; } @@ -850,7 +853,11 @@ createJavaObjectFromVariant(instance, args[i], &id); if (id == "0") { - browser_functions.setexception(npobj, "Unable to create argument on Java side"); + // error message must be allocated on heap + char* error_msg = (char*) malloc(1024*sizeof(char)); + strcpy(error_msg, "Unable to create argument on Java side"); + + browser_functions.setexception(npobj, error_msg); return false; } @@ -864,7 +871,12 @@ if (java_result->error_occurred) { - browser_functions.setexception(npobj, java_result->error_msg->c_str()); + // error message must be allocated on heap + int length = java_result->error_msg->length(); + char* error_msg = (char*) malloc((length+1)*sizeof(char)); + strcpy(error_msg, java_result->error_msg->c_str()); + + browser_functions.setexception(npobj, error_msg); return false; } diff -Nru icedtea-web-1.3.2/plugin/icedteanp/IcedTeaScriptablePluginObject.h icedtea-web-1.4/plugin/icedteanp/IcedTeaScriptablePluginObject.h --- icedtea-web-1.3.2/plugin/icedteanp/IcedTeaScriptablePluginObject.h 2013-04-10 11:40:23.921668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/IcedTeaScriptablePluginObject.h 2013-05-03 19:08:24.428517885 +0000 @@ -39,12 +39,8 @@ #ifndef __ICEDTEASCRIPTABLEPLUGINOBJECT_H_ #define __ICEDTEASCRIPTABLEPLUGINOBJECT_H_ -#if MOZILLA_VERSION_COLLAPSED < 1090100 -#include "npupp.h" -#else #include #include -#endif #include "IcedTeaJavaRequestProcessor.h" #include "IcedTeaNPPlugin.h" diff -Nru icedtea-web-1.3.2/plugin/icedteanp/java/netscape/javascript/JSObject.java icedtea-web-1.4/plugin/icedteanp/java/netscape/javascript/JSObject.java --- icedtea-web-1.3.2/plugin/icedteanp/java/netscape/javascript/JSObject.java 2013-04-10 11:40:23.922668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/java/netscape/javascript/JSObject.java 2013-05-03 19:08:24.460517480 +0000 @@ -100,6 +100,16 @@ } /** + * Package-private method used through JSUtil#getJSObjectInternalReference. + * We make this package-private to avoid polluting the public interface. + * @return the internal identifier + */ + long getInternalReference() { + AccessController.getContext().checkPermission(new JSObjectUnboxPermission()); + return internal; + } + + /** * it is illegal to construct a JSObject manually */ public JSObject(int jsobj_addr) { diff -Nru icedtea-web-1.3.2/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java icedtea-web-1.4/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java --- icedtea-web-1.3.2/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java 2013-05-03 19:08:24.460517481 +0000 @@ -0,0 +1,49 @@ +/* JSObjectUnboxPermission.java + Copyright (C) 2012 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package netscape.javascript; + +import java.security.BasicPermission; + +/** + * Permission to access internal reference of JSObject + */ +public class JSObjectUnboxPermission extends BasicPermission { + public JSObjectUnboxPermission() { + super("JSObjectUnbox"); + } +} diff -Nru icedtea-web-1.3.2/plugin/icedteanp/java/netscape/javascript/JSUtil.java icedtea-web-1.4/plugin/icedteanp/java/netscape/javascript/JSUtil.java --- icedtea-web-1.3.2/plugin/icedteanp/java/netscape/javascript/JSUtil.java 2013-04-10 11:40:23.923668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/java/netscape/javascript/JSUtil.java 2013-05-03 19:08:24.461517469 +0000 @@ -57,4 +57,16 @@ return captureStream.toString(); } -} + + /** + * Uses package-private method JSObject.getInternalReference. + * This is package-private to avoid polluting the public interface. + * @param js JSObject to unbox + * @return the internal reference stored by the JSObject + */ + public static long getJSObjectInternalReference(JSObject js) { + // NB: permission is checked in JSObject + return js.getInternalReference(); + } + +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java icedtea-web-1.4/plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java --- icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java 2013-04-10 11:40:23.925668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java 2013-05-03 19:08:24.483517191 +0000 @@ -41,449 +41,398 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /* * This class resolved overloaded methods in Java objects using a cost - * based-approach as described here: + * based-approach described here: * - * http://java.sun.com/javase/6/webnotes/6u10/plugin2/liveconnect/#OVERLOADED_METHODS + * http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS */ public class MethodOverloadResolver { + static final int NUMERIC_SAME_COST = 1; + static final int NULL_TO_OBJECT_COST = 2; + static final int CLASS_SAME_COST = 3; + static final int NUMERIC_CAST_COST = 4; + static final int NUMERIC_BOOLEAN_COST = 5; - private static boolean debugging = false; + static final int STRING_NUMERIC_CAST_COST = 5; - public static void main(String[] args) { - testMethodResolver(); - } + static final int CLASS_SUPERCLASS_COST = 6; - public static void testMethodResolver() { - debugging = true; + static final int CLASS_STRING_COST = 7; + static final int ARRAY_CAST_COST = 8; - ArrayList list = new ArrayList(20); - FooClass fc = new FooClass(); - - // Numeric to java primitive - // foo_i has Integer and int params - String s1 = "foo_string_int(S,I)"; - String s1a = "foo_string_int(S,S)"; - Object[] o1 = { fc.getClass(), "foo_string_int", "blah", 42 }; - list.add(o1); - Object[] o1a = { fc.getClass(), "foo_string_int", "blah", "42.42" }; - list.add(o1a); - - // Null to non-primitive type - // foo_i is overloaded with Integer and int - String s2 = "foo_string_int(N)"; - Object[] o2 = { fc.getClass(), "foo_string_int", "blah", null }; - list.add(o2); - - // foo_jsobj is overloaded with JSObject and String params - String s3 = "foo_jsobj(LLowCostSignatureComputer/JSObject;)"; - Object[] o3 = { fc.getClass(), "foo_jsobj", new JSObject() }; - list.add(o3); - - // foo_classtype is overloaded with Number and Integer - String s4 = "foo_classtype(Ljava/lang/Integer;)"; - Object[] o4 = { fc.getClass(), "foo_classtype", 42 }; - list.add(o4); - - // foo_multiprim is overloaded with int, long and float types - String s5 = "foo_multiprim(I)"; - String s6 = "foo_multiprim(F)"; - String s6a = "foo_multiprim(D)"; - - Object[] o5 = { fc.getClass(), "foo_multiprim", new Integer(42) }; - Object[] o6 = { fc.getClass(), "foo_multiprim", new Float(42.42) }; - Object[] o6a = { fc.getClass(), "foo_multiprim", new Double(42.42) }; - list.add(o5); - list.add(o6); - list.add(o6a); - - // foo_float has float, String and JSObject type - String s7 = "foo_float(I)"; - Object[] o7 = { fc.getClass(), "foo_float", new Integer(42) }; - list.add(o7); - - // foo_multiprim(float) is what this should convert - String s8 = "foo_float(S)"; - Object[] o8 = { fc.getClass(), "foo_float", "42" }; - list.add(o8); - - // foo_class is overloaded with BarClass 2 and 3 - String s9 = "foo_class(LLowCostSignatureComputer/BarClass3;)"; - Object[] o9 = { fc.getClass(), "foo_class", new BarClass3() }; - list.add(o9); - - // foo_strandbyteonly takes string and byte - String s10 = "foo_strandbyteonly(I)"; - Object[] o10 = { fc.getClass(), "foo_strandbyteonly", 42 }; - list.add(o10); - - // JSOBject to string - String s11 = "foo_strandbyteonly(LLowCostSignatureComputer/JSObject;)"; - Object[] o11 = { fc.getClass(), "foo_strandbyteonly", new JSObject() }; - list.add(o11); - - // jsobject to string and int to float - String s12 = "foo_str_and_float(S,I)"; - Object[] o12 = { fc.getClass(), "foo_str_and_float", new JSObject(), new Integer(42) }; - list.add(o12); - - // call for which no match will be found - String s13 = "foo_int_only(JSObject)"; - Object[] o13 = { fc.getClass(), "foo_int_only", new JSObject() }; - list.add(o13); - - // method with no args - String s14 = "foo_noargs()"; - Object[] o14 = { fc.getClass(), "foo_noargs" }; - list.add(o14); - - // method which takes a primitive bool, given a Boolean - String s15 = "foo_boolonly()"; - Object[] o15 = { fc.getClass(), "foo_boolonly", new Boolean(true) }; - list.add(o15); - - for (Object[] o : list) { - Object[] methodAndArgs = getMatchingMethod(o); - if (debugging) - if (methodAndArgs != null) - System.out.println("Best match: " + methodAndArgs[0] + "\n"); - else - System.out.println("No match found.\n"); + /* A method signature with its casted parameters + * We pretend a Constructor is a normal 'method' for ease of code reuse */ + static class ResolvedMethod { - } + private java.lang.reflect.AccessibleObject method; + private Object[] castedParameters; + private int cost; - } + public ResolvedMethod(int cost, java.lang.reflect.AccessibleObject method, Object[] castedParameters) { + this.cost = cost; + this.method = method; + this.castedParameters = castedParameters; + } - /* - * Cost based overload resolution algorithm based on cost rules specified here: - * - * http://java.sun.com/javase/6/webnotes/6u10/plugin2/liveconnect/#OVERLOADED_METHODS - */ + java.lang.reflect.AccessibleObject getAccessibleObject() { + return method; + } - public static Object[] getMatchingMethod(Object[] callList) { - Object[] ret = null; - Class c = (Class) callList[0]; - String methodName = (String) callList[1]; + public Method getMethod() { + return (Method)method; + } - Method[] matchingMethods = getMatchingMethods(c, methodName, callList.length - 2); + public Constructor getConstructor() { + return (Constructor)method; + } - if (debugging) - System.out.println("getMatchingMethod called with: " + printList(callList)); + public Object[] getCastedParameters() { + return castedParameters; + } - int lowestCost = Integer.MAX_VALUE; + public int getCost() { + return cost; + } + } - for (Method matchingMethod : matchingMethods) { + /* A cast with an associated 'cost', used for picking method overloads */ + static class WeightedCast { - int methodCost = 0; - Class[] paramTypes = matchingMethod.getParameterTypes(); - Object[] methodAndArgs = new Object[paramTypes.length + 1]; - methodAndArgs[0] = matchingMethod; + private int cost; + private Object castedObject; - // Figure out which of the matched methods best represents what we - // want - for (int i = 0; i < paramTypes.length; i++) { - Class paramTypeClass = paramTypes[i]; - Object suppliedParam = callList[i + 2]; - Class suppliedParamClass = suppliedParam != null ? suppliedParam - .getClass() - : null; + public WeightedCast(int cost, Object castedObject) { + this.cost = cost; + this.castedObject = castedObject; + } - Object[] costAndCastedObj = getCostAndCastedObject( - suppliedParam, paramTypeClass); - methodCost += (Integer) costAndCastedObj[0]; + public Object getCastedObject() { + return castedObject; + } - if ((Integer) costAndCastedObj[0] < 0) - break; + public int getCost() { + return cost; + } + } - Object castedObj = paramTypeClass.isPrimitive() ? costAndCastedObj[1] - : paramTypeClass.cast(costAndCastedObj[1]); - methodAndArgs[i + 1] = castedObj; - - Class castedObjClass = castedObj == null ? null : castedObj - .getClass(); - Boolean castedObjIsPrim = castedObj == null ? null : castedObj - .getClass().isPrimitive(); - - if (debugging) - System.out.println("Param " + i + " of method " - + matchingMethod + " has cost " - + (Integer) costAndCastedObj[0] - + " original param type " + suppliedParamClass - + " casted to " + castedObjClass + " isPrimitive=" - + castedObjIsPrim + " value " + castedObj); - } - if ((methodCost > 0 && methodCost < lowestCost) || - paramTypes.length == 0) { - ret = methodAndArgs; - lowestCost = methodCost; - } + public static ResolvedMethod getBestMatchMethod(Class c, String methodName, Object[] args) { + Method[] matchingMethods = getMatchingMethods(c, methodName, args.length); - } + if (PluginDebug.DEBUG) { /* avoid toString if not needed */ + PluginDebug.debug("getMatchingMethod called with: " + + Arrays.toString(args)); + } - return ret; + return getBestOverloadMatch(c, args, matchingMethods); } - public static Object[] getMatchingConstructor(Object[] callList) { - Object[] ret = null; - Class c = (Class) callList[0]; + public static ResolvedMethod getBestMatchConstructor(Class c, Object[] args) { + Constructor[] matchingConstructors = getMatchingConstructors(c, args.length); - Constructor[] matchingConstructors = getMatchingConstructors(c, callList.length - 1); + if (PluginDebug.DEBUG) { /* avoid toString if not needed */ + PluginDebug.debug("getMatchingConstructor called with: " + + Arrays.toString(args)); + } - if (debugging) - System.out.println("getMatchingConstructor called with: " + printList(callList)); + return getBestOverloadMatch(c, args, matchingConstructors); + } + + /* + * Get best-matching method based on a cost based overload resolution + * algorithm is used, described here: + * + * http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS + * + * Note that we consider Constructor's to be 'methods' for convenience. We + * use the common parent class of Method/Constructor, 'AccessibleObject' + * + * NB: Although the spec specifies that ambiguous method calls (ie, same + * cost) should throw errors, we simply pick the first overload for + * simplicity. Method overrides should not be doing wildly different things + * anyway. + */ + static ResolvedMethod getBestOverloadMatch(Class c, Object[] args, + java.lang.reflect.AccessibleObject[] candidates) { int lowestCost = Integer.MAX_VALUE; + java.lang.reflect.AccessibleObject cheapestMethod = null; + Object[] cheapestArgs = null; + boolean ambiguous = false; - for (Constructor matchingConstructor : matchingConstructors) { + methodLoop: + for (java.lang.reflect.AccessibleObject candidate : candidates) { + int methodCost = 0; - int constructorCost = 0; - Class[] paramTypes = matchingConstructor.getParameterTypes(); - Object[] constructorAndArgs = new Object[paramTypes.length + 1]; - constructorAndArgs[0] = matchingConstructor; + Class[] paramTypes = getParameterTypesFor(candidate); + Object[] castedArgs = new Object[paramTypes.length]; // Figure out which of the matched methods best represents what we // want for (int i = 0; i < paramTypes.length; i++) { Class paramTypeClass = paramTypes[i]; - Object suppliedParam = callList[i + 1]; - Class suppliedParamClass = suppliedParam != null ? suppliedParam - .getClass() - : null; + Object suppliedParam = args[i]; + Class suppliedParamClass = suppliedParam != null ? suppliedParam + .getClass() : null; - Object[] costAndCastedObj = getCostAndCastedObject( + WeightedCast weightedCast = getCostAndCastedObject( suppliedParam, paramTypeClass); - constructorCost += (Integer) costAndCastedObj[0]; - if ((Integer) costAndCastedObj[0] < 0) - break; + if (weightedCast == null) { + continue methodLoop; // Cannot call this constructor! + } + + methodCost += weightedCast.getCost(); - Object castedObj = paramTypeClass.isPrimitive() ? costAndCastedObj[1] - : paramTypeClass.cast(costAndCastedObj[1]); - constructorAndArgs[i + 1] = castedObj; - - Class castedObjClass = castedObj == null ? null : castedObj - .getClass(); - Boolean castedObjIsPrim = castedObj == null ? null : castedObj - .getClass().isPrimitive(); - - if (debugging) - System.out.println("Param " + i + " of constructor " - + matchingConstructor + " has cost " - + (Integer) costAndCastedObj[0] + Object castedObj = paramTypeClass.isPrimitive() ? + weightedCast.getCastedObject() + : paramTypeClass.cast(weightedCast.getCastedObject()); + + castedArgs[i] = castedObj; + + if (PluginDebug.DEBUG) { /* avoid toString if not needed */ + Class castedObjClass = castedObj == null ? null : castedObj.getClass(); + boolean castedObjIsPrim = castedObj == null ? false : castedObj.getClass().isPrimitive(); + + PluginDebug.debug("Param " + i + " of method " + candidate + + " has cost " + weightedCast.getCost() + " original param type " + suppliedParamClass + " casted to " + castedObjClass + " isPrimitive=" + castedObjIsPrim + " value " + castedObj); + } } - if ((constructorCost > 0 && constructorCost < lowestCost) || - paramTypes.length == 0) { - ret = constructorAndArgs; - lowestCost = constructorCost; + if (methodCost <= lowestCost) { + if (methodCost < lowestCost + || argumentsAreSubclassesOf(castedArgs, cheapestArgs)) { + lowestCost = methodCost; + cheapestArgs = castedArgs; + cheapestMethod = candidate; + ambiguous = false; + } else { + ambiguous = true; + } } + } - return ret; + // The spec says we should error out if the method call is ambiguous + // Instead we will report it in debug output + if (ambiguous) { + PluginDebug.debug("*** Warning: Ambiguous overload of ", c.getClass(), "#", cheapestMethod, "!"); + } + + if (cheapestMethod == null) { + return null; + } + + return new ResolvedMethod(lowestCost, cheapestMethod, cheapestArgs); } - public static Object[] getCostAndCastedObject(Object suppliedParam, Class paramTypeClass) { + public static WeightedCast getCostAndCastedObject(Object suppliedParam, + Class paramTypeClass) { + Class suppliedParamClass = suppliedParam != null ? suppliedParam + .getClass() : null; - Object[] ret = new Object[2]; - Integer cost = new Integer(0); - Object castedObj; + boolean suppliedParamIsArray = suppliedParamClass != null + && suppliedParamClass.isArray(); - Class suppliedParamClass = suppliedParam != null ? suppliedParam.getClass() : null; + if (suppliedParamIsArray) { + if (paramTypeClass.isArray()) { + return getArrayToArrayCastWeightedCost(suppliedParam, + paramTypeClass); + } - // Either both are an array, or neither are - boolean suppliedParamIsArray = suppliedParamClass != null && suppliedParamClass.isArray(); - if (paramTypeClass.isArray() != suppliedParamIsArray && - !paramTypeClass.equals(Object.class) && - !paramTypeClass.equals(String.class)) { - ret[0] = Integer.MIN_VALUE; // Not allowed - ret[1] = suppliedParam; - return ret; + // Target type must be an array, Object or String + // If it an object, we return "as is" [Everything can be narrowed to an + // object, cost=CLASS_SUPERCLASS_COST] + // If it is a string, we need to convert according to the JS engine + // rules + if (paramTypeClass != String.class + && paramTypeClass != Object.class) { + return null; + } + if (paramTypeClass.equals(String.class)) { + return new WeightedCast(ARRAY_CAST_COST, + arrayToJavascriptStyleString(suppliedParam)); + } } - // If param type is an array, supplied obj must be an array, Object or String (guaranteed by checks above) - // If it is an array, we need to copy/cast as we scan the array - // If it an object, we return "as is" [Everything can be narrowed to an object, cost=6] - // If it is a string, we need to convert according to the JS engine rules + // If this is null, there are only 2 possible cases + if (suppliedParamClass == null) { + if (!paramTypeClass.isPrimitive()) { + return new WeightedCast(NULL_TO_OBJECT_COST, null); // Null to any non-primitive type + } + return null;// Null to primitive not allowed + } - if (paramTypeClass.isArray()) { + // Numeric type to the analogous Java primitive type + if (paramTypeClass.isPrimitive() + && paramTypeClass == getPrimitiveType(suppliedParam.getClass())) { + return new WeightedCast(NUMERIC_SAME_COST, suppliedParam); - Object newArray = Array.newInstance(paramTypeClass.getComponentType(), Array.getLength(suppliedParam)); - for (int i = 0; i < Array.getLength(suppliedParam); i++) { - Object original = Array.get(suppliedParam, i); + } + + // Class type to Class type where the types are the same + if (suppliedParamClass == paramTypeClass) { + return new WeightedCast(CLASS_SAME_COST, suppliedParam); + + } - // When dealing with arrays, we represent empty slots with - // null. We need to convert this to 0 before recursive - // calling, since normal transformation does not allow - // null -> primitive + // Numeric type to a different primitive type + boolean wrapsPrimitive = (getPrimitiveType(suppliedParam.getClass()) != null); + if (wrapsPrimitive && paramTypeClass.isPrimitive()) { + double val; - if (original == null && paramTypeClass.getComponentType().isPrimitive()) - original = 0; + // Coerce booleans + if (suppliedParam.equals(Boolean.TRUE)) { + val = 1.0; + } else if (suppliedParam.equals(Boolean.FALSE)){ + val = 0.0; + } else if (suppliedParam instanceof Character) { + val = (double)(Character)suppliedParam; + } else { + val = ((Number)suppliedParam).doubleValue(); + } - Object[] costAndCastedObject = getCostAndCastedObject(original, paramTypeClass.getComponentType()); + int castCost = NUMERIC_CAST_COST; + Object castedObj; + if (paramTypeClass.equals(Boolean.TYPE)) { + castedObj = (val != 0D && !Double.isNaN(val)); - if ((Integer) costAndCastedObject[0] < 0) { - ret[0] = Integer.MIN_VALUE; // Not allowed - ret[1] = suppliedParam; - return ret; + if (suppliedParam.getClass() != Boolean.class) { + castCost = NUMERIC_BOOLEAN_COST; } + } else { + castedObj = toBoxedPrimitiveType(val, paramTypeClass); + } + return new WeightedCast(castCost, castedObj); + } - Array.set(newArray, i, costAndCastedObject[1]); + // Numeric string to numeric type + if (isNumericString(suppliedParam) && paramTypeClass.isPrimitive()) { + Object castedObj; + if (paramTypeClass.equals(Character.TYPE)) { + castedObj = (char) Short.decode((String)suppliedParam).shortValue(); + } else { + castedObj = stringAsPrimitiveType((String)suppliedParam, paramTypeClass); } + return new WeightedCast(STRING_NUMERIC_CAST_COST, castedObj); + } - ret[0] = 9; - ret[1] = newArray; - return ret; + // Same cost as above + if (suppliedParam instanceof java.lang.String + && (paramTypeClass == java.lang.Boolean.class || paramTypeClass == java.lang.Boolean.TYPE)) { + return new WeightedCast(STRING_NUMERIC_CAST_COST, !suppliedParam.equals("")); } - if (suppliedParamIsArray && paramTypeClass.equals(String.class)) { + // Class type to superclass type; + if (paramTypeClass.isAssignableFrom(suppliedParamClass)) { + return new WeightedCast(CLASS_SUPERCLASS_COST, paramTypeClass.cast(suppliedParam)); + } - ret[0] = 9; - ret[1] = getArrayAsString(suppliedParam); - return ret; + // Any java value to String + if (paramTypeClass.equals(String.class)) { + return new WeightedCast(CLASS_STRING_COST, suppliedParam.toString()); } - // If this is null, there are only 2 possible cases - if (suppliedParamClass == null) { - castedObj = null; // if value is null.. well, it is null + return null; + } - if (!paramTypeClass.isPrimitive()) { - cost += 2; // Null to any non-primitive type - } else { - cost = Integer.MIN_VALUE; // Null to primitive not allowed + private static WeightedCast getArrayToArrayCastWeightedCost(Object suppliedArray, + Class paramTypeClass) { + + int arrLength = Array.getLength(suppliedArray); + Class arrType = paramTypeClass.getComponentType(); + + // If it is an array, we need to copy/cast as we scan the array + Object newArray = Array.newInstance(arrType, arrLength); + + for (int i = 0; i < arrLength; i++) { + Object original = Array.get(suppliedArray, i); + + // When dealing with arrays, we represent empty slots with + // null. We need to convert this to 0 before recursive + // calling, since normal transformation does not allow + // null -> primitive + + if (original == null && arrType.isPrimitive()) { + original = 0; } - } else if (paramTypeClass.isPrimitive() && paramTypeClass.equals(getPrimitive(suppliedParam))) { - cost += 1; // Numeric type to the analogous Java primitive type - castedObj = suppliedParam; // Let auto-boxing handle it - } else if (suppliedParamClass.equals(paramTypeClass)) { - cost += 3; // Class type to Class type where the types are equal - castedObj = suppliedParam; - } else if (isNum(suppliedParam) && - (paramTypeClass.isPrimitive() || - java.lang.Number.class.isAssignableFrom(paramTypeClass) || - java.lang.Character.class.isAssignableFrom(paramTypeClass) || - java.lang.Byte.class.isAssignableFrom(paramTypeClass) - )) { - cost += 4; // Numeric type to a different primitive type - - if (suppliedParam.toString().equals("true")) - suppliedParam = "1"; - else if (suppliedParam.toString().equals("false")) - suppliedParam = "0"; - - if (paramTypeClass.equals(Boolean.TYPE)) - castedObj = getNum(suppliedParam.toString(), paramTypeClass).doubleValue() != 0D; - else if (paramTypeClass.equals(Character.TYPE)) - castedObj = (char) Short.decode(suppliedParam.toString()).shortValue(); - else - castedObj = getNum(suppliedParam.toString(), paramTypeClass); - } else if (suppliedParam instanceof java.lang.String && - isNum(suppliedParam) && - (paramTypeClass.isInstance(java.lang.Number.class) || - paramTypeClass.isInstance(java.lang.Character.class) || - paramTypeClass.isInstance(java.lang.Byte.class) || - paramTypeClass.isPrimitive())) { - cost += 5; // String to numeric type - - if (suppliedParam.toString().equals("true")) - suppliedParam = "1"; - else if (suppliedParam.toString().equals("false")) - suppliedParam = "0"; - - if (paramTypeClass.equals(Character.TYPE)) - castedObj = (char) Short.decode(suppliedParam.toString()).shortValue(); - else - castedObj = getNum(suppliedParam.toString(), paramTypeClass); - } else if (suppliedParam instanceof java.lang.String && - (paramTypeClass.equals(java.lang.Boolean.class) || - paramTypeClass.equals(java.lang.Boolean.TYPE))) { - - cost += 5; // Same cost as above - castedObj = new Boolean(suppliedParam.toString().length() > 0); - } else if (paramTypeClass.isAssignableFrom(suppliedParamClass)) { - cost += 6; // Class type to superclass type; - castedObj = paramTypeClass.cast(suppliedParam); - } else if (paramTypeClass.equals(String.class)) { - cost += 7; // Any Java value to String - castedObj = suppliedParam.toString(); - } else if (suppliedParam instanceof JSObject && - paramTypeClass.isArray()) { - cost += 8; // JSObject to Java array - castedObj = (JSObject) suppliedParam; - } else { - cost = Integer.MIN_VALUE; // Not allowed - castedObj = suppliedParam; - } - ret[0] = cost; - ret[1] = castedObj; + WeightedCast costAndCastedObject = getCostAndCastedObject(original, + paramTypeClass.getComponentType()); - return ret; + if (costAndCastedObject == null) { + return null; + } + Array.set(newArray, i, costAndCastedObject.getCastedObject()); + } + + return new WeightedCast(ARRAY_CAST_COST, newArray); } - private static Method[] getMatchingMethods(Class c, String name, int paramCount) { - Method[] allMethods = c.getMethods(); - ArrayList matchingMethods = new ArrayList(5); + private static Method[] getMatchingMethods(Class c, String name, + int paramCount) { + List matchingMethods = new ArrayList(); - for (Method m : allMethods) { - if (m.getName().equals(name) && m.getParameterTypes().length == paramCount) - matchingMethods.add(m); + for (Method m : c.getMethods()) { + if (m.getName().equals(name)) { + if (m.getParameterTypes().length == paramCount) { + matchingMethods.add(m); + } + } } return matchingMethods.toArray(new Method[0]); } - private static Constructor[] getMatchingConstructors(Class c, int paramCount) { - Constructor[] allConstructors = c.getConstructors(); - ArrayList matchingConstructors = new ArrayList(5); + private static Constructor[] getMatchingConstructors(Class c, + int paramCount) { + List> matchingConstructors = new ArrayList>(); - for (Constructor cs : allConstructors) { - if (cs.getParameterTypes().length == paramCount) + for (Constructor cs : c.getConstructors()) { + if (cs.getParameterTypes().length == paramCount) { matchingConstructors.add(cs); + } } return matchingConstructors.toArray(new Constructor[0]); } - private static Class getPrimitive(Object o) { - - if (o instanceof java.lang.Byte) { - return java.lang.Byte.TYPE; - } else if (o instanceof java.lang.Character) { - return java.lang.Character.TYPE; - } else if (o instanceof java.lang.Short) { - return java.lang.Short.TYPE; - } else if (o instanceof java.lang.Integer) { - return java.lang.Integer.TYPE; - } else if (o instanceof java.lang.Long) { - return java.lang.Long.TYPE; - } else if (o instanceof java.lang.Float) { - return java.lang.Float.TYPE; - } else if (o instanceof java.lang.Double) { - return java.lang.Double.TYPE; - } else if (o instanceof java.lang.Boolean) { - return java.lang.Boolean.TYPE; + private static Class getPrimitiveType(Class c) { + if (c.isPrimitive()) { + return c; + } + + if (c == Byte.class) { + return Byte.TYPE; + } else if (c == Character.class) { + return Character.TYPE; + } else if (c == Short.class) { + return Short.TYPE; + } else if (c == Integer.class) { + return Integer.TYPE; + } else if (c == Long.class) { + return Long.TYPE; + } else if (c == Float.class) { + return Float.TYPE; + } else if (c == Double.class) { + return Double.TYPE; + } else if (c == Boolean.class) { + return Boolean.TYPE; + } else { + return null; } - - return o.getClass(); } - private static boolean isNum(Object o) { - - if (o instanceof java.lang.Number) - return true; - - // Boolean is changeable to number as well - if (o instanceof java.lang.Boolean) - return true; - + private static boolean isNumericString(Object o) { // At this point, it _has_ to be a string else automatically // return false if (!(o instanceof java.lang.String)) @@ -504,239 +453,78 @@ return false; } - private static Number getNum(String s, Class c) throws NumberFormatException { - - Number n; - if (s.contains(".")) - n = new Double(s); - else - n = new Long(s); + private static Object toBoxedPrimitiveType(double val, Class c) { + Class prim = getPrimitiveType(c); // See if we need to collapse first - if (c.equals(java.lang.Integer.class) || - c.equals(java.lang.Integer.TYPE)) { - return n.intValue(); - } - - if (c.equals(java.lang.Long.class) || - c.equals(java.lang.Long.TYPE)) { - return n.longValue(); - } - - if (c.equals(java.lang.Short.class) || - c.equals(java.lang.Short.TYPE)) { - return n.shortValue(); - } - - if (c.equals(java.lang.Float.class) || - c.equals(java.lang.Float.TYPE)) { - return n.floatValue(); - } + if (prim == Integer.TYPE) { + return (int)val; + } else if (prim == Long.TYPE) { + return (long)val; + } else if (prim == Short.TYPE) { + return (short)val; + } else if (prim == Float.TYPE) { + return (float)val; + } else if (prim == Double.TYPE) { + return val; + } else if (prim == Byte.TYPE) { + return (byte)val; + } else if (prim == Character.TYPE) { + return (char)(short)val; + } + return val; + } + + private static Object stringAsPrimitiveType(String s, Class c) + throws NumberFormatException { + double val = Double.parseDouble(s); + return toBoxedPrimitiveType(val, c); - if (c.equals(java.lang.Double.class) || - c.equals(java.lang.Double.TYPE)) { - return n.doubleValue(); - } + } - if (c.equals(java.lang.Byte.class) || - c.equals(java.lang.Byte.TYPE)) { - return n.byteValue(); + // Test whether we can get from 'args' to 'testArgs' only by using widening conversions, + // eg String -> Object + private static boolean argumentsAreSubclassesOf(Object[] args, Object[] testArgs) { + for (int i = 0; i < args.length; i++) { + if (!testArgs[i].getClass().isAssignableFrom(args[i].getClass())) { + return false; + } } - - return n; + return true; } - private static String printList(Object[] oList) { - - String ret = ""; - - ret += "{ "; - for (Object o : oList) { - - String oStr = o != null ? o.toString() + " [" + o.getClass() + "]" : "null"; - - ret += oStr; - ret += ", "; + static Class[] getParameterTypesFor(java.lang.reflect.AccessibleObject method) { + if (method instanceof Method) { + return ((Method)method).getParameterTypes(); + } else /*m instanceof Constructor*/ { + return ((Constructor)method).getParameterTypes(); } - ret = ret.substring(0, ret.length() - 2); // remove last ", " - ret += " }"; - - return ret; } - private static String getArrayAsString(Object array) { - // We are guaranteed that supplied object is a String + private static String arrayToJavascriptStyleString(Object array) { + int arrLength = Array.getLength(array); - String ret = new String(); + StringBuilder sb = new StringBuilder(); - for (int i = 0; i < Array.getLength(array); i++) { + for (int i = 0; i < arrLength; i++) { Object element = Array.get(array, i); if (element != null) { if (element.getClass().isArray()) { - ret += getArrayAsString(element); + sb.append(arrayToJavascriptStyleString(element)); } else { - ret += element; + sb.append(element); } } - ret += ","; + sb.append(','); } // Trim the final "," - if (ret.length() > 0) { - ret = ret.substring(0, ret.length() - 1); + if (arrLength > 0) { + sb.setLength(sb.length() - 1); } - return ret; - } -} - -/** Begin test classes **/ - -class FooClass { - - public FooClass() { - } - - public FooClass(Boolean b, int i) { - } - - public FooClass(Boolean b, Integer i) { - } - - public FooClass(Boolean b, short s) { - } - - public FooClass(String s, int i) { - } - - public FooClass(String s, Integer i) { - } - - public FooClass(java.lang.Number num) { - } - - public FooClass(java.lang.Integer integer) { - } - - public FooClass(long l) { - } - - public FooClass(double d) { - } - - public FooClass(float f) { - } - - public FooClass(JSObject j) { - } - - public FooClass(BarClass1 b) { - } - - public FooClass(BarClass2 b) { + return sb.toString(); } - - public FooClass(String s) { - } - - public FooClass(byte b) { - } - - public FooClass(String s, Float f) { - } - - public FooClass(int i) { - } - - public void FooClass() { - } - - public void FooClass(boolean b) { - } - - public void foo(Boolean b, int i) { - } - - public void foo(Boolean b, Integer i) { - } - - public void foo(Boolean b, short s) { - } - - public void foo_string_int(String s, int i) { - } - - public void foo_string_int(String s, Integer i) { - } - - public void foo_jsobj(JSObject j) { - } - - public void foo_jsobj(String s) { - } - - public void foo_classtype(java.lang.Number num) { - } - - public void foo_classtype(java.lang.Integer integer) { - } - - public void foo_multiprim(int i) { - } - - public void foo_multiprim(long l) { - } - - public void foo_multiprim(float f) { - } - - public void foo_multiprim(double d) { - } - - public void foo_float(float f) { - } - - public void foo_float(String s) { - } - - public void foo_float(JSObject j) { - } - - public void foo_class(BarClass1 b) { - } - - public void foo_class(BarClass2 b) { - } - - public void foo_strandbyteonly(String s) { - } - - public void foo_strandbyteonly(byte b) { - } - - public void foo_str_and_float(String s, Float f) { - } - - public void foo_int_only(int i) { - } - - public void foo_noargs() { - } - - public void foo_boolonly(boolean b) { - } -} - -class BarClass1 { -} - -class BarClass2 extends BarClass1 { -} - -class BarClass3 extends BarClass2 { -} - -class JSObject { -} +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java icedtea-web-1.4/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java --- icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java 2013-05-03 19:08:24.483517191 +0000 @@ -0,0 +1,227 @@ +/* Copyright (C) 2012 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +/* + * Copyright 1995-2004 Sun Microsystems, Inc. All Rights Reserved. + * 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. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package sun.applet; + +import java.applet.Applet; +import java.lang.reflect.InvocationTargetException; +import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; + +import javax.swing.SwingUtilities; + +import net.sourceforge.jnlp.NetxPanel; +import net.sourceforge.jnlp.PluginParameters; + +/** + * Lets us construct one using unix-style one shot behaviors + */ + +class PluginAppletPanelFactory { + + public AppletPanel createPanel(PluginStreamHandler streamhandler, + final int identifier, + final long handle, + final URL doc, + final PluginParameters params) { + final NetxPanel panel = AccessController.doPrivileged(new PrivilegedAction() { + public NetxPanel run() { + NetxPanel panel = new NetxPanel(doc, params); + NetxPanel.debug("Using NetX panel"); + PluginDebug.debug(params.toString()); + return panel; + } + }); + + // Framing the panel needs to happen in a thread whose thread group + // is the same as the threadgroup of the applet thread. If this + // isn't the case, the awt eventqueue thread's context classloader + // won't be set to a JNLPClassLoader, and when an applet class needs + // to be loaded from the awt eventqueue, it won't be found. + Thread panelInit = new Thread(panel.getThreadGroup(), new Runnable() { + @Override public void run() { + panel.createNewAppContext(); + // create the frame. + PluginDebug.debug("X and Y are: " + params.getWidth() + " " + params.getHeight()); + panel.setAppletViewerFrame(PluginAppletViewer.framePanel(identifier, handle, + params.getWidth(), params.getHeight(), panel)); + + panel.init(); + // Start the applet + initEventQueue(panel); + } + }, "NetXPanel initializer"); + + panelInit.start(); + try { + panelInit.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + setAppletViewerSize(panel, params.getWidth(), params.getHeight()); + + // Wait for the panel to initialize + PluginAppletViewer.waitForAppletInit(panel); + + Applet a = panel.getApplet(); + + // Still null? + if (a == null) { + streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization timed out"); + return null; + } + + PluginDebug.debug("Applet ", a.getClass(), " initialized"); + streamhandler.write("instance " + identifier + " reference 0 initialized"); + + panel.removeSplash(); + + AppletSecurityContextManager.getSecurityContext(0).associateSrc(panel.getAppletClassLoader(), doc); + AppletSecurityContextManager.getSecurityContext(0).associateInstance(identifier, panel.getAppletClassLoader()); + + return panel; + } + + /* AppletViewerPanel sometimes doesn't set size right initially. This + * causes the parent frame to be the default (10x10) size. + * + * Normally it goes unnoticed since browsers like Firefox make a resize + * call after init. However some browsers (e.g. Midori) don't. + * + * We therefore manually set the parent to the right size. + */ + static private void setAppletViewerSize(final AppletPanel panel, + final int width, final int height) { + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + panel.getParent().setSize(width, height); + } + }); + } catch (InvocationTargetException e) { + // Not being able to resize is non-fatal + PluginDebug.debug("Unable to resize panel: "); + e.printStackTrace(); + } catch (InterruptedException e) { + // Not being able to resize is non-fatal + PluginDebug.debug("Unable to resize panel: "); + e.printStackTrace(); + } + } + /** + * Send the initial set of events to the appletviewer event queue. + * On start-up the current behaviour is to load the applet and call + * Applet.init() and Applet.start(). + */ + private void initEventQueue(AppletPanel panel) { + // appletviewer.send.event is an undocumented and unsupported system + // property which is used exclusively for testing purposes. + PrivilegedAction pa = new PrivilegedAction() { + public String run() { + return System.getProperty("appletviewer.send.event"); + } + }; + String eventList = AccessController.doPrivileged(pa); + + if (eventList == null) { + // Add the standard events onto the event queue. + panel.sendEvent(AppletPanel.APPLET_LOAD); + panel.sendEvent(AppletPanel.APPLET_INIT); + panel.sendEvent(AppletPanel.APPLET_START); + } else { + // We're testing AppletViewer. Force the specified set of events + // onto the event queue, wait for the events to be processed, and + // exit. + + // The list of events that will be executed is provided as a + // ","-separated list. No error-checking will be done on the list. + String[] events = eventList.split(","); + + for (String event : events) { + PluginDebug.debug("Adding event to queue: ", event); + if ("dispose".equals(event)) + panel.sendEvent(AppletPanel.APPLET_DISPOSE); + else if ("load".equals(event)) + panel.sendEvent(AppletPanel.APPLET_LOAD); + else if ("init".equals(event)) + panel.sendEvent(AppletPanel.APPLET_INIT); + else if ("start".equals(event)) + panel.sendEvent(AppletPanel.APPLET_START); + else if ("stop".equals(event)) + panel.sendEvent(AppletPanel.APPLET_STOP); + else if ("destroy".equals(event)) + panel.sendEvent(AppletPanel.APPLET_DESTROY); + else if ("quit".equals(event)) + panel.sendEvent(AppletPanel.APPLET_QUIT); + else if ("error".equals(event)) + panel.sendEvent(AppletPanel.APPLET_ERROR); + else + // non-fatal error if we get an unrecognized event + PluginDebug.debug("Unrecognized event name: ", event); + } + + while (!panel.emptyEventQueue()) + ; + } + } +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java icedtea-web-1.4/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java --- icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java 2013-04-10 11:40:23.926668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java 2013-05-03 19:08:24.485517167 +0000 @@ -53,13 +53,16 @@ import java.security.PrivilegedAction; import java.security.ProtectionDomain; import java.util.ArrayList; +import java.util.Arrays; import java.util.Hashtable; import java.util.List; import java.util.Map; -import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.DefaultLaunchHandler; +import net.sourceforge.jnlp.runtime.JNLPRuntime; +import netscape.javascript.JSObject; import netscape.javascript.JSObjectCreatePermission; +import netscape.javascript.JSUtil; class Signature { private String signature; @@ -235,18 +238,23 @@ long startTime = 0; - public PluginAppletSecurityContext(int identifier) { + /* Package-private constructor that allows for bypassing security manager installation. + * This is useful for testing. Note that while the public constructor should be used otherwise, + * the security installation can't be bypassed if it has already occurred.*/ + PluginAppletSecurityContext(int identifier, boolean ensureSecurityContext) { this.identifier = identifier; - // We need a security manager.. and since there is a good chance that - // an applet will be loaded at some point, we should make it the SM - // that JNLPRuntime will try to install - if (System.getSecurityManager() == null) { - JNLPRuntime.initialize(/* isApplication */false); - JNLPRuntime.setDefaultLaunchHandler(new DefaultLaunchHandler(System.err)); - } + if (ensureSecurityContext) { + // We need a security manager.. and since there is a good chance that + // an applet will be loaded at some point, we should make it the SM + // that JNLPRuntime will try to install + if (System.getSecurityManager() == null) { + JNLPRuntime.initialize(/* isApplication */false); + JNLPRuntime.setDefaultLaunchHandler(new DefaultLaunchHandler(System.err)); + } - JNLPRuntime.disableExit(); + JNLPRuntime.disableExit(); + } URL u = null; try { @@ -258,6 +266,10 @@ this.classLoaders.put(liveconnectLoader, u); } + public PluginAppletSecurityContext(int identifier) { + this(identifier, true); + } + private static V parseCall(String s, ClassLoader cl, Class c) { if (c == Integer.class) return c.cast(new Integer(s)); @@ -318,6 +330,83 @@ return map; } + private static long privilegedJSObjectUnbox(final JSObject js) { + return AccessController.doPrivileged(new PrivilegedAction() { + public Long run() { + return JSUtil.getJSObjectInternalReference(js); + } + }); + } + + /** + * Create a string that identifies a Java object precisely, for passing to + * Javascript. + * + * For builtin value types, a 'literalreturn' prefix is used and the object + * is passed with a string representation. + * + * For JSObject's, a 'jsobject' prefix is used and the object is passed + * with the JSObject's internal identifier. + * + * For other Java objects, an object store reference is used. + * + * @param obj the object for which to create an identifier + * @param type the type to use for representation decisions + * @param unboxPrimitives whether to treat boxed primitives as value types + * @return an identifier string + */ + public String toObjectIDString(Object obj, Class type, boolean unboxPrimitives) { + + /* Void (can occur from declared return type), pass special "void" string: */ + if (type == Void.TYPE) { + return "literalreturn void"; + } + + /* Null, pass special "null" string: */ + if (obj == null) { + return "literalreturn null"; + } + + /* Primitive, accurately represented by its toString() form: */ + boolean returnAsString = ( type == Boolean.TYPE + || type == Byte.TYPE + || type == Short.TYPE + || type == Integer.TYPE + || type == Long.TYPE ); + if (unboxPrimitives) { + returnAsString = ( returnAsString + || type == Boolean.class + || type == Byte.class + || type == Short.class + || type == Integer.class + || type == Long.class); + } + if (returnAsString) { + return "literalreturn " + obj.toString(); + } + + /* Floating point number, we ensure we give enough precision: */ + if ( type == Float.TYPE || type == Double.TYPE || + ( unboxPrimitives && (type == Float.class || type == Double.class) )) { + return "literalreturn " + String.format("%308.308e", obj); + } + + /* Character that should be returned as number: */ + if (type == Character.TYPE || (unboxPrimitives && type == Character.class)) { + return "literalreturn " + (int) (Character) obj; + } + + /* JSObject, unwrap underlying Javascript reference: */ + if (type == netscape.javascript.JSObject.class) { + long reference = privilegedJSObjectUnbox((JSObject)obj); + return "jsobject " + Long.toString(reference); + } + + /* Other kind of object, track this object and return our reference: */ + store.reference(obj); + return store.getIdentifier(obj).toString(); + } + public void handleMessage(int reference, String src, AccessControlContext callContext, String message) { startTime = new java.util.Date().getTime(); @@ -426,56 +515,16 @@ if (ret instanceof Throwable) throw (Throwable) ret; - if (ret == null) { - write(reference, "GetStaticField literalreturn null"); - } else if (f.getType() == Boolean.TYPE - || f.getType() == Byte.TYPE - || f.getType() == Short.TYPE - || f.getType() == Integer.TYPE - || f.getType() == Long.TYPE) { - write(reference, "GetStaticField literalreturn " + ret); - } else if (f.getType() == Float.TYPE - || f.getType() == Double.TYPE) { - write(reference, "GetStaticField literalreturn " + String.format("%308.308e", ret)); - } else if (f.getType() == Character.TYPE) { - write(reference, "GetStaticField literalreturn " + (int) (Character) ret); - } else { - // Track returned object. - store.reference(ret); - write(reference, "GetStaticField " + store.getIdentifier(ret)); - } + String objIDStr = toObjectIDString(ret, f.getType(), false /*do not unbox primitives*/); + write(reference, "GetStaticField " + objIDStr); } else if (message.startsWith("GetValue")) { String[] args = message.split(" "); Integer index = parseCall(args[1], null, Integer.class); Object ret = store.getObject(index); - if (ret == null) { - write(reference, "GetValue literalreturn null"); - } else if (ret.getClass() == Boolean.TYPE - || ret.getClass() == Boolean.class - || ret.getClass() == Byte.TYPE - || ret.getClass() == Byte.class - || ret.getClass() == Short.TYPE - || ret.getClass() == Short.class - || ret.getClass() == Integer.TYPE - || ret.getClass() == Integer.class - || ret.getClass() == Long.TYPE - || ret.getClass() == Long.class) { - write(reference, "GetValue literalreturn " + ret); - } else if (ret.getClass() == Float.TYPE - || ret.getClass() == Float.class - || ret.getClass() == Double.TYPE - || ret.getClass() == Double.class) { - write(reference, "GetValue literalreturn " + String.format("%308.308e", ret)); - } else if (ret.getClass() == Character.TYPE - || ret.getClass() == Character.class) { - write(reference, "GetValue literalreturn " + (int) (Character) ret); - } else { - // Track returned object. - store.reference(ret); - write(reference, "GetValue " + store.getIdentifier(ret)); - } + String objIDStr = toObjectIDString(ret, ret.getClass(), true /*unbox primitives*/); + write(reference, "GetValue " + objIDStr); } else if (message.startsWith("SetStaticField") || message.startsWith("SetField")) { String[] args = message.split(" "); @@ -486,12 +535,10 @@ final Object o = store.getObject(classOrObjectID); final Field f = (Field) store.getObject(fieldID); - final Object fValue = MethodOverloadResolver.getCostAndCastedObject(value, f.getType())[1]; + final Object fValue = MethodOverloadResolver.getCostAndCastedObject(value, f.getType()).getCastedObject(); AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); - checkPermission(src, - message.startsWith("SetStaticField") ? (Class) o : o.getClass(), - acc); + checkPermission(src, message.startsWith("SetStaticField") ? (Class) o : o.getClass(), acc); Object ret = AccessController.doPrivileged(new PrivilegedAction() { public Object run() { @@ -514,27 +561,12 @@ Integer arrayID = parseCall(args[1], null, Integer.class); Integer index = parseCall(args[2], null, Integer.class); - Object ret = Array.get(store.getObject(arrayID), index); - Class retClass = store.getObject(arrayID).getClass().getComponentType(); // prevent auto-boxing influence + Object array = store.getObject(arrayID); + Object ret = Array.get(array, index); + Class retClass = array.getClass().getComponentType(); // prevent auto-boxing influence - if (ret == null) { - write(reference, "GetObjectArrayElement literalreturn null"); - } else if (retClass == Boolean.TYPE - || retClass == Byte.TYPE - || retClass == Short.TYPE - || retClass == Integer.TYPE - || retClass == Long.TYPE) { - write(reference, "GetObjectArrayElement literalreturn " + ret); - } else if (retClass == Float.TYPE - || retClass == Double.TYPE) { - write(reference, "GetObjectArrayElement literalreturn " + String.format("%308.308e", ret)); - } else if (retClass == Character.TYPE) { - write(reference, "GetObjectArrayElement literalreturn " + (int) (Character) ret); - } else { - // Track returned object. - store.reference(ret); - write(reference, "GetObjectArrayElement " + store.getIdentifier(ret)); - } + String objIDStr = toObjectIDString(ret, retClass, false /*do not unbox primitives*/); + write(reference, "GetObjectArrayElement " + objIDStr); } else if (message.startsWith("SetObjectArrayElement")) { String[] args = message.split(" "); @@ -545,7 +577,7 @@ Object value = store.getObject(objectID); // Cast the object to appropriate type before insertion - value = MethodOverloadResolver.getCostAndCastedObject(value, store.getObject(arrayID).getClass().getComponentType())[1]; + value = MethodOverloadResolver.getCostAndCastedObject(value, store.getObject(arrayID).getClass().getComponentType()).getCastedObject(); Array.set(store.getObject(arrayID), index, value); @@ -584,25 +616,8 @@ if (ret instanceof Throwable) throw (Throwable) ret; - if (ret == null) { - write(reference, "GetField literalreturn null"); - } else if (f.getType() == Boolean.TYPE - || f.getType() == Byte.TYPE - || f.getType() == Short.TYPE - || f.getType() == Integer.TYPE - || f.getType() == Long.TYPE) { - write(reference, "GetField literalreturn " + ret); - } else if (f.getType() == Float.TYPE - || f.getType() == Double.TYPE) { - write(reference, "GetField literalreturn " + String.format("%308.308e", ret)); - } else if (f.getType() == Character.TYPE) { - write(reference, "GetField literalreturn " + (int) (Character) ret); - } else { - // Track returned object. - store.reference(ret); - write(reference, "GetField " + store.getIdentifier(ret)); - } - + String objIDStr = toObjectIDString(ret, f.getType(), false /*do not unbox primitives*/); + write(reference, "GetField " + objIDStr); } else if (message.startsWith("GetObjectClass")) { int oid = Integer.parseInt(message.substring("GetObjectClass" .length() + 1)); @@ -625,36 +640,26 @@ c = (Class) store.getObject(objectID); } - // length -3 to discard first 3, + 2 for holding object - // and method name - Object[] arguments = new Object[args.length - 1]; - arguments[0] = c; - arguments[1] = methodName; - for (int i = 0; i < args.length - 3; i++) { - arguments[i + 2] = store.getObject(parseCall(args[3 + i], null, Integer.class)); - PluginDebug.debug("GOT ARG: ", arguments[i + 2]); + // Discard first 3 parts of message + Object[] arguments = new Object[args.length - 3]; + for (int i = 0; i < arguments.length; i++) { + arguments[i] = store.getObject(parseCall(args[3 + i], null, Integer.class)); + PluginDebug.debug("GOT ARG: ", arguments[i]); } - Object[] matchingMethodAndArgs = MethodOverloadResolver.getMatchingMethod(arguments); + MethodOverloadResolver.ResolvedMethod rm = + MethodOverloadResolver.getBestMatchMethod(c, methodName, arguments); - if (matchingMethodAndArgs == null) { + if (rm == null) { write(reference, "Error: No suitable method named " + methodName + " with matching args found"); return; } - final Method m = (Method) matchingMethodAndArgs[0]; - Object[] castedArgs = new Object[matchingMethodAndArgs.length - 1]; - for (int i = 0; i < castedArgs.length; i++) { - castedArgs[i] = matchingMethodAndArgs[i + 1]; - } - - String collapsedArgs = ""; - for (Object arg : castedArgs) { - collapsedArgs += " " + arg; - } + final Method m = rm.getMethod(); + final Object[] castedArgs = rm.getCastedParameters(); PluginDebug.debug("Calling method ", m, " on object ", o - , " (", c, ") with ", collapsedArgs); + , " (", c, ") with ", Arrays.toString(castedArgs)); AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); checkPermission(src, c, acc); @@ -684,31 +689,12 @@ retO = m.getReturnType().toString(); } - PluginDebug.debug("Calling ", m, " on ", o, " with " - , collapsedArgs, " and that returned: ", ret - , " of type ", retO); - - if (m.getReturnType().equals(java.lang.Void.class) || - m.getReturnType().equals(java.lang.Void.TYPE)) { - write(reference, "CallMethod literalreturn void"); - } else if (ret == null) { - write(reference, "CallMethod literalreturn null"); - } else if (m.getReturnType() == Boolean.TYPE - || m.getReturnType() == Byte.TYPE - || m.getReturnType() == Short.TYPE - || m.getReturnType() == Integer.TYPE - || m.getReturnType() == Long.TYPE) { - write(reference, "CallMethod literalreturn " + ret); - } else if (m.getReturnType() == Float.TYPE - || m.getReturnType() == Double.TYPE) { - write(reference, "CallMethod literalreturn " + String.format("%308.308e", ret)); - } else if (m.getReturnType() == Character.TYPE) { - write(reference, "CallMethod literalreturn " + (int) (Character) ret); - } else { - // Track returned object. - store.reference(ret); - write(reference, "CallMethod " + store.getIdentifier(ret)); - } + PluginDebug.debug("Calling ", m, " on ", o, " with ", + Arrays.toString(castedArgs), " and that returned: ", ret, + " of type ", retO); + + String objIDStr = toObjectIDString(ret, m.getReturnType(), false /*do not unbox primitives*/); + write(reference, "CallMethod " + objIDStr); } else if (message.startsWith("GetSuperclass")) { String[] args = message.split(" "); Integer classID = parseCall(args[1], null, Integer.class); @@ -776,10 +762,7 @@ buf = new StringBuffer(b.length * 2); buf.append(b.length); for (int i = 0; i < b.length; i++) - buf - .append(" " - + Integer - .toString(((int) b[i]) & 0x0ff, 16)); + buf.append(" " + Integer.toString(((int) b[i]) & 0x0ff, 16)); write(reference, "GetStringUTFChars " + buf); } else if (message.startsWith("GetStringChars")) { @@ -795,10 +778,7 @@ buf = new StringBuffer(b.length * 2); buf.append(b.length); for (int i = 0; i < b.length; i++) - buf - .append(" " - + Integer - .toString(((int) b[i]) & 0x0ff, 16)); + buf.append(" " + Integer.toString(((int) b[i]) & 0x0ff, 16)); PluginDebug.debug("Java: GetStringChars: ", o); PluginDebug.debug(" String BYTES: ", buf); @@ -815,10 +795,7 @@ buf = new StringBuffer(b.length * 2); buf.append(b.length); for (int i = 0; i < b.length; i++) - buf - .append(" " - + Integer - .toString(((int) b[i]) & 0x0ff, 16)); + buf.append(" " + Integer.toString(((int) b[i]) & 0x0ff, 16)); write(reference, "GetToStringValue " + buf); } else if (message.startsWith("NewArray")) { @@ -957,42 +934,30 @@ } else if (message.startsWith("NewObject")) { String[] args = message.split(" "); Integer classID = parseCall(args[1], null, Integer.class); - Class c = (Class) store.getObject(classID); - final Constructor cons; - final Object[] fArguments; + Class c = (Class) store.getObject(classID); - Object[] arguments = new Object[args.length - 1]; - arguments[0] = c; - for (int i = 0; i < args.length - 2; i++) { - arguments[i + 1] = store.getObject(parseCall(args[2 + i], + // Discard first 2 parts of message + Object[] arguments = new Object[args.length - 2]; + for (int i = 0; i < arguments.length; i++) { + arguments[i] = store.getObject(parseCall(args[2 + i], null, Integer.class)); - PluginDebug.debug("GOT ARG: ", arguments[i + 1]); + PluginDebug.debug("GOT ARG: ", arguments[i]); } - Object[] matchingConstructorAndArgs = MethodOverloadResolver - .getMatchingConstructor(arguments); + MethodOverloadResolver.ResolvedMethod resolvedConstructor = + MethodOverloadResolver.getBestMatchConstructor(c, arguments); - if (matchingConstructorAndArgs == null) { + if (resolvedConstructor == null) { write(reference, "Error: No suitable constructor with matching args found"); return; } - Object[] castedArgs = new Object[matchingConstructorAndArgs.length - 1]; - for (int i = 0; i < castedArgs.length; i++) { - castedArgs[i] = matchingConstructorAndArgs[i + 1]; - } - - cons = (Constructor) matchingConstructorAndArgs[0]; - fArguments = castedArgs; - - String collapsedArgs = ""; - for (Object arg : fArguments) { - collapsedArgs += " " + arg.toString(); - } + final Constructor cons = resolvedConstructor.getConstructor(); + final Object[] castedArgs = resolvedConstructor.getCastedParameters(); PluginDebug.debug("Calling constructor on class ", c, - " with ", collapsedArgs); + " with ", Arrays.toString(castedArgs)); AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); checkPermission(src, c, acc); @@ -1000,7 +965,7 @@ Object ret = AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { - return cons.newInstance(fArguments); + return cons.newInstance(castedArgs); } catch (Throwable t) { return t; } diff -Nru icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java icedtea-web-1.4/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java --- icedtea-web-1.3.2/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java 2013-04-10 11:40:23.928668000 +0000 +++ icedtea-web-1.4/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java 2013-05-03 19:08:24.488517130 +0000 @@ -62,15 +62,18 @@ package sun.applet; +import static net.sourceforge.jnlp.runtime.Translator.R; + import java.applet.Applet; import java.applet.AppletContext; import java.applet.AudioClip; +import java.awt.BorderLayout; +import java.awt.Component; import java.awt.Dimension; import java.awt.Frame; import java.awt.Graphics; import java.awt.Image; import java.awt.Insets; -import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; @@ -78,37 +81,40 @@ import java.awt.print.Printable; import java.io.IOException; import java.io.InputStream; -import java.io.PrintStream; -import java.io.Reader; -import java.io.StringReader; import java.io.UnsupportedEncodingException; import java.lang.reflect.InvocationTargetException; +import java.net.MalformedURLException; import java.net.SocketPermission; import java.net.URI; import java.net.URL; +import java.net.URLConnection; import java.security.AccessController; import java.security.AllPermission; import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.util.Enumeration; import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import java.util.Vector; - import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.TimeUnit; - import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; import javax.swing.SwingUtilities; +import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.NetxPanel; +import net.sourceforge.jnlp.PluginParameters; import net.sourceforge.jnlp.runtime.JNLPClassLoader; +import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; +import net.sourceforge.jnlp.security.appletextendedsecurity.AppletStartupSecuritySettings; +import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteUnsignedApplet; +import net.sourceforge.jnlp.splashscreen.SplashController; +import net.sourceforge.jnlp.splashscreen.SplashPanel; +import net.sourceforge.jnlp.splashscreen.SplashUtils; import sun.awt.AppContext; import sun.awt.SunToolkit; import sun.awt.X11.XEmbeddedFrame; @@ -116,162 +122,12 @@ import com.sun.jndi.toolkit.url.UrlUtil; -/** - * Lets us construct one using unix-style one shot behaviors - */ - -class PluginAppletPanelFactory { - - public AppletPanel createPanel(PluginStreamHandler streamhandler, - final int identifier, - final long handle, int x, int y, - final URL doc, - final Hashtable atts) { - final NetxPanel panel = AccessController.doPrivileged(new PrivilegedAction() { - public NetxPanel run() { - NetxPanel panel = new NetxPanel(doc, atts, false); - NetxPanel.debug("Using NetX panel"); - PluginDebug.debug(atts.toString()); - return panel; - } - }); - - // Framing the panel needs to happen in a thread whose thread group - // is the same as the threadgroup of the applet thread. If this - // isn't the case, the awt eventqueue thread's context classloader - // won't be set to a JNLPClassLoader, and when an applet class needs - // to be loaded from the awt eventqueue, it won't be found. - Thread panelInit = new Thread(panel.getThreadGroup(), new Runnable() { - @Override public void run() { - panel.createNewAppContext(); - // create the frame. - PluginAppletViewer.framePanel(identifier, handle, panel); - panel.init(); - // Start the applet - initEventQueue(panel); - } - }, "NetXPanel initializer"); - - panelInit.start(); - while(panelInit.isAlive()) { - try { - panelInit.join(); - } catch (InterruptedException e) { - } - } - - // Wait for the panel to initialize - PluginAppletViewer.waitForAppletInit(panel); - - Applet a = panel.getApplet(); - - // Still null? - if (a == null) { - streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization timed out"); - return null; - } - - PluginDebug.debug("Applet ", a.getClass(), " initialized"); - streamhandler.write("instance " + identifier + " reference 0 initialized"); - - /* AppletViewerPanel sometimes doesn't set size right initially. This - * causes the parent frame to be the default (10x10) size. - * - * Normally it goes unnoticed since browsers like Firefox make a resize - * call after init. However some browsers (e.g. Midori) don't. - * - * We therefore manually set the parent to the right size. - */ - try { - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - panel.getParent().setSize(Integer.valueOf(atts.get("width")), Integer.valueOf(atts.get("height"))); - } - }); - } catch (InvocationTargetException ite) { - // Not being able to resize is non-fatal - PluginDebug.debug("Unable to resize panel: "); - ite.printStackTrace(); - } catch (InterruptedException ie) { - // Not being able to resize is non-fatal - PluginDebug.debug("Unable to resize panel: "); - ie.printStackTrace(); - } - - AppletSecurityContextManager.getSecurityContext(0).associateSrc(panel.getAppletClassLoader(), doc); - AppletSecurityContextManager.getSecurityContext(0).associateInstance(identifier, panel.getAppletClassLoader()); - - return panel; - } - - public boolean isStandalone() { - return false; - } - - /** - * Send the initial set of events to the appletviewer event queue. - * On start-up the current behaviour is to load the applet and call - * Applet.init() and Applet.start(). - */ - private void initEventQueue(AppletPanel panel) { - // appletviewer.send.event is an undocumented and unsupported system - // property which is used exclusively for testing purposes. - PrivilegedAction pa = new PrivilegedAction() { - public String run() { - return System.getProperty("appletviewer.send.event"); - } - }; - String eventList = AccessController.doPrivileged(pa); - - if (eventList == null) { - // Add the standard events onto the event queue. - panel.sendEvent(AppletPanel.APPLET_LOAD); - panel.sendEvent(AppletPanel.APPLET_INIT); - panel.sendEvent(AppletPanel.APPLET_START); - } else { - // We're testing AppletViewer. Force the specified set of events - // onto the event queue, wait for the events to be processed, and - // exit. - - // The list of events that will be executed is provided as a - // ","-separated list. No error-checking will be done on the list. - String[] events = eventList.split(","); - - for (String event : events) { - PluginDebug.debug("Adding event to queue: ", event); - if ("dispose".equals(event)) - panel.sendEvent(AppletPanel.APPLET_DISPOSE); - else if ("load".equals(event)) - panel.sendEvent(AppletPanel.APPLET_LOAD); - else if ("init".equals(event)) - panel.sendEvent(AppletPanel.APPLET_INIT); - else if ("start".equals(event)) - panel.sendEvent(AppletPanel.APPLET_START); - else if ("stop".equals(event)) - panel.sendEvent(AppletPanel.APPLET_STOP); - else if ("destroy".equals(event)) - panel.sendEvent(AppletPanel.APPLET_DESTROY); - else if ("quit".equals(event)) - panel.sendEvent(AppletPanel.APPLET_QUIT); - else if ("error".equals(event)) - panel.sendEvent(AppletPanel.APPLET_ERROR); - else - // non-fatal error if we get an unrecognized event - PluginDebug.debug("Unrecognized event name: ", event); - } - - while (!panel.emptyEventQueue()) - ; - } - } -} - /* */ // FIXME: declare JSProxy implementation @SuppressWarnings("serial") public class PluginAppletViewer extends XEmbeddedFrame - implements AppletContext, Printable { + implements AppletContext, Printable, SplashController { /** * Enumerates the current status of an applet @@ -323,26 +179,33 @@ private Image bufFrameImg; private Graphics bufFrameImgGraphics; + + private SplashPanel splashPanel; + /** * Null constructor to allow instantiation via newInstance() */ public PluginAppletViewer() { } - public static void framePanel(int identifier, long handle, NetxPanel panel) { + public static PluginAppletViewer framePanel(int identifier, long handle, int width, int height, NetxPanel panel) { PluginDebug.debug("Framing ", panel); - - // SecurityManager MUST be set, and only privileged code may call reFrame() + + // SecurityManager MUST be set, and only privileged code may call framePanel() System.getSecurityManager().checkPermission(new AllPermission()); PluginAppletViewer appletFrame = new PluginAppletViewer(handle, identifier, panel); - - appletFrame.add("Center", panel); - appletFrame.pack(); - + appletFrame.setSize(width, height); + appletFrame.appletEventListener = new AppletEventListener(appletFrame, appletFrame); panel.addAppletListener(appletFrame.appletEventListener); + // Clear references, if any + if (applets.containsKey(identifier)) { + PluginAppletViewer oldFrame = applets.get(identifier); + oldFrame.remove(panel); + panel.removeAppletListener(oldFrame.appletEventListener); + } appletsLock.lock(); applets.put(identifier, appletFrame); @@ -350,6 +213,7 @@ appletsLock.unlock(); PluginDebug.debug(panel, " framed"); + return appletFrame; } /** @@ -383,7 +247,87 @@ }; addWindowListener(windowEventListener); + final AppletPanel fPanel = panel; + try { + SwingUtilities.invokeAndWait(new SplashCreator(fPanel)); + } catch (Exception e) { + e.printStackTrace(); // Not much we can do other than print + } + + } + + public void replaceSplash(final SplashPanel newSplash) { + if (splashPanel == null) { + return; + } + if (newSplash == null) { + removeSplash(); + return; + } + try { + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + splashPanel.getSplashComponent().setVisible(false); + splashPanel.stopAnimation(); + remove(splashPanel.getSplashComponent()); + newSplash.setPercentage(splashPanel.getPercentage()); + newSplash.setSplashWidth(splashPanel.getSplashWidth()); + newSplash.setSplashHeight(splashPanel.getSplashHeight()); + newSplash.adjustForSize(); + splashPanel = newSplash; + add("Center", splashPanel.getSplashComponent()); + pack(); + } + }); + } catch (Exception e) { + e.printStackTrace(); // Not much we can do other than print + } + } + + @Override + public void removeSplash() { + if (splashPanel == null) { + return; + } + try { + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + splashPanel.getSplashComponent().setVisible(false); + splashPanel.stopAnimation(); + removeAll(); + setLayout(new BorderLayout()); + //remove(splashPanel.getSplashComponent()); + splashPanel = null; + //remove(panel); + // Re-add the applet to notify container + add(panel); + panel.setVisible(true); + pack(); + } + }); + } catch (Exception e) { + e.printStackTrace(); // Not much we can do other than print + } + } + @Override + public int getSplashWidth() { + if (splashPanel != null) { + return splashPanel.getSplashWidth(); + } else { + return -1; + } + } + + @Override + public int getSplashHeigth() { + if (splashPanel != null) { + return splashPanel.getSplashHeight(); + } else { + return -1; + } } private static class AppletEventListener implements AppletListener { @@ -401,7 +345,6 @@ panelLock.lock(); panelLive.signalAll(); panelLock.unlock(); - switch (evt.getID()) { case AppletPanel.APPLET_RESIZE: { if (src != null) { @@ -436,6 +379,23 @@ break; } + case AppletPanel.APPLET_START: { + if (src.status != AppletPanel.APPLET_INIT && src.status != AppletPanel.APPLET_STOP) { + String s="Applet started, but but reached invalid state"; + PluginDebug.debug(s); + SplashPanel sp=SplashUtils.getErrorSplashScreen(appletViewer.panel.getWidth(), appletViewer.panel.getHeight(), new Exception(s)); + appletViewer.replaceSplash(sp); + } + + break; + } + case AppletPanel.APPLET_ERROR: { + String s="Undefined error causing applet not to staart appeared"; + PluginDebug.debug(s); + SplashPanel sp=SplashUtils.getErrorSplashScreen(appletViewer.panel.getWidth(), appletViewer.panel.getHeight(), new Exception(s)); + appletViewer.replaceSplash(sp); + break; + } } } } @@ -448,80 +408,101 @@ requestFactory = rf; } - /** - * Handle an incoming message from the plugin. - */ - public static void handleMessage(int identifier, int reference, String message) { + private static void handleInitializationMessage(int identifier, String message) throws IOException, LaunchException { - PluginDebug.debug("PAV handling: ", message); + /* The user has specified via a global setting that applets should not be run.*/ + if (AppletStartupSecuritySettings.getInstance().getSecurityLevel() == AppletSecurityLevel.DENY_ALL) { + throw new LaunchException(null, null, R("LSFatal"), R("LCClient"), R("LUnsignedApplet"), R("LUnsignedAppletPolicyDenied")); + } + + // If there is a key for this status, it means it + // was either initialized before, or destroy has been + // processed. Stop moving further. + if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) + return; + // Extract the information from the message + String[] msgParts = new String[4]; + for (int i = 0; i < 3; i++) { + int spaceLocation = message.indexOf(' '); + int nextSpaceLocation = message.indexOf(' ', spaceLocation + 1); + msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); + message = message.substring(nextSpaceLocation + 1); + } + + long handle = Long.parseLong(msgParts[0]); + String width = msgParts[1]; + String height = msgParts[2]; + + int spaceLocation = message.indexOf(' ', "tag".length() + 1); + String documentBase = message.substring("tag".length() + 1, spaceLocation); + String paramString = message.substring(spaceLocation + 1); + + PluginDebug.debug("Handle = ", handle, "\n", + "Width = ", width, "\n", + "Height = ", height, "\n", + "DocumentBase = ", documentBase, "\n", + "Params = ", paramString); + + PluginAppletPanelFactory factory = new PluginAppletPanelFactory(); + AppletMessageHandler amh = new AppletMessageHandler("appletviewer"); + URL url = new URL(documentBase); + URLConnection conn = url.openConnection(); + /* The original URL may have been redirected - this + * sets it to whatever URL/codebase we ended up getting + */ + url = conn.getURL(); + + PluginParameters params = new PluginParameterParser().parse(width, height, paramString); + + // Let user know we are starting up + streamhandler.write("instance " + identifier + " status " + amh.getMessage("status.start")); + factory.createPanel(streamhandler, identifier, handle, url, params); + + long maxTimeToSleep = APPLET_TIMEOUT; + appletsLock.lock(); try { - if (message.startsWith("handle")) { + while (!applets.containsKey(identifier) && + maxTimeToSleep > 0) { // Map is populated only by reFrame + maxTimeToSleep -= waitTillTimeout(appletsLock, appletAdded, + maxTimeToSleep); + } + } + finally { + appletsLock.unlock(); + } - // If there is a key for this status, it means it - // was either initialized before, or destroy has been - // processed. Stop moving further. - if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) - return; + // If wait exceeded maxWait, we timed out. Throw an exception + if (maxTimeToSleep <= 0) { + // Caught in handleMessage + throw new RuntimeException("Applet initialization timeout"); + } - // Extract the information from the message - String[] msgParts = new String[4]; - for (int i = 0; i < 3; i++) { - int spaceLocation = message.indexOf(' '); - int nextSpaceLocation = message.indexOf(' ', spaceLocation + 1); - msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); - message = message.substring(nextSpaceLocation + 1); - } + // We should not try to destroy an applet during + // initialization. It may cause an inconsistent state, + // which would bad if it's a trusted applet that + // read/writes to files + waitForAppletInit(applets.get(identifier).panel); - long handle = Long.parseLong(msgParts[0]); - String width = msgParts[1]; - String height = msgParts[2]; - - int spaceLocation = message.indexOf(' ', "tag".length() + 1); - String documentBase = - UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); - String tag = message.substring(spaceLocation + 1); - - PluginDebug.debug("Handle = ", handle, "\n", - "Width = ", width, "\n", - "Height = ", height, "\n", - "DocumentBase = ", documentBase, "\n", - "Tag = ", tag); - - PluginAppletViewer.parse - (identifier, handle, width, height, - new StringReader(tag), - new URL(documentBase)); + // Should we proceed with reframing? + PluginDebug.debug("Init complete"); - long maxTimeToSleep = APPLET_TIMEOUT; - appletsLock.lock(); - try { - while (!applets.containsKey(identifier) && - maxTimeToSleep > 0) { // Map is populated only by reFrame - maxTimeToSleep -= waitTillTimeout(appletsLock, appletAdded, - maxTimeToSleep); - } - } - finally { - appletsLock.unlock(); - } + if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { + destroyApplet(identifier); + return; + } + } - // If wait exceeded maxWait, we timed out. Throw an exception - if (maxTimeToSleep <= 0) - throw new Exception("Applet initialization timeout"); - - // We should not try to destroy an applet during - // initialization. It may cause an inconsistent state, - // which would bad if it's a trusted applet that - // read/writes to files - waitForAppletInit(applets.get(identifier).panel); + /** + * Handle an incoming message from the plugin. + */ + public static void handleMessage(int identifier, int reference, String message) { - // Should we proceed with reframing? - if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { - destroyApplet(identifier); - return; - } + PluginDebug.debug("PAV handling: ", message); + try { + if (message.startsWith("handle")) { + handleInitializationMessage(identifier, message); } else if (message.startsWith("destroy")) { // Set it inactive, and try to do cleanup is applicable @@ -612,6 +593,10 @@ private static synchronized void destroyApplet(int identifier) { + // We should not try to destroy an applet during + // initialization. It may cause an inconsistent state. + waitForAppletInit( applets.get(identifier).panel ); + PluginDebug.debug("DestroyApplet called for ", identifier); PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); @@ -656,13 +641,14 @@ */ public static void waitForAppletInit(NetxPanel panel) { + PluginDebug.debug("Waiting for applet init"); + // Wait till initialization finishes long maxTimeToSleep = APPLET_TIMEOUT; panelLock.lock(); try { - while (panel.getApplet() == null && - panel.isAlive() && + while (!panel.isInitialized() && maxTimeToSleep > 0) { PluginDebug.debug("Waiting for applet panel ", panel, " to initialize..."); maxTimeToSleep -= waitTillTimeout(panelLock, panelLive, maxTimeToSleep); @@ -740,28 +726,16 @@ // object should belong to? Object o; - // First, wait for panel to instantiate - // Next, wait for panel to come alive - long maxTimeToSleep = APPLET_TIMEOUT; - panelLock.lock(); - try { - while (panel == null || !panel.isAlive()) - maxTimeToSleep -= waitTillTimeout(panelLock, panelLive, - maxTimeToSleep); - } - finally { - panelLock.unlock(); - } - // Wait for the panel to initialize // (happens in a separate thread) waitForAppletInit(panel); - PluginDebug.debug(panel, " -- ", panel.getApplet(), " -- ", panel.isAlive()); + PluginDebug.debug(panel, " -- ", panel.getApplet(), " -- initialized: ", panel.isInitialized()); // Still null? if (panel.getApplet() == null) { - streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization timed out"); + streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization failed"); + streamhandler.write("context 0 reference " + reference + " Error"); return; } @@ -1028,43 +1002,21 @@ } public static void setMember(long internal, String name, Object value) { - System.err.println("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive()); - AppletSecurityContextManager.getSecurityContext(0).store(name); - int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name); + PluginDebug.debug("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive()); + PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0); + securityContext.store(name); + int nameID = securityContext.getIdentifier(name); Long reference = getRequestIdentifier(); // work on a copy of value, as we don't want to be manipulating // complex objects - String valueToSetTo; - if (value instanceof java.lang.Byte || - value instanceof java.lang.Character || - value instanceof java.lang.Short || - value instanceof java.lang.Integer || - value instanceof java.lang.Long || - value instanceof java.lang.Float || - value instanceof java.lang.Double || - value instanceof java.lang.Boolean) { - - valueToSetTo = "literalreturn " + value.toString(); - - // Character -> Str results in str value.. we need int value as - // per specs. - if (value instanceof java.lang.Character) { - valueToSetTo = "literalreturn " + (int) ((java.lang.Character) value).charValue(); - } else if (value instanceof Float || - value instanceof Double) { - valueToSetTo = "literalreturn " + String.format("%308.308e", value); - } - - } else { - AppletSecurityContextManager.getSecurityContext(0).store(value); - valueToSetTo = Integer.toString(AppletSecurityContextManager.getSecurityContext(0).getIdentifier(value)); - } + String objIDStr = securityContext.toObjectIDString(value, + value.getClass(), true /* unbox primitives */); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("void", "instance " + 0 + " reference " + reference + " SetMember " + - internal + " " + nameID + " " + valueToSetTo, reference); + internal + " " + nameID + " " + objIDStr, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); @@ -1086,41 +1038,17 @@ // FIXME: handle long index as well. public static void setSlot(long internal, int index, Object value) { - AppletSecurityContextManager.getSecurityContext(0).store(value); + PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0); + securityContext.store(value); Long reference = getRequestIdentifier(); - // work on a copy of value, as we don't want to be manipulating - // complex objects - String valueToSetTo; - if (value instanceof java.lang.Byte || - value instanceof java.lang.Character || - value instanceof java.lang.Short || - value instanceof java.lang.Integer || - value instanceof java.lang.Long || - value instanceof java.lang.Float || - value instanceof java.lang.Double || - value instanceof java.lang.Boolean) { - - valueToSetTo = "literalreturn " + value.toString(); - - // Character -> Str results in str value.. we need int value as - // per specs. - if (value instanceof java.lang.Character) { - valueToSetTo = "literalreturn " + (int) ((java.lang.Character) value).charValue(); - } else if (value instanceof Float || - value instanceof Double) { - valueToSetTo = "literalreturn " + String.format("%308.308e", value); - } - - } else { - AppletSecurityContextManager.getSecurityContext(0).store(value); - valueToSetTo = Integer.toString(AppletSecurityContextManager.getSecurityContext(0).getIdentifier(value)); - } + String objIDStr = securityContext.toObjectIDString(value, + value.getClass(), true /* unbox primitives */); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("void", "instance " + 0 + " reference " + reference + " SetSlot " + - internal + " " + index + " " + valueToSetTo, reference); + internal + " " + index + " " + objIDStr, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); @@ -1414,24 +1342,6 @@ } /** - * Decodes the string (converts html escapes into proper characters) - * - * @param toDecode The string to decode - * @return The decoded string - */ - public static String decodeString(String toDecode) { - - toDecode = toDecode.replace(">", ">"); - toDecode = toDecode.replace("<", "<"); - toDecode = toDecode.replace("&", "&"); - toDecode = toDecode.replace(" ", "\n"); - toDecode = toDecode.replace(" ", "\r"); - toDecode = toDecode.replace(""", "\""); - - return toDecode; - } - - /** * System parameters. */ static Hashtable systemParam = new Hashtable(); @@ -1448,76 +1358,14 @@ } /** - * Print the HTML tag. - */ - public static void printTag(PrintStream out, Hashtable atts) { - out.print(""); - - // A very slow sorting algorithm - int len = atts.size(); - String params[] = new String[len]; - len = 0; - for (Enumeration e = atts.keys(); e.hasMoreElements();) { - String param = e.nextElement(); - int i = 0; - for (; i < len; i++) { - if (params[i].compareTo(param) >= 0) { - break; - } - } - System.arraycopy(params, i, params, i + 1, len - i); - params[i] = param; - len++; - } - - for (int i = 0; i < len; i++) { - String param = params[i]; - if (systemParam.get(param) == null) { - out.println(""); - } - } - out.println(""); - } - - /** * Make sure the atrributes are uptodate. */ public void updateAtts() { Dimension d = panel.getSize(); Insets in = panel.getInsets(); - panel.atts.put("width", - Integer.valueOf(d.width - (in.left + in.right)).toString()); - panel.atts.put("height", - Integer.valueOf(d.height - (in.top + in.bottom)).toString()); + int width = d.width - (in.left + in.right); + int height = d.height - (in.top + in.bottom); + panel.updateSizeInAtts(height, width); } /** @@ -1621,8 +1469,6 @@ if (cl instanceof JNLPClassLoader.CodeBaseClassLoader) cl = ((JNLPClassLoader.CodeBaseClassLoader) cl).getParentJNLPClassLoader(); - ThreadGroup tg = ((JNLPClassLoader) cl).getApplication().getThreadGroup(); - appletShutdown(p); appletPanels.removeElement(p); @@ -1664,412 +1510,6 @@ return appletPanels.size(); } - /** - * Scan spaces. - */ - public static void skipSpace(int[] c, Reader in) throws IOException { - while ((c[0] >= 0) && - ((c[0] == ' ') || (c[0] == '\t') || (c[0] == '\n') || (c[0] == '\r'))) { - c[0] = in.read(); - } - } - - /** - * Scan identifier - */ - public static String scanIdentifier(int[] c, Reader in) throws IOException { - StringBuilder buf = new StringBuilder(); - - if (c[0] == '!') { - // Technically, we should be scanning for '!--' but we are reading - // from a stream, and there is no way to peek ahead. That said, - // a ! at this point can only mean comment here afaik, so we - // should be okay - skipComment(c, in); - return ""; - } - - while (true) { - if (((c[0] >= 'a') && (c[0] <= 'z')) || - ((c[0] >= 'A') && (c[0] <= 'Z')) || - ((c[0] >= '0') && (c[0] <= '9')) || (c[0] == '_')) { - buf.append((char) c[0]); - c[0] = in.read(); - } else { - return buf.toString(); - } - } - } - - public static void skipComment(int[] c, Reader in) throws IOException { - StringBuilder buf = new StringBuilder(); - boolean commentHeaderPassed = false; - c[0] = in.read(); - buf.append((char) c[0]); - - while (true) { - if (c[0] == '-' && (c[0] = in.read()) == '-') { - buf.append((char) c[0]); - if (commentHeaderPassed) { - // -- encountered ... is > next? - if ((c[0] = in.read()) == '>') { - buf.append((char) c[0]); - - PluginDebug.debug("Comment skipped: ", buf.toString()); - - // comment skipped. - return; - } - } else { - // first -- is part of + + + + AdditionalJarsInMetaInfIndexListSigned + IcedTea + + AdditionalJarsInMetaInfIndexListSigned + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListUnsigned.jnlp icedtea-web-1.4/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListUnsigned.jnlp --- icedtea-web-1.3.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListUnsigned.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListUnsigned.jnlp 2013-05-03 19:08:24.672514818 +0000 @@ -0,0 +1,53 @@ + + + + + AdditionalJarsInMetaInfIndexListUnsigned + IcedTea + + AdditionalJarsInMetaInfIndexListUnsigned + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfIndexList.java icedtea-web-1.4/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfIndexList.java --- icedtea-web-1.3.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfIndexList.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfIndexList.java 2013-05-03 19:08:24.673514805 +0000 @@ -0,0 +1,41 @@ +/* +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +public class LoadedViaMetaInfIndexList { + public static void main(String[] args) { + System.out.println("Program Executed Correctly."); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile icedtea-web-1.4/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile --- icedtea-web-1.3.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile 2013-05-03 19:08:24.673514805 +0000 @@ -0,0 +1,61 @@ +TESTNAME=AdditionalJarsInMetaInfIndexList +ARCHIVE_TEST_FOLDER=archive_tag_folder_test + +JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar +KEYTOOL=$(BOOT_DIR)/bin/keytool +JARSIGNER=$(BOOT_DIR)/bin/jarsigner +JAVAC=$(BOOT_DIR)/bin/javac +JAR=$(BOOT_DIR)/bin/jar + +# File used because the 'jar' command does not accept an empty file +DUMMY_FILE=jar_dummy_content + +# Index jar causes main class jar to load +INDEX_JAR_UNSIGNED=AdditionalJarsInMetaInfIndexListUnsigned.jar +INDEX_JAR_SIGNED=AdditionalJarsInMetaInfIndexListSigned.jar + +MAINCLASS=LoadedViaMetaInfIndexList + +MAINCLASS_JAR_UNSIGNED=LoadedViaMetaInfIndexListUnsigned.jar +MAINCLASS_JAR_SIGNED=LoadedViaMetaInfIndexListSigned.jar + +TMPDIR:=$(shell mktemp -d) + +prepare-reproducer: + echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) + + $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(MAINCLASS).java + + # Create the jars which have INDEX.LIST + cd $(TMPDIR) ; \ + echo "This file exists because jar command does not take 0 args" > $(DUMMY_FILE) ; \ + $(JAR) cvf $(INDEX_JAR_UNSIGNED) $(DUMMY_FILE) ; \ + $(JAR) cvf $(INDEX_JAR_SIGNED) $(DUMMY_FILE) ; + + # Create the jar which has the main-class + # and update INDEX_JAR_*'s index + cd $(TMPDIR) ; \ + $(JAR) cvf $(MAINCLASS_JAR_UNSIGNED) $(MAINCLASS).class ; \ + $(JAR) cvf $(MAINCLASS_JAR_SIGNED) $(MAINCLASS).class ; \ + $(JAR) i $(INDEX_JAR_UNSIGNED) $(MAINCLASS_JAR_UNSIGNED) ; \ + $(JAR) i $(INDEX_JAR_SIGNED) $(MAINCLASS_JAR_SIGNED) ; + + # Sign some of the jars for the signed jar test + cd $(TMPDIR) ; \ + for jar_to_sign in $(MAINCLASS_JAR_SIGNED) $(INDEX_JAR_SIGNED); do \ + $(BOOT_DIR)/bin/jarsigner -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) \ + -keypass $(PRIVATE_KEYSTORE_PASS) "$$jar_to_sign" $(TEST_CERT_ALIAS)_signed ; \ + done + + # Move jars into deployment directory + cd $(TMPDIR); \ + mv $(INDEX_JAR_UNSIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ + mv $(INDEX_JAR_SIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ + mv $(MAINCLASS_JAR_UNSIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ + mv $(MAINCLASS_JAR_SIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; + + echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) + rm -rf $(TMPDIR) + +clean-reproducer: + echo NOTHING TO CLEAN FOR $(TESTNAME) diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java icedtea-web-1.4/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java --- icedtea-web-1.3.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java 2013-05-03 19:08:24.674514792 +0000 @@ -0,0 +1,71 @@ +/* AdditionalJarsInMetaInfIndexListTests.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import static org.junit.Assert.*; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.KnownToFail; +import net.sourceforge.jnlp.browsertesting.BrowserTest; + +import org.junit.Test; + +public class AdditionalJarsInMetaInfIndexListTests extends BrowserTest { + + private static ServerAccess server = new ServerAccess(); + private static final List TRUSTALL = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); + private static final String CORRECT_EXEC = "Program Executed Correctly."; + + @Test + @KnownToFail + @Bug(id = "PR1112") + public void SignedMetaInfIndexListTest() throws Exception { + ProcessResult pr = server.executeJavawsHeadless("/AdditionalJarsInMetaInfIndexListSigned.jnlp"); + assertTrue("LoadedViaMetaInfIndexList's stdout should contain " + CORRECT_EXEC + " but did not.", pr.stdout.contains(CORRECT_EXEC)); + } + + @Test + public void UnsignedMetaInfIndexListTest() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(TRUSTALL, "/AdditionalJarsInMetaInfIndexListUnsigned.jnlp"); + assertTrue("LoadedViaMetaInfIndexList's stdout should contain " + CORRECT_EXEC + " but did not.", pr.stdout.contains(CORRECT_EXEC)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/README icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/README --- icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/README 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/README 2013-05-03 19:08:24.674514792 +0000 @@ -0,0 +1,2 @@ +This reproducer encapsulates PR920. +A LinkageError occurs, complaining of duplicate class definition, when an extended class outside of a jar references a common class with its parent class. The common class attempts to load twice. diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOutsideJar.html icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOutsideJar.html --- icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOutsideJar.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOutsideJar.html 2013-05-03 19:08:24.674514792 +0000 @@ -0,0 +1,45 @@ + + + +

    + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar.java icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar.java --- icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar.java 2013-05-03 19:08:24.675514779 +0000 @@ -0,0 +1,43 @@ +/* +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import javax.swing.JApplet; + +public class AppletReferenceInSameJar extends JApplet { + + Referenced sameJarReference = new Referenced(); +} diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java --- icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java 2013-05-03 19:08:24.675514779 +0000 @@ -0,0 +1,48 @@ +/* +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import javax.swing.JApplet; + +public class AppletReferenceOutOfJar extends AppletReferenceInSameJar { + + Referenced outOfJarReference = new Referenced(); + + public void init() { + System.out.println("My simple applet is running."); + System.out.println("*** APPLET FINISHED ***"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile --- icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile 2013-05-03 19:08:24.676514766 +0000 @@ -0,0 +1,27 @@ +TESTNAME=AppletExtendsFromOutsideJar + +SRC_FILES=AppletReferenceInSameJar.java AppletReferenceOutOfJar.java Referenced.java +JAR_FILES=AppletReferenceInSameJar.class Referenced.class +OUTER_FILE=AppletReferenceOutOfJar.class + +JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar +JAVAC=$(BOOT_DIR)/bin/javac +JAR=$(BOOT_DIR)/bin/jar + +TMPDIR:=$(shell mktemp -d) + +prepare-reproducer: + echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) + + $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(SRC_FILES) + + cd $(TMPDIR); \ + $(JAR) cvf $(TESTNAME).jar $(JAR_FILES); \ + mv $(OUTER_FILE) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ + mv $(TESTNAME).jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); + + echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) + rm -rf $(TMPDIR) + +clean-reproducer: + echo NOTHING TO CLEAN FOR $(TESTNAME) diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Referenced.java icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Referenced.java --- icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Referenced.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Referenced.java 2013-05-03 19:08:24.676514766 +0000 @@ -0,0 +1,40 @@ +/* +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +public class Referenced { + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java --- icedtea-web-1.3.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java 2013-05-03 19:08:24.676514766 +0000 @@ -0,0 +1,64 @@ +/* AppletExtendsFromOutsideJarTests.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; + +import org.junit.Assert; +import org.junit.Test; + +public class AppletExtendsFromOutsideJarTests extends BrowserTest { + + private static final String LINKAGE_ERROR_OCCURRENCE = "java.lang.LinkageError: "; + private static final String APPLET_RUNNING = "My simple applet is running."; + + @NeedsDisplay + @Test + @TestInBrowsers(testIn = { Browsers.one }) + @Bug(id = "PR920") + public void testClassInAppletFolder() throws Exception { + ProcessResult pr = server.executeBrowser("/AppletExtendsFromOutsideJar.html", AutoClose.CLOSE_ON_BOTH); + + Assert.assertFalse("Linkage error should not occur but did!", pr.stderr.contains(LINKAGE_ERROR_OCCURRENCE)); + Assert.assertTrue("Expected '" + APPLET_RUNNING + "', stdout was: " + pr.stdout, pr.stdout.contains(APPLET_RUNNING)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.html icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.html --- icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.html 2013-05-03 19:08:24.679514728 +0000 @@ -0,0 +1,46 @@ + +

    + + + + +

    + diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.jnlp icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.jnlp --- icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.jnlp 2013-05-03 19:08:24.680514716 +0000 @@ -0,0 +1,57 @@ + + + + + MultipleSignaturesPerJarMatching + IcedTea + + MultipleSignaturesPerJarMatching + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.html icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.html --- icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.html 2013-05-03 19:08:24.680514716 +0000 @@ -0,0 +1,46 @@ + +

    + + + + +

    + \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.jnlp icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.jnlp --- icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.jnlp 2013-05-03 19:08:24.680514716 +0000 @@ -0,0 +1,57 @@ + + + + + MultipleSignaturesPerJarMismatching + IcedTea + + MultipleSignaturesPerJarMismatching + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/Makefile icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/Makefile --- icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/Makefile 2013-05-03 19:08:24.681514704 +0000 @@ -0,0 +1,56 @@ +TESTNAME=MultipleSignaturesPerJar + +JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar +KEYTOOL=$(BOOT_DIR)/bin/keytool +JARSIGNER=$(BOOT_DIR)/bin/jarsigner +JARSIGNER_CMD=$(JARSIGNER) -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) -keypass $(PRIVATE_KEYSTORE_PASS) +JAVAC=$(BOOT_DIR)/bin/javac +JAR=$(BOOT_DIR)/bin/jar + +# Index jar causes main class jar to load + +TMPDIR:=$(shell mktemp -d) + +prepare-reproducer: + echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) + + $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) somecrazytestpackage/MultipleSignaturesPerJarMain.java + + # Extract ReadPropertiesSigned.class for our usage + cd $(TMPDIR) ; \ + $(JAR) xf $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/ReadPropertiesSigned.jar ReadPropertiesSigned.class ; + + # Create jars *testname*_A_and_B.jar, *testname*_A_only.jar, *testname*_B_only.jar + # These are signed by signatures A and B, A only, B only, respectively. + + # *testname*_A_and_B.jar as well as *testname*_B_only.jar contain ReadPropertiesSigned.class, which exercises the signing. + # *testname*_A_only.jar contains MultipleSignaturesTest.class, the (reused) main class for this reproducer. + + cd $(TMPDIR) ; \ + $(JAR) cvf $(TESTNAME)_B_only.jar ReadPropertiesSigned.class ; \ + cp $(TESTNAME)_B_only.jar $(TESTNAME)_A_and_B.jar ; \ + $(JAR) cvf $(TESTNAME)_A_only.jar somecrazytestpackage ; + + # Sign with signature 'A', the signature used in the 'signed' reproducer group + cd $(TMPDIR) ; \ + for jar_to_sign in $(TESTNAME)_A_only.jar $(TESTNAME)_A_and_B.jar; do \ + $(JARSIGNER_CMD) -sigfile Alpha "$$jar_to_sign" $(TEST_CERT_ALIAS)_signed ; \ + done + + # Sign with signature 'B', the signature used in the 'signed2' reproducer group + cd $(TMPDIR) ; \ + for jar_to_sign in $(TESTNAME)_B_only.jar $(TESTNAME)_A_and_B.jar; do \ + $(JARSIGNER_CMD) -sigfile Beta "$$jar_to_sign" $(TEST_CERT_ALIAS)_signed2 ; \ + done + + # Move jars into deployment directory + cd $(TMPDIR); \ + mv $(TESTNAME)_B_only.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ + mv $(TESTNAME)_A_only.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ + mv $(TESTNAME)_A_and_B.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; + + echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) + rm -rf $(TMPDIR) + +clean-reproducer: + echo NOTHING TO CLEAN FOR $(TESTNAME) \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/MultipleSignaturesPerJarMain.java icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/MultipleSignaturesPerJarMain.java --- icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/MultipleSignaturesPerJarMain.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/MultipleSignaturesPerJarMain.java 2013-05-03 19:08:24.681514704 +0000 @@ -0,0 +1,90 @@ + + +/* MultipleSignaturesPerJarMain.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package somecrazytestpackage; + +import java.applet.Applet; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class MultipleSignaturesPerJarMain extends Applet { + + public static void main(String[] args) { + executeForeignMethodCaught(); + } + + public static void executeForeignMethodCaught() { + try { + executeForeignMethod(); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + public static void executeForeignMethod() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException { + Class clazz = Class.forName("ReadPropertiesSigned"); + Method mainMethod = clazz.getDeclaredMethod("main", String[].class); + mainMethod.invoke(clazz.newInstance(), (Object)new String[] {"user.home"}); + System.out.println("Test has finished."); + } + private class Killer extends Thread { + + public int n = 2000; + + @Override + public void run() { + try { + Thread.sleep(n); + System.exit(0); + } catch (Exception ex) { + } + } + } + private Killer killer; + + @Override + public void init() { + killer = new Killer(); + } + + @Override + public void start() { + main(null); + System.out.println("*** APPLET FINISHED ***"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJarTests.java icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJarTests.java --- icedtea-web-1.3.2/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJarTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJarTests.java 2013-05-03 19:08:24.682514692 +0000 @@ -0,0 +1,129 @@ +/* MultipleSignaturesTestTests.java +Copyright (C) 20121 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertFalse; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; + +import org.junit.Test; + +@Bug(id = { "PR822" }) +public class MultipleSignaturesPerJarTests extends BrowserTest { + private final List TRUST_ALL = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); + + public static final String CORRECT_FINISH = "Test has finished."; + public static final String CNFEXCEPTION = "ClassNotFoundException"; + public static final String DIFF_CERTS_EXCEPTION = "Fatal: Application Error: The JNLP application is not fully signed by a single cert."; + public static final String ACEXCEPTION = "java.security.AccessControlException: access denied"; + + @Test + @NeedsDisplay + public void multipleSignaturesPerJarMatchingJNLP() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(TRUST_ALL, "/MultipleSignaturesPerJarMatching.jnlp"); + // Assert relevant exceptions did not occur + assertFalse("stderr should NOT contain `" + CNFEXCEPTION + "`, but did", + pr.stderr.contains(CNFEXCEPTION)); + assertFalse("stderr should NOT contain `" + ACEXCEPTION + "`, but did", + pr.stderr.contains(ACEXCEPTION)); + assertFalse("stderr should NOT contain `" + DIFF_CERTS_EXCEPTION + "`, but did", + pr.stderr.contains(DIFF_CERTS_EXCEPTION)); + + // Assert that we correctly finish + assertTrue("stdout should contain `" + CORRECT_FINISH + "`, but did not", + pr.stdout.contains(CORRECT_FINISH)); + } + + @Test + @NeedsDisplay + public void multipleSignaturesPerJarMismatchingJNLP() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(TRUST_ALL, "/MultipleSignaturesPerJarMismatching.jnlp"); + // Assert only for the expected exception + assertTrue("stderr should contain `" + DIFF_CERTS_EXCEPTION + "`, but did not", + pr.stderr.contains(DIFF_CERTS_EXCEPTION)); + + // Assert that we did not correctly finish + assertFalse("stdout should NOT contain " + CORRECT_FINISH + " but did", + pr.stdout.contains(CORRECT_FINISH)); + } + + private static void testForCorrectAppletExecution(ProcessResult pr) { + + // Assert relevant exceptions did not occur + assertFalse("stderr should NOT contain `" + CNFEXCEPTION + "`, but did", + pr.stderr.contains(CNFEXCEPTION)); + assertFalse("stderr should NOT contain `" + ACEXCEPTION + "`, but did", + pr.stderr.contains(ACEXCEPTION)); + assertFalse("stderr should NOT contain `" + DIFF_CERTS_EXCEPTION + "`, but did", + pr.stderr.contains(DIFF_CERTS_EXCEPTION)); + + // Assert that we correctly finish + // It is difficult to check for user.home's value here, so we only check for the ending message: + assertTrue("stdout should contain `" + CORRECT_FINISH + "`, but did not", + pr.stdout.contains(CORRECT_FINISH)); + } + + @Test + @NeedsDisplay + @TestInBrowsers(testIn = Browsers.one) + @Bug(id = { "PR822" }) + public void multipleSignaturesPerJarMismatchingApplet() throws Exception { + ProcessResult pr = server.executeBrowser("/MultipleSignaturesPerJarMismatching.html", AutoClose.CLOSE_ON_CORRECT_END); + // NB: Both this and the matching applet should pass + // Unlike JNLPs, applets pass as long as all their parts are signed by *something* + testForCorrectAppletExecution(pr); + } + + @Test + @NeedsDisplay + @TestInBrowsers(testIn = Browsers.one) + public void multipleSignaturesPerJarMatchingApplet() throws Exception { + ProcessResult pr = server.executeBrowser("/MultipleSignaturesPerJarMatching.html", AutoClose.CLOSE_ON_CORRECT_END); + testForCorrectAppletExecution(pr); + } + +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/remote/srcs/Makefile icedtea-web-1.4/tests/reproducers/custom/remote/srcs/Makefile --- icedtea-web-1.3.2/tests/reproducers/custom/remote/srcs/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/remote/srcs/Makefile 2013-05-03 19:08:24.684514668 +0000 @@ -0,0 +1,5 @@ +prepare-reproducer: + echo "Nothing to do to prepare remote reproducers now" + +clean-reproducer: + echo "Nothing to do to clean remote reproducers now" diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java icedtea-web-1.4/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java --- icedtea-web-1.3.2/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java 2013-05-03 19:08:24.685514655 +0000 @@ -0,0 +1,239 @@ +/* RemoteApplicationTests.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ + +import java.net.MalformedURLException; +import java.net.URL; +import net.sourceforge.jnlp.ProcessResult; +import org.junit.Assert; +import org.junit.Test; + +; + +public class RemoteApplicationSettings { + + public static final String mustEmpty = "must be empty, was not"; + public static final String stdout = "Stdout"; + public static final String stderr = "Stderr"; + public static final String stdoutEmpty = stdout + " " + mustEmpty; + public static final String stderrEmpty = stderr + " " + mustEmpty; + + public static URL createCatchedUrl(String r) { + try { + return new URL(r); + } catch (MalformedURLException mex) { + throw new RuntimeException(mex); + } + } + + public interface RemoteApplicationTestcaseSettings { + + public URL getUrl(); + + public void evaluate(ProcessResult pr); + } + + public static abstract class StringBasedURL implements RemoteApplicationTestcaseSettings { + + URL u; + + @Override + public URL getUrl() { + return u; + } + + public StringBasedURL(String r) { + this.u = createCatchedUrl(r); + } + } + + public static class FourierTransform extends StringBasedURL { + + public FourierTransform() { + super("http://www.cs.brown.edu/exploratories/freeSoftware/repository/edu/brown/cs/exploratories/applets/fft1DApp/1d_fast_fourier_transform_java_jnlp.jnlp"); + } + + @Override + public void evaluate(ProcessResult pr) { + Assert.assertTrue(stdoutEmpty, pr.stdout.length() == 0); + Assert.assertTrue(pr.stderr.length() == 0 || pr.stderr.contains(IllegalStateException.class.getName())); + + } + } + + public static class OrawebCernCh extends StringBasedURL { + + public OrawebCernCh() { + super("https://oraweb.cern.ch/pls/atlasintegration/docs/EMDH_atlas.jnlp"); + } + + @Override + public void evaluate(ProcessResult pr) { + Assert.assertTrue(stdoutEmpty, pr.stdout.length() == 0); + Assert.assertTrue(pr.stderr.length() == 0 || pr.stderr.contains("Cannot grant permissions to unsigned jars. Application requested security permissions, but jars are not signed")); + + } + } + + public static class GnattProject extends StringBasedURL { + + public GnattProject() { + super("http://ganttproject.googlecode.com/svn/webstart/ganttproject-2.0.10/ganttproject-2.0.10.jnlp"); + } + + @Override + public void evaluate(ProcessResult pr) { + Assert.assertTrue(stdout, pr.stdout.length() == 0); + Assert.assertTrue(pr.stderr.contains("Splash closed")); + Assert.assertFalse(pr.stderr.contains("Exception")); + + } + } + + public static class GeoGebra extends StringBasedURL { + + public GeoGebra() { + super("http://www.geogebra.org/webstart/geogebra.jnlp"); + } + + @Override + public void evaluate(ProcessResult pr) { + Assert.assertTrue(pr.stdout.length() > 0); + Assert.assertTrue(pr.stderr.length() > 0); + Assert.assertFalse(pr.stderr.contains("Exception")); + Assert.assertFalse(pr.stdout.contains("Exception")); + + } + } + + public abstract static class NoOutputs extends StringBasedURL { + + public NoOutputs(String r) { + super(r); + } + + @Override + public void evaluate(ProcessResult pr) { + Assert.assertTrue(stdoutEmpty, pr.stdout.length() == 0); + Assert.assertTrue(stderrEmpty, pr.stderr.length() == 0); + + } + } + + public static class Arbores extends NoOutputs { + + public Arbores() { + super("http://www.arbores.ca/AnnuityCalc.jnlp"); + } + } + + public static class PhetSims extends NoOutputs { + + public PhetSims() { + super("http://phetsims.colorado.edu/sims/circuit-construction-kit/circuit-construction-kit-dc_en.jnlp"); + } + } + + public static class TopCoder extends NoOutputs { + + public TopCoder() { + super("http://www.topcoder.com/contest/arena/ContestAppletProd.jnlp"); + } + } + + public static class SunSwingDemo extends NoOutputs { + + public SunSwingDemo() throws MalformedURLException { + super("http://java.sun.com/docs/books/tutorialJWS/uiswing/events/ex6/ComponentEventDemo.jnlp"); + } + } + + public static class ArboresDeposit extends NoOutputs { + + public ArboresDeposit() throws MalformedURLException { + super("http://www.arbores.ca/Deposit.jnlp"); + } + } + + public static class AviationWeather extends StringBasedURL { + + @Override + public void evaluate(ProcessResult pr) { + Assert.assertTrue(stdoutEmpty, pr.stdout.length() == 0); + Assert.assertTrue(pr.stderr.length() == 0 || (pr.stderr.contains("Cannot read File Manager history data file,") + && pr.stderr.contains("FileMgr will be initialized with default options"))); + + } + + public AviationWeather() { + super("http://aviationweather.gov/static/adds/java/fpt/fpt.jnlp"); + } + } + + public static class FuseSwing extends NoOutputs { + + public FuseSwing() { + super("http://www.progx.org/users/Gfx/apps/fuse-swing-demo.jnlp"); + } + } + + @Test + public void remoteApplicationSettingsAreWorking() throws Exception { + RemoteApplicationTestcaseSettings s5 = new FourierTransform(); + Assert.assertNotNull(s5.getUrl()); + RemoteApplicationTestcaseSettings s4 = new Arbores(); + Assert.assertNotNull(s4.getUrl()); + RemoteApplicationTestcaseSettings s3 = new PhetSims(); + Assert.assertNotNull(s3.getUrl()); + RemoteApplicationTestcaseSettings s2 = new TopCoder(); + Assert.assertNotNull(s2.getUrl()); + RemoteApplicationTestcaseSettings s1 = new SunSwingDemo(); + Assert.assertNotNull(s1.getUrl()); + RemoteApplicationTestcaseSettings s6 = new ArboresDeposit(); + Assert.assertNotNull(s6.getUrl()); + RemoteApplicationTestcaseSettings s7 = new OrawebCernCh(); + Assert.assertNotNull(s7.getUrl()); + RemoteApplicationTestcaseSettings s8 = new AviationWeather(); + Assert.assertNotNull(s8.getUrl()); + RemoteApplicationTestcaseSettings s9 = new FuseSwing(); + Assert.assertNotNull(s9.getUrl()); + RemoteApplicationTestcaseSettings s10 = new GnattProject(); + Assert.assertNotNull(s10.getUrl()); + RemoteApplicationTestcaseSettings s11 = new GeoGebra(); + Assert.assertNotNull(s11.getUrl()); + + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java icedtea-web-1.4/tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java --- icedtea-web-1.3.2/tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java 2013-05-03 19:08:24.685514655 +0000 @@ -0,0 +1,144 @@ +/* RemoteApplicationTests.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.KnownToFail; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.Remote; +import org.junit.Test; + +@Remote +public class RemoteApplicationTests { + + private static ServerAccess server = new ServerAccess(); + private final List l = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); + private final List ll = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall", "-Xnofork"})); + + @Test + @NeedsDisplay + public void topCoderRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.TopCoder(); + ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); + settings.evaluate(pr); + } + + @Test + @NeedsDisplay + public void sunSwingRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.SunSwingDemo(); + ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); + settings.evaluate(pr); + } + + @Test + @NeedsDisplay + public void fourierTransformRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.FourierTransform(); + ProcessResult pr = server.executeJavawsUponUrl(null, settings.getUrl()); + settings.evaluate(pr); + } + + @Test + @NeedsDisplay + public void arboresRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.Arbores(); + ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); + settings.evaluate(pr); + } + + @Test + @NeedsDisplay + public void phetsimsRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.PhetSims(); + ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); + settings.evaluate(pr); + } + + @Test + @NeedsDisplay + public void arboresDepositRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.ArboresDeposit(); + ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); + settings.evaluate(pr); + } + + /* This application need all permissions, but contains unsigned jar. Have exception but works at least somehow + */ + @Test + @NeedsDisplay + public void orawebCernChRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.OrawebCernCh(); + ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); + settings.evaluate(pr); + } + + @Test + @NeedsDisplay + public void AviationWeatherRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.AviationWeather(); + ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); + settings.evaluate(pr); + } + + @Test + @NeedsDisplay + public void fuseSysRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.FuseSwing(); + ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); + settings.evaluate(pr); + } + + @Test + @NeedsDisplay + public void gantProjectRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.GnattProject(); + ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); + settings.evaluate(pr); + } + + @Test + @NeedsDisplay + public void geogebraRemoteTest() throws Exception { + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.GeoGebra(); + ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); + settings.evaluate(pr); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp 2013-05-03 19:08:24.689514603 +0000 @@ -0,0 +1,61 @@ + + + + + Test AppContext Classloader + IcedTea + + Test that AppContext's context classloader is a JNLPClassLoader + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.html icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.html --- icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.html 2013-05-03 19:08:24.688514616 +0000 @@ -0,0 +1,44 @@ + + +

    + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.jnlp icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.jnlp 2013-05-03 19:08:24.688514616 +0000 @@ -0,0 +1,57 @@ + + + + + Test AppContext Classloader + IcedTea + + Test that AppContext's context classloader is a JNLPClassLoader + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassLoader.java icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassLoader.java --- icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassLoader.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassLoader.java 2013-05-03 19:08:24.689514603 +0000 @@ -0,0 +1,88 @@ +/* + Copyright (C) 2013 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ + +import java.applet.Applet; + +import sun.awt.AppContext; + +import java.awt.EventQueue; + +/* Hybrid applet/application */ +public class AppContextHasJNLPClassLoader extends Applet { + + /* + * Output the current context classloader, and the current AppContext's + * stored context classloader. + * + * The context classloader should never be the system classloader for a + * webstart application or applet in any thread. + */ + static void printClassloaders(String location) { + ClassLoader appContextClassLoader = AppContext.getAppContext().getContextClassLoader(); + ClassLoader threadContextClassLoader = Thread.currentThread().getContextClassLoader(); + + System.out.println(location + ": app context classloader == " + + appContextClassLoader.getClass().getSimpleName()); + System.out.println(location + ": thread context classloader == " + + threadContextClassLoader.getClass().getSimpleName()); + } + + /* Applet start point */ + @Override + public void start() { + try { + main(null); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /* Application start point */ + public static void main(String[] args) throws Exception { + printClassloaders("main-thread"); + + EventQueue.invokeAndWait(new Runnable() { + public void run() { + printClassloaders("swing-thread"); + } + }); + + // NB: The following is for JNLP applets only + try { System.exit(0); } catch (Exception e) {e.printStackTrace(); } + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPClassLoaderTest.java icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPClassLoaderTest.java --- icedtea-web-1.3.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPClassLoaderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPClassLoaderTest.java 2013-05-03 19:08:24.689514603 +0000 @@ -0,0 +1,95 @@ +/* +Copyright (C) 2013 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.annotations.KnownToFail; +import net.sourceforge.jnlp.annotations.TestInBrowsers; + +import net.sourceforge.jnlp.annotations.Bug; + +import org.junit.Assert; + +import net.sourceforge.jnlp.ServerAccess.AutoClose; + +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; + +import net.sourceforge.jnlp.ProcessResult; + +import org.junit.Test; + +public class AppContextHasJNLPClassLoaderTest extends BrowserTest { + + private static final String MAIN_APP_CONTEXT_CLASSLOADER = "main-thread: app context classloader == JNLPClassLoader"; + private static final String MAIN_THREAD_CONTEXT_CLASSLOADER = "main-thread: thread context classloader == JNLPClassLoader"; + + private static final String SWING_APP_CONTEXT_CLASSLOADER = "swing-thread: app context classloader == JNLPClassLoader"; + private static final String SWING_THREAD_CONTEXT_CLASSLOADER = "swing-thread: thread context classloader == JNLPClassLoader"; + + private void assertHasJNLPClassLoaderAsContextClassloader(ProcessResult pr) { + // This shouldn't fail even with PR1251 + // If the main thread does not have the right context classloader, something is quite wrong + Assert.assertTrue("stdout should contains '" + MAIN_THREAD_CONTEXT_CLASSLOADER + "', but did not", pr.stdout.contains(MAIN_THREAD_CONTEXT_CLASSLOADER)); + + // PR1251 + Assert.assertTrue("stdout should contains '" + MAIN_APP_CONTEXT_CLASSLOADER + "', but did not", pr.stdout.contains(MAIN_APP_CONTEXT_CLASSLOADER)); + Assert.assertTrue("stdout should contains '" + SWING_APP_CONTEXT_CLASSLOADER + "', but did not", pr.stdout.contains(SWING_APP_CONTEXT_CLASSLOADER)); + Assert.assertTrue("stdout should contains '" + SWING_THREAD_CONTEXT_CLASSLOADER + "', but did not", pr.stdout.contains(SWING_THREAD_CONTEXT_CLASSLOADER)); + } + + @Test + @Bug(id="PR1251") + public void testJNLPApplicationAppContext() throws Exception { + ProcessResult pr = server.executeJavawsHeadless("/AppContextHasJNLPClassLoader.jnlp"); + assertHasJNLPClassLoaderAsContextClassloader(pr); + } + + @Test + @KnownToFail // EventQueue.invokeAndWait is broken in JNLP applets, see PR1253 + @Bug(id={"PR1251","PR1253"}) + public void testJNLPAppletAppContext() throws Exception { + ProcessResult pr = server.executeJavaws("/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp"); + assertHasJNLPClassLoaderAsContextClassloader(pr); + } + + @Test + @TestInBrowsers(testIn={Browsers.one}) + @Bug(id="PR1251") + public void testAppletAppContext() throws Exception { + ProcessResult pr = server.executeBrowser("/AppContextHasJNLPClassLoader.html", AutoClose.CLOSE_ON_CORRECT_END); + assertHasJNLPClassLoaderAsContextClassloader(pr); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html icedtea-web-1.4/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html --- icedtea-web-1.3.2/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html 2013-05-03 19:08:24.691514577 +0000 @@ -0,0 +1,46 @@ + + +

    + + + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html icedtea-web-1.4/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html --- icedtea-web-1.3.2/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html 2013-04-10 11:40:23.964668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html 2013-05-03 19:08:24.690514590 +0000 @@ -37,7 +37,7 @@ -->

    - + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java icedtea-web-1.4/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java --- icedtea-web-1.3.2/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java 2013-04-10 11:40:23.964668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java 2013-05-03 19:08:24.691514577 +0000 @@ -48,6 +48,7 @@ try { Thread.sleep(n); System.out.println("AppletTestSigned killing himself after " + n + " ms of life"); + System.out.println("*** APPLET FINISHED ***"); System.exit(0); } catch (Exception ex) { } diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java icedtea-web-1.4/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java --- icedtea-web-1.3.2/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java 2013-04-10 11:40:23.964668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java 2013-05-03 19:08:24.692514564 +0000 @@ -43,6 +43,9 @@ import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.closinglisteners.Rule; +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; +import static net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener.*; import org.junit.Assert; import org.junit.Test; @@ -50,8 +53,22 @@ public class AppletTestSignedTests extends BrowserTest { private final List l = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); + private static final String ss = "xception"; + private static final String s0 = "AppletTestSigned was started"; + private static final String s1 = "value1"; + private static final String s2 = "value2"; + private static final String s3 = "AppletTestSigned was initialised"; + private static final String s7 = "AppletTestSigned killing himself after 2000 ms of life"; + private static final ContainsRule exceptionRule = new ContainsRule(ss); + private static final ContainsRule startedRule = new ContainsRule(s0); + private static final ContainsRule variable1Rule = new ContainsRule(s1); + private static final ContainsRule variable2Rule = new ContainsRule(s2); + private static final ContainsRule initialisedRule = new ContainsRule(s3); + private static final ContainsRule killedRule = new ContainsRule(s7); + private static final RulesFolowingClosingListener okListener=new RulesFolowingClosingListener(startedRule, variable1Rule, variable2Rule, initialisedRule, killedRule); + private static final RulesFolowingClosingListener errorListener=new RulesFolowingClosingListener(exceptionRule); - @Test + // @Test public void AppletTestSignedTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/AppletTestSigned.jnlp"); evaluateSignedApplet(pr, true); @@ -60,18 +77,12 @@ } private void evaluateSignedApplet(ProcessResult pr, boolean javawsApplet) { - String s3 = "AppletTestSigned was initialised"; - Assert.assertTrue("AppletTestSigned stdout should contain " + s3 + " but didn't", pr.stdout.contains(s3)); - String s0 = "AppletTestSigned was started"; - Assert.assertTrue("AppletTestSigned stdout should contain " + s0 + " but didn't", pr.stdout.contains(s0)); - String s1 = "value1"; - Assert.assertTrue("AppletTestSigned stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); - String s2 = "value2"; - Assert.assertTrue("AppletTestSigned stdout should contain " + s2 + " but didn't", pr.stdout.contains(s2)); - String ss = "xception"; - Assert.assertFalse("AppletTestSigned stderr should not contain " + ss + " but did", pr.stderr.contains(ss)); - String s7 = "AppletTestSigned killing himself after 2000 ms of life"; - Assert.assertTrue("AppletTestSigned stdout should contain " + s7 + " but didn't", pr.stdout.contains(s7)); + Assert.assertTrue("AppletTestSigned stdout " + initialisedRule.toPassingString() + " but didn't", initialisedRule.evaluate(pr.stdout)); + Assert.assertTrue("AppletTestSigned stdout " + startedRule.toPassingString() + " but didn't", startedRule.evaluate(pr.stdout)); + Assert.assertTrue("AppletTestSigned stdout " + variable1Rule.toPassingString() + " but didn't", variable1Rule.evaluate(pr.stdout)); + Assert.assertTrue("AppletTestSigned stdout " + variable2Rule.toPassingString() + " but didn't", variable2Rule.evaluate(pr.stdout)); + Assert.assertFalse("AppletTestSigned stderr " + exceptionRule.toFailingString() + " but did", exceptionRule.evaluate(pr.stderr)); + Assert.assertTrue("AppletTestSigned stdout " + killedRule.toPassingString() + " but didn't", killedRule.evaluate(pr.stdout)); if (!javawsApplet) { /*this is working correctly in most browser, but not in all. temporarily disabling String s4 = "AppletTestSigned was stopped"; @@ -84,15 +95,24 @@ @Test @TestInBrowsers(testIn = {Browsers.all}) - public void AppletTestSignedFirefoxTest() throws Exception { + public void AppletTestSignedFirefoxTestXslowX() throws Exception { ServerAccess.PROCESS_TIMEOUT = 30 * 1000; try { - ProcessResult pr = server.executeBrowser("/AppletTestSigned.html"); + ProcessResult pr = server.executeBrowser("/AppletTestSigned2.html", okListener, errorListener); evaluateSignedApplet(pr, false); - Assert.assertTrue(pr.wasTerminated); + //Assert.assertTrue(pr.wasTerminated); //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null } finally { ServerAccess.PROCESS_TIMEOUT = 20 * 1000; //back to normal } } + + @Test + @TestInBrowsers(testIn = {Browsers.all}) + public void AppletTestSignedFirefoxTest() throws Exception { + ProcessResult pr = server.executeBrowser("/AppletTestSigned.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); + evaluateSignedApplet(pr, false); + //Assert.assertTrue(pr.wasTerminated); + //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null + } } diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java icedtea-web-1.4/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java --- icedtea-web-1.3.2/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java 2013-04-10 11:40:23.968668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java 2013-05-03 19:08:24.715514275 +0000 @@ -40,7 +40,6 @@ import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerAccess.ProcessResult; -import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -50,7 +49,6 @@ import org.junit.Assert; import org.junit.Test; -@Bug(id = "PR975") public class ClasspathManifestTest extends BrowserTest { private static String s1 = "Searching for CheckForClasspath."; diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy1.jnlp icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy1.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy1.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy1.jnlp 2013-05-03 19:08:24.716514263 +0000 @@ -0,0 +1,58 @@ + + + + + ClipboardContentSignedCopy1 + IcedTea + + ClipboardContentSignedCopy1 + + + + + + + + copy1 + 10 + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy2.jnlp icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy2.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy2.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy2.jnlp 2013-05-03 19:08:24.726514136 +0000 @@ -0,0 +1,58 @@ + + + + + ClipboardContentSignedCopy2 + IcedTea + + ClipboardContentSignedCopy2 + + + + + + + + copy2 + 10 + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste1.jnlp icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste1.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste1.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste1.jnlp 2013-05-03 19:08:24.727514124 +0000 @@ -0,0 +1,57 @@ + + + + + ClipboardContentSignedPaste1 + IcedTea + + ClipboardContentSignedPaste1 + + + + + + + + paste1 + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste2.jnlp icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste2.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste2.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste2.jnlp 2013-05-03 19:08:24.727514124 +0000 @@ -0,0 +1,57 @@ + + + + + ClipboardContentSignedPaste2 + IcedTea + + ClipboardContentSignedPaste2 + + + + + + + + paste2 + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/srcs/ClipboardContentSigned.java icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/srcs/ClipboardContentSigned.java --- icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/srcs/ClipboardContentSigned.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/srcs/ClipboardContentSigned.java 2013-05-03 19:08:24.727514124 +0000 @@ -0,0 +1,183 @@ +/* ClipboardContentSigned.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.concurrent.TimeUnit; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.text.JTextComponent; + +public class ClipboardContentSigned extends JPanel { + + private static final String contentC = "COPY#$REPRODUCER"; + private static final String contentP = "PASTE#$REPRODUCER"; + + private static class LocalFrame extends JFrame { + + JTextField t; + + public LocalFrame(String str) { + super(); + t = new JTextField(str); + this.add(t); + this.setSize(100, 100); + this.pack(); + t.selectAll(); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + } + + public void run() throws InterruptedException { + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + setVisible(true); + + } + }); + while (!this.isVisible()) { + Thread.sleep(100); + } + } + + public JTextField getT() { + return t; + } + } + + public void putToClipboard1(String str) { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Clipboard clipboard = toolkit.getSystemClipboard(); + StringSelection strSel = new StringSelection(str); + clipboard.setContents(strSel, null); + printFlavors(); + } + + public void putToClipboard2(final String str) throws InterruptedException, NoSuchMethodException, IllegalAccessException, UnsupportedFlavorException, IllegalArgumentException, InvocationTargetException, IOException { + final LocalFrame lf = new LocalFrame(str); + lf.run(); + ((JTextComponent) (lf.getT())).copy(); + printFlavors(); + lf.dispose(); + } + + public String pasteFromClipboard2() throws InterruptedException, NoSuchMethodException, IllegalAccessException, UnsupportedFlavorException, IllegalArgumentException, InvocationTargetException, IOException { + final LocalFrame lf = new LocalFrame("xxx"); + lf.run(); + ((JTextComponent) (lf.getT())).paste(); + printFlavors(); + String s = lf.getT().getText(); + lf.dispose(); + return s; + } + + private void printFlavors() { +//just for debugging +// Toolkit toolkit = Toolkit.getDefaultToolkit(); +// Clipboard clipboard = toolkit.getSystemClipboard(); +// Transferable clipData = clipboard.getContents(clipboard); +// DataFlavor[] cd = clipData.getTransferDataFlavors(); +// for (DataFlavor dataFlavor : cd) { +// System.out.println(dataFlavor.getMimeType()); +// } + } + + public String pasteFromClipboard1() throws UnsupportedFlavorException, IOException { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Clipboard clipboard = toolkit.getSystemClipboard(); + Transferable clipData = clipboard.getContents(clipboard); + printFlavors(); + String s = (String) (clipData.getTransferData( + DataFlavor.stringFlavor)); + return s; + } + + public static void main(String[] args) throws Exception { + ClipboardContentSigned cl = new ClipboardContentSigned(); + if (args.length == 0) { + throw new IllegalArgumentException("at least copy1|2 or paste1|2 must be as argument (+mandatory number giving use timeout in seconds before termination)"); + } else if (args.length == 1) { + cl.proceed(args[0]); + } else { + cl.proceed(args[0], args[1]); + } + + } + + public void proceed(String arg) throws Exception { + proceed(arg, 0); + } + + public void proceed(String arg, String keepAliveFor) throws Exception { + proceed(arg, Long.valueOf(keepAliveFor)); + } + + public void proceed(String arg, long timeOut) throws Exception { + if (arg.equals("copy1")) { + System.out.println(this.getClass().getName() + " copying1 to clipboard " + contentC); + putToClipboard1(contentC); + System.out.println(this.getClass().getName() + " copied1 to clipboard " + pasteFromClipboard1()); + } else if (arg.equals("paste1")) { + System.out.println(this.getClass().getName() + " pasting1 from clipboard "); + String nwContent = pasteFromClipboard1(); + System.out.println(this.getClass().getName() + " pasted1 from clipboard " + nwContent); + } else if (arg.equals("copy2")) { + System.out.println(this.getClass().getName() + " copying2 to clipboard " + contentC); + putToClipboard2(contentC); + System.out.println(this.getClass().getName() + " copied2 to clipboard " + pasteFromClipboard2()); + } else if (arg.equals("paste2")) { + System.out.println(this.getClass().getName() + " pasting2 from clipboard "); + String nwContent = pasteFromClipboard2(); + System.out.println(this.getClass().getName() + " pasted2 from clipboard " + nwContent); + } else { + throw new IllegalArgumentException("supported copy1|2 paste1|2"); + } + long start = System.nanoTime(); + while (TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start) < timeOut) { + Thread.sleep(500); + } + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTests.java icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTests.java --- icedtea-web-1.3.2/tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTests.java 2013-05-03 19:08:24.728514112 +0000 @@ -0,0 +1,126 @@ +/* ClipboardContentSignedTests.java + Copyright (C) 2012 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import net.sourceforge.jnlp.ContentReaderListener; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.tools.AsyncJavaws; +import static net.sourceforge.jnlp.tools.ClipboardHelpers.pasteFromClipboard; +import static net.sourceforge.jnlp.tools.ClipboardHelpers.putToClipboard; +import net.sourceforge.jnlp.tools.WaitingForStringProcess; +import org.junit.Assert; +import org.junit.Test; + +@Bug(id = "PR708") +public class ClipboardContentSignedTests { + + private static final String XCEPTION = "xception"; + private static final String contentC = "COPY#$REPRODUCER"; + private static final String contentP = "PASTE#$REPRODUCER"; + private static final String emptyContent = "empty content"; + private static ServerAccess server = new ServerAccess(); + private static final List javawsTrustArg = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); + + @Test + public void assertClipboardIsWorking() throws Exception { + putToClipboard(emptyContent); + Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); + putToClipboard(contentC); + Assert.assertEquals("Clipboard must contain new value, did not", contentC, pasteFromClipboard()); + } + + @Test + @Bug(id = "PR708") + public void ClipboardContentSignedTestCopy1() throws Exception { + putToClipboard(emptyContent); + Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); + WaitingForStringProcess wfsp = new WaitingForStringProcess(server, "/ClipboardContentSignedCopy1.jnlp", javawsTrustArg, true, "copied"); + wfsp.run(); + String ss = pasteFromClipboard(); + Assert.assertEquals("Clipboard must contain new value, did not", contentC, ss); + //Assert.assertFalse("ClipboardContentSignedCopy stderr should not contain " + XCEPTION + " but did ", wfsp.getErr().contains(XCEPTION)); + } + + @Test + @Bug(id = "PR708") + @NeedsDisplay + public void ClipboardContentSignedTestCopy2() throws Exception { + putToClipboard(emptyContent); + Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); + WaitingForStringProcess wfsp = new WaitingForStringProcess(server, "/ClipboardContentSignedCopy2.jnlp", javawsTrustArg, false, "copied"); + wfsp.run(); + String ss = pasteFromClipboard(); + Assert.assertEquals("Clipboard must contain new value, did not", contentC, ss); + //Assert.assertFalse("ClipboardContentSignedCopy stderr should not contain " + XCEPTION + " but did ", wfsp.getErr().contains(XCEPTION)); + + } + + @Test + @Bug(id = "PR708") + public void ClipboardContentSignedTestPaste1() throws Exception { + //necessery errasing + putToClipboard(emptyContent); + Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); + //now put the tested data + putToClipboard(contentP); + Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); + ProcessResult pr = server.executeJavawsHeadless(javawsTrustArg, "/ClipboardContentSignedPaste1.jnlp"); + Assert.assertTrue("ClipboardContentSignedTestPaste stdout should contain " + contentP + " but didn't", pr.stdout.contains(contentP)); + //Assert.assertFalse("ClipboardContentSignedTestPaste stderr should not contain " + XCEPTION + " but did ", pr.stderr.contains(XCEPTION)); + } + + @Test + @Bug(id = "PR708") + @NeedsDisplay + public void ClipboardContentSignedTestPaste2() throws Exception { + //necessery errasing + putToClipboard(emptyContent); + Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); + //now put the tested data + putToClipboard(contentP); + Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); + Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); + ProcessResult pr = server.executeJavaws(javawsTrustArg, "/ClipboardContentSignedPaste2.jnlp"); + Assert.assertTrue("ClipboardContentSignedTestPaste stdout should contain " + contentP + " but didn't", pr.stdout.contains(contentP)); + //Assert.assertFalse("ClipboardContentSignedTestPaste stderr should not contain " + XCEPTION + " but did ", pr.stderr.contains(XCEPTION)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/CountingAppletSigned/srcs/CountingAppletSigned.java icedtea-web-1.4/tests/reproducers/signed/CountingAppletSigned/srcs/CountingAppletSigned.java --- icedtea-web-1.3.2/tests/reproducers/signed/CountingAppletSigned/srcs/CountingAppletSigned.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/CountingAppletSigned/srcs/CountingAppletSigned.java 2013-05-03 19:08:24.728514112 +0000 @@ -0,0 +1,110 @@ + +import java.applet.Applet; +import java.awt.BorderLayout; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; + +/* CountingAppletSigned.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +public class CountingAppletSigned extends Applet { + + public static void main(String[] args) throws InterruptedException { + Integer counter = null; + if (args.length > 0) { + counter = new Integer(args[0]); + ; + } + int i = 0; + while (true) { + System.out.println("counting... " + i); + if (counter != null && i == counter.intValue()) { + System.exit(-i); + } + i++; + Thread.sleep(1000); + } + } + + @Override + public void init() { + System.out.println("applet was initialised"); + final CountingAppletSigned self = this; + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + self.setLayout(new BorderLayout()); + self.add(new JLabel("S")); + self.validateTree(); + self.repaint(); + } + }); + } + + @Override + public void start() { + System.out.println("applet was started"); + String s = getParameter("kill"); + final String[] params; + if (s != null) { + params = new String[]{s}; + } else { + params = new String[0]; + } + new Thread(new Runnable() { + + @Override + public void run() { + try { + main(params); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }).start(); + } + + @Override + public void stop() { + System.out.println("applet was stopped"); + } + + @Override + public void destroy() { + System.out.println("applet will be destroyed"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/CustomPolicy/resources/CustomPolicy.jnlp icedtea-web-1.4/tests/reproducers/signed/CustomPolicy/resources/CustomPolicy.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/CustomPolicy/resources/CustomPolicy.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/CustomPolicy/resources/CustomPolicy.jnlp 2013-05-03 19:08:24.729514100 +0000 @@ -0,0 +1,55 @@ + + + + + + CustomPolicy + IcedTea + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/CustomPolicy/srcs/CustomPolicy.java icedtea-web-1.4/tests/reproducers/signed/CustomPolicy/srcs/CustomPolicy.java --- icedtea-web-1.3.2/tests/reproducers/signed/CustomPolicy/srcs/CustomPolicy.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/CustomPolicy/srcs/CustomPolicy.java 2013-05-03 19:08:24.729514100 +0000 @@ -0,0 +1,85 @@ +/* CustomPolicy.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.net.MalformedURLException; +import java.net.URL; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.cert.Certificate; +import java.security.AccessControlException; +import java.security.CodeSource; +import java.security.PermissionCollection; +import java.security.Permissions; +import java.security.Policy; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.security.ProtectionDomain; + +public class CustomPolicy { + public static AccessControlContext strictAccessControlContext() throws MalformedURLException { + CodeSource code = new CodeSource(new URL("http://localhost"), (Certificate[]) null); + ProtectionDomain pd = new ProtectionDomain(code, new Permissions(), + null, null); + return new AccessControlContext(new ProtectionDomain[] { pd }); + } + + public static void main(String[] args) throws PrivilegedActionException, MalformedURLException { + final Policy defaultPolicy = Policy.getPolicy(); + Policy.setPolicy(new Policy() { + public PermissionCollection getPermissions(CodeSource codesource) { + System.out.println("Loading System here may cause problems."); + return defaultPolicy.getPermissions(codesource); + } + + public void refresh() { + defaultPolicy.refresh(); + } + }); + + try { + AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Void run() { + Thread.currentThread().setContextClassLoader(null); + return null; + } + }, strictAccessControlContext()); + } catch (AccessControlException ace) { + System.out.println("AccessControlException: Cannot set context class loader"); + } + System.out.println("Program Executed Correctly"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/CustomPolicy/testcases/CustomPolicyTests.java icedtea-web-1.4/tests/reproducers/signed/CustomPolicy/testcases/CustomPolicyTests.java --- icedtea-web-1.3.2/tests/reproducers/signed/CustomPolicy/testcases/CustomPolicyTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/CustomPolicy/testcases/CustomPolicyTests.java 2013-05-03 19:08:24.730514088 +0000 @@ -0,0 +1,65 @@ +/* CustomPolicyTests.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.Bug; + +import org.junit.Assert; + +import org.junit.Test; + +public class CustomPolicyTests { + private ServerAccess server = new ServerAccess(); + + private static final List TRUSTALL = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); + + @Bug(id="1145") + @Test + public void customPolicyTest() throws Exception { + final String expectedACE = "AccessControlException: Cannot set context class loader"; + final String expectedOutput = "Program Executed Correctly"; + + ProcessResult pr = server.executeJavawsHeadless(TRUSTALL, "/CustomPolicy.jnlp"); + Assert.assertTrue("Stdout should contain " + expectedACE + " but did not", pr.stdout.contains(expectedACE)); + Assert.assertTrue("Stdout should contain " + expectedOutput + " but did not", pr.stdout.contains(expectedOutput)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp icedtea-web-1.4/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp 2013-05-03 19:08:24.730514088 +0000 @@ -0,0 +1,52 @@ + + + + + + Verify that deployment configuration properties are exposed + IcedTea + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/Test.java icedtea-web-1.4/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/Test.java --- icedtea-web-1.3.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/Test.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/Test.java 2013-05-03 19:08:24.731514076 +0000 @@ -0,0 +1,42 @@ +/* Test.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +public class Test { + public static void main(String[] args) { + System.out.println(System.getProperty("deployment.user.logdir")); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentPropertiesAreExposedTest.java icedtea-web-1.4/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentPropertiesAreExposedTest.java --- icedtea-web-1.3.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentPropertiesAreExposedTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentPropertiesAreExposedTest.java 2013-05-03 19:08:24.731514076 +0000 @@ -0,0 +1,66 @@ +/* DeploymentPropertiesAreExposedTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import static org.junit.Assert.*; + +import java.io.File; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import net.sourceforge.jnlp.ServerAccess; +import org.junit.Test; + +public class DeploymentPropertiesAreExposedTest { + + + @Test + public void verifyDeploymentConfigrationIsExposedAsSystemProperties() throws Exception { + ServerAccess server = new ServerAccess(); + List trustCertificates = Arrays.asList(new String[] {"-Xtrustall"}); + + ServerAccess.ProcessResult result = server.executeJavawsHeadless( + trustCertificates, "/DeploymentPropertiesAreExposed.jnlp"); + + String expectedRegex = ".*" + File.separator + ".icedtea" + File.separator + "log" + ".*"; + String actual = result.stdout.trim(); + + boolean stdOutMatches = actual.matches(expectedRegex); + + assertTrue("'" + actual + "' should match '" + expectedRegex + "' but did not", stdOutMatches); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/DownloadService/resources/DownloadServiceExtension.jnlp icedtea-web-1.4/tests/reproducers/signed/DownloadService/resources/DownloadServiceExtension.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/DownloadService/resources/DownloadServiceExtension.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/DownloadService/resources/DownloadServiceExtension.jnlp 2013-05-03 19:08:24.732514064 +0000 @@ -0,0 +1,58 @@ + + + + + DownloadServiceExtension + IcedTea + + DownloadServiceExtension + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/DownloadService/resources/DownloadService.jnlp icedtea-web-1.4/tests/reproducers/signed/DownloadService/resources/DownloadService.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/DownloadService/resources/DownloadService.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/DownloadService/resources/DownloadService.jnlp 2013-05-03 19:08:24.732514064 +0000 @@ -0,0 +1,64 @@ + + + + + DownloadService + IcedTea + + DownloadService + + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/DownloadService/srcs/DownloadServiceRunner.java icedtea-web-1.4/tests/reproducers/signed/DownloadService/srcs/DownloadServiceRunner.java --- icedtea-web-1.3.2/tests/reproducers/signed/DownloadService/srcs/DownloadServiceRunner.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/DownloadService/srcs/DownloadServiceRunner.java 2013-05-03 19:08:24.733514051 +0000 @@ -0,0 +1,351 @@ +/* DownloadService.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import javax.jnlp.DownloadService; +import javax.jnlp.ServiceManager; +import javax.jnlp.UnavailableServiceException; + +public class DownloadServiceRunner { + + URL serverUrl = null; + URL extensionUrl = null; + URL NonExistingUrl = null; + + URL urlToExternalResource = null; + + /** + * Launching jnlp and extension jnlp PARTS + */ + final String launchPartOne = "one"; + final String launchPartTwo = "two"; + final String extensionPartOne = "extOne"; + final String nonExistingPart = "random"; + + /** + * Parts in Array + */ + final String[] validLaunchParts = { launchPartOne, launchPartTwo }; + final String[] halfValidLaunchParts = { launchPartOne, nonExistingPart }; + final String[] validExtensionParts = { extensionPartOne }; + final String[] halfValidExtensionParts = { extensionPartOne, nonExistingPart }; + final String[] invalidParts = { nonExistingPart, "random2" }; + + private static DownloadService downloadService; + static { + try { + downloadService = (DownloadService) ServiceManager.lookup("javax.jnlp.DownloadService"); + } catch (UnavailableServiceException ex) { + System.err.println("DownloadService is not available."); + } + } + + public DownloadServiceRunner(String urlToServer) throws MalformedURLException, InterruptedException { + serverUrl = new URL(urlToServer); + extensionUrl = new URL(urlToServer + "DownloadServiceExtension.jnlp"); + NonExistingUrl = new URL(urlToServer + "NONEXISTINGFILE.JNLP"); + + urlToExternalResource = new URL(urlToServer + "EmptySignedJar.jar"); + + System.out.println(urlToExternalResource.toString()); + + } + + /** + * Checks the cache status of resources using isPartCached() + */ + private void checkCache() throws MalformedURLException { + System.out.println("CHECKCACHE-isPartCached: LaunchPartOne: " + downloadService.isPartCached(launchPartOne)); + System.out.println("CHECKCACHE-isPartCached: LaunchPartTwo: " + downloadService.isPartCached(launchPartTwo)); + System.out.println("CHECKCACHE-isPartCached: NonExistingPart: " + downloadService.isPartCached(nonExistingPart)); + } + + /** + * Checks the cache status of resources using isPartCached([]) - an array with part names + */ + private void checkCacheUsingMultipleParts() throws MalformedURLException { + System.out.println("CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): ValidLaunchParts: " + downloadService.isPartCached(validLaunchParts)); + System.out.println("CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): HalfValidLaunchParts: " + downloadService.isPartCached(halfValidLaunchParts)); + System.out.println("CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): InvalidParts: " + downloadService.isPartCached(invalidParts)); + } + + /** + * Checks the cache status of extension resources using isExtensionPartCached() + */ + private void checkExtensionCache() throws MalformedURLException { + System.out.println("CHECKEXTENSIONCACHE-isExtensionPartCached: ExtensionPartOne: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + System.out.println("CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingPart: " + + downloadService.isExtensionPartCached(extensionUrl, null, nonExistingPart)); + System.out.println("CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingUrl: " + + downloadService.isExtensionPartCached(NonExistingUrl, null, extensionPartOne)); + } + + /** + * Checks the cache status of extension resources using isExtensionPartCached([]) - an array with part names + */ + private void checkExtensionCacheUsingMultipleParts() throws MalformedURLException { + System.out.println("CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): ValidExtensionParts: " + + downloadService.isExtensionPartCached(extensionUrl, null, validExtensionParts)); + System.out.println("CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): HalfValidExtensionParts: " + + downloadService.isExtensionPartCached(extensionUrl, null, halfValidExtensionParts)); + System.out.println("CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): InvalidParts: " + + downloadService.isExtensionPartCached(NonExistingUrl, null, invalidParts)); + } + + /** + * Checks the cache status of external (not mentioned in jnlps) resources using isResourceCached() + */ + private void checkExternalCache() { + System.out.println("CHECKEXTERNALCACHE-isResourceCached: UrlToExternalResource: " + downloadService.isResourceCached(urlToExternalResource, null)); + System.out.println("CHECKEXTERNALCACHE-isResourceCached: NonExistingUrl: " + downloadService.isResourceCached(NonExistingUrl, null)); + } + + /** + * Removes resources from cache using removePart() + */ + private void removePart() throws IOException { + System.out.println("REMOVEPART-removePart: LaunchPartOne-BEFORE: " + downloadService.isPartCached(launchPartOne)); + downloadService.removePart(launchPartOne); + System.out.println("REMOVEPART-removePart: LaunchPartOne-AFTER: " + downloadService.isPartCached(launchPartOne)); + + System.out.println("REMOVEPART-removePart: LaunchPartTwo-BEFORE: " + downloadService.isPartCached(launchPartTwo)); + downloadService.removePart(launchPartTwo); + System.out.println("REMOVEPART-removePart: LaunchPartTwo-AFTER: " + downloadService.isPartCached(launchPartTwo)); + } + + /** + * Removes extension resources from cache using isExtensionPartCached() + */ + private void removeExtensionPart() throws IOException { + System.out.println("REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-BEFORE: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + downloadService.removeExtensionPart(extensionUrl, null, extensionPartOne); + System.out.println("REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-AFTER: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + } + + /** + * Removes extension resources using part array (all parts exist) from cache using isExtensionPartCached() + */ + private void removeExtensionUsingValidPartInArray() throws IOException { + System.out.println("REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-BEFORE: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + + downloadService.removeExtensionPart(extensionUrl, null, validExtensionParts); + + System.out.println("REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-AFTER: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + + } + + /** + * Removes extension resources using part array (one part exists, the other one does not) from cache using isExtensionPartCached() + */ + private void removeExtensionUsingHalfValidPartInArray() throws IOException { + System.out.println("REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-BEFORE: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + + downloadService.removeExtensionPart(extensionUrl, null, halfValidExtensionParts); + + System.out.println("REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-AFTER: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + } + + /** + * Removes external (not mentioned in jnlps) resources from cache using removeResource() + */ + private void removeExternalResource() throws IOException { + System.out.println("REMOVEEXTERNALPART-removeResource: UrlToExternalResource-BEFORE: " + downloadService.isResourceCached(urlToExternalResource, null)); + downloadService.removeResource(urlToExternalResource, null); + System.out.println("REMOVEEXTERNALPART-removeResource: UrlToExternalResource-AFTER: " + downloadService.isResourceCached(urlToExternalResource, null)); + } + + /** + * Loads resources from cache using loadPart() + */ + private void loadPart() throws IOException { + System.out.println("LOADPART-loadPart: LaunchPartOne-BEFORE: " + downloadService.isPartCached(launchPartOne)); + downloadService.loadPart(launchPartOne, null); + System.out.println("LOADPART-loadPart: LaunchPartOne-AFTER: " + downloadService.isPartCached(launchPartOne)); + + System.out.println("LOADPART-loadPart: LaunchPartTwo-BEFORE: " + downloadService.isPartCached(launchPartTwo)); + downloadService.loadPart(launchPartTwo, null); + System.out.println("LOADPART-loadPart: LaunchPartTwo-AFTER: " + downloadService.isPartCached(launchPartTwo)); + } + + /** + * Load extension resources from cache using loadExtensionPart() + */ + private void loadExtensionPart() throws IOException { + System.out.println("LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-BEFORE: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + downloadService.loadExtensionPart(extensionUrl, null, extensionPartOne, null); + System.out.println("LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-AFTER: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + } + + /** + * Loads extension resources using part array (all parts exist) from cache using isExtensionPartCached() + */ + private void loadExtensionUsingValidPartInArray() throws IOException { + System.out.println("LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-BEFORE: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + + downloadService.loadExtensionPart(extensionUrl, null, validExtensionParts, null); + + System.out.println("LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-AFTER: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + + } + + /** + * Loads extension resources using part array (one part exists, the other one does not) from cache using isExtensionPartCached() + */ + private void loadExtensionUsingHalfValidPartInArray() throws IOException { + System.out.println("LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-BEFORE: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + + downloadService.loadExtensionPart(extensionUrl, null, halfValidExtensionParts, null); + + System.out.println("LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-AFTER: " + + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); + } + + /** + * Loads external (not mentioned in jnlps) resources from cache using removeResource() + */ + private void loadExternalResource() throws IOException { + System.out.println("LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-BEFORE: " + downloadService.isResourceCached(urlToExternalResource, null)); + downloadService.loadResource(urlToExternalResource, null, null); + System.out.println("LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-AFTER: " + downloadService.isResourceCached(urlToExternalResource, null)); + } + + /** + * Repeatedly unloads and loads jars + */ + private void repeatedlyLoadingAndUnloadingJars() throws IOException { + downloadService.removePart(launchPartOne); + downloadService.loadPart(launchPartOne, null); + + downloadService.removePart(launchPartOne); + System.out.println("MULTIPLEMETHODCALLS - removePart: LaunchPartOne: " + downloadService.isPartCached(launchPartOne)); + + downloadService.loadPart(launchPartOne, null); + System.out.println("MULTIPLEMETHODCALLS - loadPart: LaunchPartOne: " + downloadService.isPartCached(launchPartOne)); + } + + /** + * Repeatedly unloads and loads external jars + */ + private void repeatedlyLoadingAndUnloadingExternalJars() throws IOException { + downloadService.removeResource(urlToExternalResource, null); + downloadService.loadResource(urlToExternalResource, null, null); + + downloadService.removeResource(urlToExternalResource, null); + System.out.println("MULTIPLEMETHODCALLS - removeResource: UrlToExternalResource: " + downloadService.isResourceCached(urlToExternalResource, null)); + + downloadService.loadResource(urlToExternalResource, null, null); + System.out.println("MULTIPLEMETHODCALLS - loadResource: UrlToExternalResource: " + downloadService.isResourceCached(urlToExternalResource, null)); + } + + /** + * Loads external jar as preparation for external resource testing + */ + private void prepareExternalResourceTests() { + try { + if (!downloadService.isResourceCached(urlToExternalResource, null)) + downloadService.loadResource(urlToExternalResource, null, null); + } catch (Exception e) { + //Continue testing + // This is okay to ignore as it may be a problem with loadResouce( ), which will be identified within tests + } + } + + public static void main(String[] args) throws IOException, InterruptedException { + System.out.println("Running DownloadService.."); + + if (args.length < 2) { + System.out.println("Requires 2 arguments: [server_url] [checkCache | manageJars | manageExternalJars]"); + System.out.println("Exiting.."); + return; + } + + DownloadServiceRunner ds = new DownloadServiceRunner(args[0]); + + if (args[1].equals("checkCache")) { + //Cache Resources + ds.checkCache(); + ds.checkCacheUsingMultipleParts(); + ds.checkExtensionCache(); + ds.checkExtensionCacheUsingMultipleParts(); + } + + if (args[1].equals("manageJnlpJars")) { + //Remove Resources + ds.removePart(); + ds.removeExtensionPart(); + + //Load Resources + ds.loadPart(); + ds.loadExtensionPart(); + + //Manage using multiple part arrays + ds.removeExtensionUsingValidPartInArray(); + ds.loadExtensionUsingValidPartInArray(); + ds.removeExtensionUsingHalfValidPartInArray(); + ds.loadExtensionUsingHalfValidPartInArray(); + + //Unloads and loads jars repeatedly + ds.repeatedlyLoadingAndUnloadingJars(); + + } else if (args[1].equals("manageExternalJars")) { + ds.prepareExternalResourceTests(); + ds.checkExternalCache(); + ds.removeExternalResource(); + ds.loadExternalResource(); + + //Unloads and loads jars repeatedly + ds.repeatedlyLoadingAndUnloadingExternalJars(); + } + + System.out.println("Exiting DownloadService.."); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java icedtea-web-1.4/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java --- icedtea-web-1.3.2/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java 2013-05-03 19:08:24.733514051 +0000 @@ -0,0 +1,377 @@ +/* DownloadServiceTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.io.File; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.List; + +import junit.framework.Assert; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; + +import org.junit.BeforeClass; +import org.junit.Test; + +public class DownloadServiceTest { + private static ServerAccess server = new ServerAccess(); + private final String exitString = "Exiting DownloadService.."; + private static List checkCache = new ArrayList(); + private static List manageJnlpResources = new ArrayList(); + private static List manageExternalResources = new ArrayList(); + + @BeforeClass + public static void initalizeClass() throws MalformedURLException { + //Check Cache + checkCache.add(server.getJavawsLocation()); + checkCache.add("-arg"); + checkCache.add(server.getUrl().toString() + "/"); + checkCache.add("-arg"); + checkCache.add("checkCache"); + checkCache.add("-Xtrustall"); + checkCache.add(ServerAccess.HEADLES_OPTION); + checkCache.add(server.getUrl() + "/DownloadService.jnlp"); + + //Manage Jnlp Resouces + manageJnlpResources.add(server.getJavawsLocation()); + manageJnlpResources.add("-arg"); + manageJnlpResources.add(server.getUrl().toString() + "/"); + manageJnlpResources.add("-arg"); + manageJnlpResources.add("manageJnlpJars"); + manageJnlpResources.add("-Xtrustall"); + manageJnlpResources.add(ServerAccess.HEADLES_OPTION); + manageJnlpResources.add(server.getUrl() + "/DownloadService.jnlp"); + + //Manage External Resources + manageExternalResources.add(server.getJavawsLocation()); + manageExternalResources.add("-arg"); + manageExternalResources.add(server.getUrl().toString() + "/"); + manageExternalResources.add("-arg"); + manageExternalResources.add("manageExternalJars"); + manageExternalResources.add("-Xtrustall"); + manageExternalResources.add(ServerAccess.HEADLES_OPTION); + manageExternalResources.add(server.getUrl() + "/DownloadService.jnlp"); + } + + /** + * Executes reproducer to checks if DownloadServices's cache checks are working correctly. + * @return stdout of reproducer. + */ + private String runCacheCheckTests() throws Exception { + //Check cache test + ProcessResult processResult = ServerAccess.executeProcess(checkCache); + String stdoutCheckCache = processResult.stdout; + Assert.assertTrue("CheckCache - DownloadServiceRunner instance did not close as expected, this test may fail.", + stdoutCheckCache.contains(exitString)); + + return stdoutCheckCache; + } + + /** + * Executes reproducer to checks if DownloadServices's management of external jars are working correctly. + * @return stdout of reproducer. + */ + private String runExternalTests() throws Exception { + ProcessResult processResult = ServerAccess.executeProcess(manageExternalResources); + String stdoutExternalResources = processResult.stdout; + Assert.assertTrue("ManageExternalResources - DownloadServiceRunner instance did not close as expected, this test may fail.", + stdoutExternalResources.contains(exitString)); + + return stdoutExternalResources; + } + + /** + * Executes reproducer to checks if DownloadServices's management of jnlp jars are working correctly. + * @return stdout of reproducer. + */ + private String runJnlpResourceTests() throws Exception { + ProcessResult processResult = ServerAccess.executeProcess(manageJnlpResources); + String stdoutJnlpResources = processResult.stdout; + Assert.assertTrue("ManageJnlpResources - DownloadServiceRunner instance did not close as expected, this test may fail.", + stdoutJnlpResources.contains(exitString)); + + return stdoutJnlpResources; + } + + @Test + public void checkIfRequiredResourcesExist() { + //Jnlp files + Assert.assertTrue("DownloadService.jnlp is a required resource that's missing.", + new File(server.getDir().getAbsolutePath() + "/DownloadService.jnlp").isFile()); + Assert.assertTrue("DownloadServiceExtension.jnlp is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + + "/DownloadServiceExtension.jnlp").isFile()); + + //Jar files + Assert.assertTrue("DownloadService.jar is a required resource that's missing.", + new File(server.getDir().getAbsolutePath() + "/DownloadService.jar").isFile()); + Assert.assertTrue("SignedJnlpResource.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + + "/SignedJnlpResource.jar").isFile()); + Assert.assertTrue("SignedJarResource.jar is a required resource that's missing.", + new File(server.getDir().getAbsolutePath() + "/SignedJarResource.jar").isFile()); + Assert.assertTrue("MultiJar-NoSignedJnlp.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + + "/MultiJar-NoSignedJnlp.jar").isFile()); + } + + @Test + public void testcheckCaches() throws Exception { + String stdoutCheckCache = runCacheCheckTests(); + + //Stdout validations + String s = "CHECKCACHE-isPartCached: LaunchPartOne: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + + s = "CHECKCACHE-isPartCached: LaunchPartTwo: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + + s = "CHECKCACHE-isPartCached: NonExistingPart: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + } + + @Test + public void testcheckCachesUsingArray() throws Exception { + String stdoutCheckCache = runCacheCheckTests(); + + //Stdout validations + String s = "CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): ValidLaunchParts: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + + s = "CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): HalfValidLaunchParts: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + + s = "CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): InvalidParts: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + } + + @Test + public void testExtensioncheckCaches() throws Exception { + String stdoutCheckCache = runCacheCheckTests(); + + //Stdout validations + String s = "CHECKEXTENSIONCACHE-isExtensionPartCached: ExtensionPartOne: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + + s = "CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingPart: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + + s = "CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingUrl: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + } + + @Test + public void testExtensioncheckCachesUsingArray() throws Exception { + String stdoutCheckCache = runCacheCheckTests(); + + //Stdout validations + String s = "CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): ValidExtensionParts: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + + s = "CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): HalfValidExtensionParts: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + + s = "CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): InvalidParts: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); + + } + + @Test + public void testExternalResourceChecks() throws Exception { + runCacheCheckTests(); + String stdoutExternalResources = runExternalTests(); + + //Stdout validations + //This is automatically cached from the test engine because the .jar exists + String s = "CHECKEXTERNALCACHE-isResourceCached: UrlToExternalResource: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); + + s = "CHECKEXTERNALCACHE-isResourceCached: NonExistingUrl: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); + } + + @Test + public void testRemovePart() throws Exception { + runCacheCheckTests(); + String stdoutJnlpResources = runJnlpResourceTests(); + + String s = "REMOVEPART-removePart: LaunchPartOne-BEFORE: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + s = "REMOVEPART-removePart: LaunchPartOne-AFTER: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "REMOVEPART-removePart: LaunchPartTwo-BEFORE: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + s = "REMOVEPART-removePart: LaunchPartTwo-AFTER: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + } + + @Test + public void testRemoveExtensionPart() throws Exception { + runCacheCheckTests(); + String stdoutJnlpResources = runJnlpResourceTests(); + + //Stdout validations + String s = "REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-BEFORE: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-AFTER: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + } + + @Test + public void testRemoveExtensionPartUsingArray() throws Exception { + runCacheCheckTests(); + String stdoutJnlpResources = runJnlpResourceTests(); + + //Stdout validations + String s = "REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-BEFORE: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-AFTER: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-BEFORE: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-AFTER: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + } + + @Test + public void testRemoveExternalResource() throws Exception { + runCacheCheckTests(); + String stdoutExternalResources = runExternalTests(); + + //Stdout validations + String s = "REMOVEEXTERNALPART-removeResource: UrlToExternalResource-BEFORE: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); + + s = "REMOVEEXTERNALPART-removeResource: UrlToExternalResource-AFTER: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); + + } + + @Test + public void testLoadPart() throws Exception { + runCacheCheckTests(); + String stdoutJnlpResources = runJnlpResourceTests(); + + //Stdout validations + //Part 'one' + String s = "LOADPART-loadPart: LaunchPartOne-BEFORE: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + s = "LOADPART-loadPart: LaunchPartOne-AFTER: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + //Part 'two' + s = "LOADPART-loadPart: LaunchPartTwo-BEFORE: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + s = "LOADPART-loadPart: LaunchPartTwo-AFTER: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + } + + @Test + public void testLoadExtensionPart() throws Exception { + runCacheCheckTests(); + String stdoutJnlpResources = runJnlpResourceTests(); + + //Stdout validations + String s = "LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-BEFORE: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-AFTER: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + } + + @Test + public void testLoadExtensionPartUsingArray() throws Exception { + runCacheCheckTests(); + String stdoutJnlpResources = runJnlpResourceTests(); + + //Stdout validations + String s = "LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-BEFORE: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-AFTER: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-BEFORE: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-AFTER: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + } + + @Test + public void testLoadExternalResource() throws Exception { + runCacheCheckTests(); + String stdoutExternalResources = runExternalTests(); + + //Stdout validations + String s = "LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-BEFORE: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); + + s = "LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-AFTER: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); + + } + + @Test + public void testRepeatedlyLoadingAndUnloadingJnlpResources() throws Exception { + runCacheCheckTests(); + String stdoutJnlpResources = runJnlpResourceTests(); + + //Stdout validations + String s = "MULTIPLEMETHODCALLS - removePart: LaunchPartOne: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + s = "MULTIPLEMETHODCALLS - loadPart: LaunchPartOne: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); + + } + + @Test + public void testRepeatedlyLoadingAndUnloadingExternalResources() throws Exception { + runCacheCheckTests(); + String stdoutExternalResources = runExternalTests(); + + //Stdout validations + String s = "MULTIPLEMETHODCALLS - removeResource: UrlToExternalResource: false"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); + + s = "MULTIPLEMETHODCALLS - loadResource: UrlToExternalResource: true"; + Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarExtension.jnlp icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarExtension.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarExtension.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarExtension.jnlp 2013-05-03 19:08:24.734514038 +0000 @@ -0,0 +1,58 @@ + + + + + EmptySignedJarExtension + IcedTea + + EmptySignedJarExtension + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jnlp icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jnlp 2013-05-03 19:08:24.734514038 +0000 @@ -0,0 +1,64 @@ + + + + + EmptySignedJar + IcedTea + + EmptySignedJar + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jnlp icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jnlp 2013-05-03 19:08:24.735514025 +0000 @@ -0,0 +1,64 @@ + + + + + EmptySignedJar + IcedTea + + EmptySignedJar + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/empty_file icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/empty_file --- icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/empty_file 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/empty_file 2013-05-03 19:08:24.735514025 +0000 @@ -0,0 +1 @@ +This is an empty file. diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java --- icedtea-web-1.3.2/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java 2013-05-03 19:08:24.736514012 +0000 @@ -0,0 +1,73 @@ +/* EmptySignedJar.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.Bug; + +import org.junit.Assert; +import org.junit.Test; + +public class EmptySignedJarTest { + + private static ServerAccess server = new ServerAccess(); + private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); + private final String jarOutput = "Running SignedJarResource.."; + + @Test + public void checkingForRequiredResources() throws Exception { + String s = "Running SignedJarResource.."; + ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJarResource.jnlp"); + Assert.assertTrue("Could not locate SignedJarResource class within SignedJarResource jar", pr.stdout.contains(s)); + } + + @Bug(id = "PR1049") + @Test + public void usingExtensionWithEmptyJar() throws Exception { + ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/EmptySignedJarInExtensionJnlp.jnlp"); + Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); + } + + @Bug(id = "PR1049") + @Test + public void usingLauncherWithEmptyJar() throws Exception { + ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/EmptySignedJarInLaunchingJnlp.jnlp"); + Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/GifarBase/testcases/GifarTestcases.java icedtea-web-1.4/tests/reproducers/signed/GifarBase/testcases/GifarTestcases.java --- icedtea-web-1.3.2/tests/reproducers/signed/GifarBase/testcases/GifarTestcases.java 2013-04-10 15:20:12.078866000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/GifarBase/testcases/GifarTestcases.java 2013-05-03 19:08:24.741513950 +0000 @@ -41,12 +41,14 @@ import java.util.Arrays; import java.util.List; import javax.imageio.ImageIO; +import net.sourceforge.jnlp.ClosingListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.InvalidJarHeaderException; import net.sourceforge.jnlp.util.JarFile; @@ -57,34 +59,17 @@ List trustIgnore = Arrays.asList(new String[]{ServerAccess.HEADLES_OPTION, "-Xtrustall", "-Xignoreheaders"}); List trust = Arrays.asList(new String[]{ServerAccess.HEADLES_OPTION, "-Xtrustall"}); - private static String exceptionString = InvalidJarHeaderException.class.getName(); - private static String okString = "Image loaded"; - private static String sucideString = "gifar killing himself"; + RulesFolowingClosingListener.ContainsRule exceptionRule = new RulesFolowingClosingListener.ContainsRule(InvalidJarHeaderException.class.getName()); + RulesFolowingClosingListener.ContainsRule okRule = new RulesFolowingClosingListener.ContainsRule("Image loaded"); + RulesFolowingClosingListener.ContainsRule sucideRule = new RulesFolowingClosingListener.ContainsRule("gifar killing himself"); - private static boolean evaluate(String what, String doContains) { - return what.contains(doContains); + private ClosingListener getExceptionClosingListener() { + return new RulesFolowingClosingListener(exceptionRule); } - private static boolean exceptionRule(String what) { - return evaluate(what, exceptionString); + private ClosingListener getOkClosingListener() { + return new RulesFolowingClosingListener(okRule, sucideRule); } - - private static boolean okRule(String what) { - return evaluate(what, okString); - } - - private static boolean sucideRule(String what) { - return evaluate(what, sucideString); - } - - private static String toPassingString(String rule) { - return "should contain `" + rule + "`"; - } - - private static String toFailingString(String rule) { - return "should NOT contain `" + rule + "`"; - } - File okJar = new File(server.getDir(), "GifarBase.jar"); File hackedJar = new File(server.getDir(), "Gifar.jar"); File okImage = new File(server.getDir(), "happyNonAnimated.gif"); @@ -100,16 +85,16 @@ Assert.assertNotNull(j2); } - - @Test + + @Test public void unittest_verify_badJar() throws IOException { JNLPRuntime.setIgnoreHeaders(false); - Exception ex = null; - JarFile j1 = null; - try { - j1 = new JarFile(hackedJar); - } catch (InvalidJarHeaderException e) { - ex = e; + Exception ex=null; + JarFile j1=null; + try{ + j1 = new JarFile(hackedJar); + }catch(InvalidJarHeaderException e){ + ex=e; } Assert.assertNull(j1); Assert.assertNotNull(ex); @@ -119,16 +104,17 @@ Assert.assertNotNull(j2); } - - @Test + + + @Test public void unittest_verify_badImageAsJar() throws IOException { JNLPRuntime.setIgnoreHeaders(false); - Exception ex = null; - JarFile j1 = null; - try { - j1 = new JarFile(hackedImage); - } catch (InvalidJarHeaderException e) { - ex = e; + Exception ex=null; + JarFile j1=null; + try{ + j1 = new JarFile(hackedImage); + }catch(InvalidJarHeaderException e){ + ex=e; } Assert.assertNull(j1); Assert.assertNotNull(ex); @@ -138,8 +124,8 @@ Assert.assertNotNull(j2); } - - @Test + + @Test public void unittest_verify_okImage() throws IOException { JNLPRuntime.setIgnoreHeaders(false); BufferedImage j1 = ImageIO.read(okImage); @@ -149,10 +135,10 @@ Assert.assertNotNull(j2); } - - @Test + + @Test public void unittest_verify_badImaqe() throws IOException { - JNLPRuntime.setIgnoreHeaders(false); + JNLPRuntime.setIgnoreHeaders(false); BufferedImage j1 = ImageIO.read(hackedImage); Assert.assertNotNull(j1); JNLPRuntime.setIgnoreHeaders(true); @@ -160,14 +146,13 @@ Assert.assertNotNull(j2); } - @Test @NeedsDisplay public void GifarViaJnlp_application() throws Exception { ProcessResult pr = server.executeJavaws(trust, "gifar_application.jnlp"); Assert.assertEquals((Integer) 0, pr.returnValue); - Assert.assertFalse("stdout " + toFailingString(okString) + " but did", okRule(pr.stdout)); - Assert.assertTrue("stderr " + toPassingString(exceptionString) + " but did'nt", exceptionRule(pr.stderr)); + Assert.assertFalse("stdout " + okRule.toFailingString() + " but did", okRule.evaluate(pr.stdout)); + Assert.assertTrue("stderr " + exceptionRule.toPassingString() + " but did'nt", exceptionRule.evaluate(pr.stderr)); } @Test @@ -175,8 +160,8 @@ public void GifarViaJnlp_application_ignoreHeaders() throws Exception { ProcessResult pr = server.executeJavaws(trustIgnore, "gifar_application.jnlp"); Assert.assertEquals((Integer) 0, pr.returnValue); - Assert.assertTrue("stdout " + toPassingString(okString) + " but didn't", okRule(pr.stdout)); - Assert.assertFalse("stderr " + toFailingString(exceptionString) + " but did", exceptionRule(pr.stderr)); + Assert.assertTrue("stdout " + okRule.toPassingString() + " but didn't", okRule.evaluate(pr.stdout)); + Assert.assertFalse("stderr " + exceptionRule.toFailingString() + " but did", exceptionRule.evaluate(pr.stderr)); } @Test @@ -184,8 +169,8 @@ public void GifarViaJnlp_applet() throws Exception { ProcessResult pr = server.executeJavaws(trust, "gifar_applet.jnlp"); Assert.assertEquals((Integer) 0, pr.returnValue); - Assert.assertFalse("stdout " + toFailingString(okString) + " but did", okRule(pr.stdout)); - Assert.assertTrue("stderr " + toPassingString(exceptionString) + " but didn't", exceptionRule(pr.stderr)); + Assert.assertFalse("stdout " + okRule.toFailingString() + " but did", okRule.evaluate(pr.stdout)); + Assert.assertTrue("stderr " + exceptionRule.toPassingString() + " but didn't", exceptionRule.evaluate(pr.stderr)); } @Test @@ -193,17 +178,17 @@ public void GifarViaJnlp_applet_ignoreHeaders() throws Exception { ProcessResult pr = server.executeJavaws(trustIgnore, "gifar_applet.jnlp"); Assert.assertEquals((Integer) 0, pr.returnValue); - Assert.assertTrue("stdout " + toPassingString(okString) + " but didn't", okRule(pr.stdout)); - Assert.assertFalse("stderr " + toFailingString(exceptionString) + " but did", exceptionRule(pr.stderr)); + Assert.assertTrue("stdout " + okRule.toPassingString() + " but didn't", okRule.evaluate(pr.stdout)); + Assert.assertFalse("stderr " + exceptionRule.toFailingString() + " but did", exceptionRule.evaluate(pr.stderr)); } @Test @TestInBrowsers(testIn = {Browsers.all}) @NeedsDisplay public void GifarViaBrowser_hacked() throws Exception { - ProcessResult pr = server.executeBrowser("gifarView_hacked.html"); - Assert.assertFalse("stdout " + toFailingString(okString) + " but did", okRule(pr.stdout)); - Assert.assertTrue("stderr " + toPassingString(exceptionString) + " but didn't", exceptionRule(pr.stderr)); + ProcessResult pr = server.executeBrowser("gifarView_hacked.html", getOkClosingListener(), getExceptionClosingListener()); + Assert.assertFalse("stdout " + okRule.toFailingString() + " but did", okRule.evaluate(pr.stdout)); + Assert.assertTrue("stderr " + exceptionRule.toPassingString() + " but didn't", exceptionRule.evaluate(pr.stderr)); } @@ -212,9 +197,9 @@ @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void GifarViaBrowser_ok() throws Exception { - ProcessResult pr = server.executeBrowser("gifarView_ok.html"); - Assert.assertTrue("stdout " + toPassingString(okString) + " but didn't", okRule(pr.stdout)); - Assert.assertFalse("stderr " + toFailingString(exceptionString) + " but did", exceptionRule(pr.stderr)); + ProcessResult pr = server.executeBrowser("gifarView_ok.html", getOkClosingListener(), getExceptionClosingListener()); + Assert.assertTrue("stdout " + okRule.toPassingString() + " but didn't", okRule.evaluate(pr.stdout)); + Assert.assertFalse("stderr " + exceptionRule.toFailingString() + " but did", exceptionRule.evaluate(pr.stderr)); } diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.jnlp icedtea-web-1.4/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.jnlp 2013-05-03 19:08:24.748513862 +0000 @@ -0,0 +1,69 @@ + + + + + Main Jar does have a signed jnlp + IcedTea + + Main Jar does have a signed jnlp + + + + + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/SimpleApplication.java icedtea-web-1.4/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/SimpleApplication.java --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/SimpleApplication.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/SimpleApplication.java 2013-05-03 19:08:24.748513862 +0000 @@ -0,0 +1,64 @@ +/* SimpleApplication.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +import java.lang.reflect.*; + +public class SimpleApplication { + + public static void run() { + System.out.println("**Running SimpleApplication"); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public static void main(String[] args) throws Exception { + System.out.println("Starting application without a Signed Jnlp"); + + //No parameters + Class noparam[] = {}; + + //Run SignedJnlpApplication + Class c1 = Class.forName("SignedJnlpApplication"); + Method m1 = c1.getDeclaredMethod("run", noparam); + m1.invoke(c1); + + //Run SignedJnlpTemplate + Class c2 = Class.forName("SignedJnlpTemplate"); + Method m2 = c2.getDeclaredMethod("run", noparam); + m2.invoke(c2); + + System.out.println("Ending application without a Signed Jnlp"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatchingSignedJnlpApplication.jnlp icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatchingSignedJnlpApplication.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatchingSignedJnlpApplication.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatchingSignedJnlpApplication.jnlp 2013-05-03 19:08:24.749513850 +0000 @@ -0,0 +1,71 @@ + + + + + Matching Signed JNLP + IcedTea + + Matching Signed JNLP + + + + + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmatchingSignedJnlpApplication.jnlp icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmatchingSignedJnlpApplication.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmatchingSignedJnlpApplication.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmatchingSignedJnlpApplication.jnlp 2013-05-03 19:08:24.749513850 +0000 @@ -0,0 +1,71 @@ + + + + + XXXXXXX - THIS FILE DOES NOT MATCH THE SIGNED JNLP FILE - XXXXXXX + IcedTea + + XXXXXXX - THIS FILE DOES NOT MATCH THE SIGNED JNLP FILE - XXXXXXX + + + + + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp 2013-05-03 19:08:24.750513837 +0000 @@ -0,0 +1,64 @@ + + + + + Matching Signed JNLP + IcedTea + + Matching Signed JNLP + + + + + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication.java icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication.java --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication.java 2013-05-03 19:08:24.750513837 +0000 @@ -0,0 +1,64 @@ +/* SignedJnlpApplication.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +import java.lang.reflect.*; + +public class SignedJnlpApplication { + + public static void run() { + System.out.println("**Running SignedJnlpApplication"); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public static void main(String[] args) throws Exception { + System.out.println("Starting application with signed application jnlp"); + + //No parameters + Class noparam[] = {}; + + //Run SignedJnlpTemplate + Class c1 = Class.forName("SignedJnlpTemplate"); + Method m1 = c1.getDeclaredMethod("run", noparam); + m1.invoke(c1); + + //Run SimpleApplication + Class c2 = Class.forName("SimpleApplication"); + Method m2 = c2.getDeclaredMethod("run", noparam); + m2.invoke(c2); + + System.out.println("Ending application with signed application jnlp"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJnlpTest.java icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJnlpTest.java --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJnlpTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJnlpTest.java 2013-05-03 19:08:24.750513837 +0000 @@ -0,0 +1,102 @@ +/* MultiJarSignedJnlpTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import org.junit.Assert; +import org.junit.Test; + +public class MultiJarSignedJnlpTest { + + private static ServerAccess server = new ServerAccess(); + private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); + private final String signedJnlpException = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: " + + "The signed JNLP file did not match the launching JNLP file. Missing Resource: Signed Application " + + "did not match launching JNLP File"; + + @Test + public void checkingForRequiredResources() throws Exception { + //MainJarWithoutSignedJnlp.jnlp includes all three required jars + String s = "Ending application without a Signed Jnlp"; + ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithoutSignedJnlp.jnlp"); + Assert.assertTrue("Could not locate the required resources required to run this test", pr.stdout.contains(s)); + } + + @Test + public void mainJarMatchingSignedJnlpTemplate() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithMatchingSignedJnlpTemplate.jnlp"); + String s = "Ending application with signed application_template jnlp"; + Assert.assertTrue("Could not locate SignedJnlpTemplate class within MultiJar-SignedJnlpTemplate.jar", pr.stdout.contains(s)); + Assert.assertFalse(pr.stderr.contains(signedJnlpException)); + } + + @Test + public void mainJarMatchingSignedJnlpApplication() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithMatchingSignedJnlpApplication.jnlp"); + String s = "Ending application with signed application jnlp"; + Assert.assertTrue("Could not locate SignedJnlpApplication class within MultiJar-SignedJnlpApplication.jar", pr.stdout.contains(s)); + Assert.assertFalse(pr.stderr.contains(signedJnlpException)); + } + + @Test + public void mainJarWithUnmatchingSignedJnlpApplication() throws Exception { + String s = "Ending application with signed application jnlp"; + ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithUnmatchingSignedJnlpApplication.jnlp"); + Assert.assertTrue("Stdout should contains " + signedJnlpException + " but did not", pr.stderr.contains(signedJnlpException)); + Assert.assertFalse( pr.stdout.contains(s)); + } + + @Test + public void mainJarWithUnmatchingSignedJnlpTemplate() throws Exception { + String s = "Ending application with signed application_template jnlp"; + ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithUnmatchingSignedJnlpTemplate.jnlp"); + Assert.assertTrue("Stdout should contains " + signedJnlpException + " but did not", pr.stderr.contains(signedJnlpException)); + Assert.assertFalse(pr.stdout.contains(s)); + } + + @Test + public void mainJarWithoutSignedJnlp() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithoutSignedJnlp.jnlp"); + String s = "Ending application without a Signed Jnlp"; + Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatchingSignedJnlpTemplate.jnlp icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatchingSignedJnlpTemplate.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatchingSignedJnlpTemplate.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatchingSignedJnlpTemplate.jnlp 2013-05-03 19:08:24.751513824 +0000 @@ -0,0 +1,71 @@ + + + + + Matching Signed Jnlp Template + IcedTea + + Matching Signed Jnlp Template + + + + + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchingSignedJnlpTemplate.jnlp icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchingSignedJnlpTemplate.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchingSignedJnlpTemplate.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchingSignedJnlpTemplate.jnlp 2013-05-03 19:08:24.751513824 +0000 @@ -0,0 +1,71 @@ + + + + + XXXXXXX - THIS FILE DOES NOT MATCH THE SIGNED JNLP TEMPLATE FILE - XXXXXXX + IcedTea + + XXXXXXX - THIS FILE DOES NOT MATCH THE SIGNED JNLP TEMPLATE FILE - XXXXXXX + + + + + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 2013-05-03 19:08:24.752513811 +0000 @@ -0,0 +1,64 @@ + + + + + Matching Signed Jnlp Template + IcedTea + + Matching Signed Jnlp Template + + + + + + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/SignedJnlpTemplate.java icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/SignedJnlpTemplate.java --- icedtea-web-1.3.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/SignedJnlpTemplate.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/SignedJnlpTemplate.java 2013-05-03 19:08:24.752513811 +0000 @@ -0,0 +1,64 @@ +/* SignedJnlpTemplate.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +import java.lang.reflect.*; + +public class SignedJnlpTemplate { + + public static void run() { + System.out.println("**Running SignedJnlpTemplate"); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public static void main(String[] args) throws Exception { + System.out.println("Starting application with signed application_template jnlp"); + + //No parameters + Class noparam[] = {}; + + //Run SignedJnlpApplication + Class c1 = Class.forName("SignedJnlpApplication"); + Method m1 = c1.getDeclaredMethod("run", noparam); + m1.invoke(c1); + + //Run SimpleApplication + Class c2 = Class.forName("SimpleApplication"); + Method m2 = c2.getDeclaredMethod("run", noparam); + m2.invoke(c2); + + System.out.println("Ending application with signed application_template jnlp"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/ReadPropertiesSigned/README icedtea-web-1.4/tests/reproducers/signed/ReadPropertiesSigned/README --- icedtea-web-1.3.2/tests/reproducers/signed/ReadPropertiesSigned/README 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/ReadPropertiesSigned/README 2013-05-03 19:08:24.754513785 +0000 @@ -0,0 +1,2 @@ +This test is relied on by custom/MultipleSignaturesPerJar. +Any changes to this reproducer may require updates there. \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/CheckCookieAndGotoClear.html icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/CheckCookieAndGotoClear.html --- icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/CheckCookieAndGotoClear.html 2013-04-10 11:40:23.997668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/CheckCookieAndGotoClear.html 2013-05-03 19:08:24.757513749 +0000 @@ -37,13 +37,13 @@ --> - +

    - + - +

    diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/ClearPersistentCookie.html icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/ClearPersistentCookie.html --- icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/ClearPersistentCookie.html 2013-04-10 11:40:23.997668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/ClearPersistentCookie.html 2013-05-03 19:08:24.757513749 +0000 @@ -40,7 +40,7 @@ - + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.html icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.html --- icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.html 2013-04-10 11:40:23.998668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.html 2013-05-03 19:08:24.758513736 +0000 @@ -41,7 +41,7 @@ - +
    diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookie.html icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookie.html --- icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookie.html 2013-04-10 11:40:23.998668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookie.html 2013-05-03 19:08:24.757513749 +0000 @@ -40,9 +40,9 @@ - + - +

    diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookie.html icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookie.html --- icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookie.html 2013-04-10 11:40:23.998668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookie.html 2013-05-03 19:08:24.758513736 +0000 @@ -40,7 +40,7 @@ - + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/srcs/SavingCookies.java icedtea-web-1.4/tests/reproducers/signed/SavingCookies/srcs/SavingCookies.java --- icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/srcs/SavingCookies.java 2013-04-10 11:40:23.999668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/SavingCookies/srcs/SavingCookies.java 2013-05-03 19:08:24.759513723 +0000 @@ -1,6 +1,6 @@ /* SavingCookies.java Store cookies in the java cookie store, and go to a page that confirms they are there. - + Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/testcases/SavingCookiesTests.java icedtea-web-1.4/tests/reproducers/signed/SavingCookies/testcases/SavingCookiesTests.java --- icedtea-web-1.3.2/tests/reproducers/signed/SavingCookies/testcases/SavingCookiesTests.java 2013-04-10 11:40:23.999668000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/SavingCookies/testcases/SavingCookiesTests.java 2013-05-03 19:08:24.760513710 +0000 @@ -50,7 +50,7 @@ import org.junit.Test; public class SavingCookiesTests extends BrowserTest { - + static final String ENTERING_CHECK = "Entered CheckingCookies"; static final String CHECKING_COMPLETION = "Finished CheckingCookies"; static final String SAVING_COMPLETION = "Finished SavingCookies"; @@ -85,9 +85,9 @@ } }; if (url.endsWith(".html")) { - pr = server.executeBrowser(url, stdoutListener, stdoutListener); + pr = server.executeBrowser(url, stdoutListener, null); } else if (url.endsWith(".jnlp")) { - pr = server.executeJavawsHeadless(TRUSTALL, url, stdoutListener, stdoutListener); + pr = server.executeJavawsHeadless(TRUSTALL, url, stdoutListener, null, null); } } catch (Exception ex) { throw new RuntimeException(ex); @@ -105,11 +105,11 @@ public void AppletCheckCookieIsntSet() throws Exception { final String COOKIE_SANITY_CHECK = "Found cookie: TEST="; ProcessResult pr = server.executeBrowser("/CheckCookie.html"); - + Assert.assertFalse("stdout should NOT contain '" + COOKIE_SANITY_CHECK + "' but did.", pr.stdout.contains(COOKIE_SANITY_CHECK)); Assert.assertTrue("stdout should contain '" + CHECKING_COMPLETION + "' but did not.", pr.stdout.contains(CHECKING_COMPLETION)); } - + @Test @TestInBrowsers(testIn = { Browsers.one }) @Bug(id = "PR588") @@ -129,10 +129,10 @@ while (!save.completed) { Thread.sleep(100); } - + ProcessResult check = server.executeBrowser("/CheckCookie.html"); save.join(); - + Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", save.pr.stdout.contains(ENTERING_CHECK)); //XXX: It is necessary to check save.pr's stdout, because it does not show up in 'check.stdout' for some reason Assert.assertTrue("stdout should contain '" + COOKIE_SESSION_CHECK + "' but did not.", save.pr.stdout.contains(COOKIE_SESSION_CHECK)); @@ -154,7 +154,7 @@ @Bug(id = "PR588") public void AppletPersistentCookieShowDoc() throws Exception { ProcessResult pr = server.executeBrowser("/SavePersistentCookieAndGotoCheck.html"); - + Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", pr.stdout.contains(ENTERING_CHECK)); Assert.assertTrue("stdout should contain '" + COOKIE_PERSISTENT_CHECK + "' but did not.", pr.stdout.contains(COOKIE_PERSISTENT_CHECK)); } @@ -171,4 +171,4 @@ Assert.assertTrue("stdout should contain '" + COOKIE_PERSISTENT_CHECK + "' but did not.", check.stdout.contains(COOKIE_PERSISTENT_CHECK)); } -} \ No newline at end of file +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed/SignedJarResource/resources/SignedJarResource.jnlp icedtea-web-1.4/tests/reproducers/signed/SignedJarResource/resources/SignedJarResource.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed/SignedJarResource/resources/SignedJarResource.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed/SignedJarResource/resources/SignedJarResource.jnlp 2013-05-03 19:08:24.761513697 +0000 @@ -0,0 +1,62 @@ + + + + + SignedJarResource + IcedTea + + SignedJarResource + + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/AppletTestSigned2/srcs/AppletTestSigned2.java icedtea-web-1.4/tests/reproducers/signed2/AppletTestSigned2/srcs/AppletTestSigned2.java --- icedtea-web-1.3.2/tests/reproducers/signed2/AppletTestSigned2/srcs/AppletTestSigned2.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/AppletTestSigned2/srcs/AppletTestSigned2.java 2013-05-03 19:08:24.778513484 +0000 @@ -0,0 +1,62 @@ +/* AppletTestSigned2.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.applet.Applet; + +public class AppletTestSigned2 extends Applet { + + + @Override + public void init() { + System.out.println("AppletTestSigned2 was initialised"); + } + + @Override + public void start() { + System.out.println("AppletTestSigned2 was started"); + } + + @Override + public void stop() { + System.out.println("AppletTestSigned2 was stopped"); + } + + @Override + public void destroy() { + System.out.println("AppletTestSigned2 will be destroyed"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp 2013-05-03 19:08:24.779513472 +0000 @@ -0,0 +1,55 @@ + + + + + MultipleSignaturesTest1 + IcedTea + + MultipleSignaturesTest1 + + + + + + + + + SimpletestSigned1 + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp 2013-05-03 19:08:24.779513472 +0000 @@ -0,0 +1,58 @@ + + + + + MultipleSignaturesTest1 + IcedTea + + MultipleSignaturesTest1 + + + + + + + + + SimpletestSigned1 + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp 2013-05-03 19:08:24.779513472 +0000 @@ -0,0 +1,60 @@ + + + + + MultipleSignaturesTest2 + IcedTea + + MultipleSignaturesTest2 + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html 2013-05-03 19:08:24.778513484 +0000 @@ -0,0 +1,43 @@ + + +

    + +

    + + \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTestUsesPermissions.html icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTestUsesPermissions.html --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTestUsesPermissions.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTestUsesPermissions.html 2013-05-03 19:08:24.780513460 +0000 @@ -0,0 +1,43 @@ + + +

    + +

    + + \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java 2013-05-03 19:08:24.780513460 +0000 @@ -0,0 +1,94 @@ +package somecrazytestpackage; + +import java.applet.Applet; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +/* MultipleSignaturesTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +public class MultipleSignaturesTest extends Applet { + + //Ignored when class being called is SimpletestSigned1, used with ReadPropertiesSigned + private static final String SYSTEM_PROPERTY = "user.home"; + + public static void main(String[] args) { + executeForeignMethodCaught(args[0]); + } + + public static void executeForeignMethodCaught(String classname) { + try { + executeForeignMethod(classname); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + public static void executeForeignMethod(String classname) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException { + Class clazz = Class.forName(classname); + Method mainMethod = clazz.getDeclaredMethod("main", String[].class); + mainMethod.invoke(clazz.newInstance(), (Object) new String[] {SYSTEM_PROPERTY}); + } + + private class Killer extends Thread { + + public int n = 2000; + + @Override + public void run() { + try { + Thread.sleep(n); + System.out.println("Applet killing himself after " + n + " ms of life"); + System.exit(0); + } catch (Exception ex) { + } + } + } + private Killer killer; + + @Override + public void init() { + killer = new Killer(); + } + + @Override + public void start() { + killer.start(); + System.out.println("killer was started"); + main(new String[]{getParameter("mainclass")}); + System.out.println("*** APPLET FINISHED ***"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java 2013-05-03 19:08:24.781513448 +0000 @@ -0,0 +1,109 @@ +/* MultipleSignaturesTestTests.java +Copyright (C) 20121 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import org.junit.Assert; + +import org.junit.Test; + +@Bug(id = {"PR822"}) +public class MultipleSignaturesTestTests extends BrowserTest{ + + public static final String GSJE = "Good simple javaws exapmle"; + public static final String launchExcDiffCerts = "Fatal: Application Error: The JNLP application is not fully signed by a single cert."; + public static final String accExcString = "java.security.AccessControlException: access denied"; + + @Test + @NeedsDisplay + public void multipleSignaturesTestJnlpApplet() throws Exception { + ProcessResult pr = server.executeJavaws("/MultipleSignaturesTest2.jnlp"); + String s = GSJE; + Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); + String cc = "xception"; + Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); + } + + @Test + @NeedsDisplay + @TestInBrowsers(testIn=Browsers.one) + public void multipleSignaturesTestHtmlApplet() throws Exception { + ProcessResult pr = server.executeBrowser("/MultipleSignaturesTest.html", AutoClose.CLOSE_ON_CORRECT_END); + String s = GSJE; + Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); + Assert.assertFalse("stderr should NOT contains `" + accExcString + "`, but did", pr.stderr.contains(accExcString)); + } + + @Test + @NeedsDisplay + @TestInBrowsers(testIn=Browsers.one) + @Bug(id={"PR822"}) + public void multipleSignaturesTestHtmlAppletUsesPermissions() throws Exception { + ProcessResult pr = server.executeBrowser("/MultipleSignaturesTestUsesPermissions.html", AutoClose.CLOSE_ON_CORRECT_END); + // This calls ReadPropertiesSigned with user.home, it is not easy to think of a pattern to match this + // Instead we make sure _something_ was printed + Assert.assertFalse("stdout should NOT be empty, but was", pr.stdout.isEmpty()); + Assert.assertFalse("stderr should NOT contains `" + accExcString + "`, but did", pr.stderr.contains(accExcString)); + } + + + @Test + public void multipleSignaturesTestJnlpApplication() throws Exception { + ProcessResult pr = server.executeJavawsHeadless("/MultipleSignaturesTest1.jnlp"); + //well this is questionable - application is signed but is not requesting + // permissions, but still usage of foreign code is allowed. + String s = GSJE; + Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); + String cc = "xception"; + Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); + Assert.assertEquals((Integer) 0, pr.returnValue); + } + + @Test + public void multipleSignaturesTestJnlpApplicationRequesting() throws Exception { + // This jar is fully signed - however a JNLP application requires that one of the signers signs everything + ProcessResult pr = server.executeJavawsHeadless("/MultipleSignaturesTest1_requesting.jnlp"); + String s = GSJE; + Assert.assertFalse("stdout should NOT contain `" + s + "`, but did", pr.stdout.contains(s)); + Assert.assertTrue("stderr should contain `" + launchExcDiffCerts + "`, but did not", pr.stderr.contains(launchExcDiffCerts)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp 2013-05-03 19:08:24.781513448 +0000 @@ -0,0 +1,54 @@ + + + + + MultipleSignaturesTest1_SamePackage + IcedTea + + MultipleSignaturesTest1_SamePackage + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp 2013-05-03 19:08:24.783513423 +0000 @@ -0,0 +1,57 @@ + + + + + MultipleSignaturesTest1_SamePackage + IcedTea + + MultipleSignaturesTest1_SamePackage + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp 2013-05-03 19:08:24.784513410 +0000 @@ -0,0 +1,59 @@ + + + + + MultipleSignaturesTest2_SamePackage + IcedTea + + MultipleSignaturesTest2_SamePackage + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html 2013-05-03 19:08:24.784513410 +0000 @@ -0,0 +1,42 @@ + + +

    +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java 2013-05-03 19:08:24.785513397 +0000 @@ -0,0 +1,88 @@ +import java.applet.Applet; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +/* MultipleSignaturesTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +public class MultipleSignaturesTestSamePackage extends Applet { + + public static void main(String[] args) { + executeForeignMethodCaught(); + } + + public static void executeForeignMethodCaught() { + try { + executeForeignMethod(); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + public static void executeForeignMethod() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException { + Class clazz = Class.forName("SimpletestSigned1"); + Method mainMethod = clazz.getDeclaredMethod("main", String[].class); + mainMethod.invoke(clazz.newInstance(), (Object) null); + } + + private static class Killer extends Thread { + + public static final int n = 2000; + + @Override + public void run() { + try { + Thread.sleep(n); + System.out.println("Applet killing himself after " + n + " ms of life"); + System.exit(0); + } catch (Exception ex) { + } + } + } + private Killer killer; + + @Override + public void init() { + killer = new Killer(); + } + + @Override + public void start() { + killer.start(); + System.out.println("killer was started"); + main(null); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java --- icedtea-web-1.3.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java 2013-05-03 19:08:24.785513397 +0000 @@ -0,0 +1,109 @@ +/* MultipleSignaturesTestTests.java +Copyright (C) 20121 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.util.Arrays; +import java.util.List; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import org.junit.Assert; + +import org.junit.Test; + +public class MultipleSignaturesTestTestsSamePackage extends BrowserTest{ + + public static final String secExcRegex = "(?s).*java.lang.SecurityException: .* signer information does not match signer information of other classes in the same package.*"; + public static final String launchExcDiffCerts = "Fatal: Application Error: The JNLP application is not fully signed by a single cert."; + public static final List v = Arrays.asList(new String[] {ServerAccess.VERBOSE_OPTION}); + private static final String GSJE= "Good simple javaws exapmle"; + + @Test + @NeedsDisplay + public void multipleSignaturesTestSamePackageJnlpApplet() throws Exception { + ProcessResult pr = server.executeJavaws(v,"/MultipleSignaturesTest2_SamePackage.jnlp"); + String s = GSJE; + Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s)); + String ss = "killer was started"; + Assert.assertTrue("stdout should contains `"+ss+"`, but did not",pr.stdout.contains(ss)); + String sss="Applet killing himself after 2000 ms of life"; + Assert.assertTrue("stdout should contains `"+sss+"`, but did not",pr.stdout.contains(sss)); +//Applet in jnlp have exception consumed even in verbose mode. Howevwer at least foreign method is not invoken +// String cc = "xception"; +// Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc)); +// Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex)); + } + + @Test + @NeedsDisplay + @TestInBrowsers(testIn=Browsers.one) + public void multipleSignaturesTestSamePackageHtmlApplet() throws Exception { + ProcessResult pr = server.executeBrowser("/MultipleSignaturesTest_SamePackage.html"); + String s = GSJE; + Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s)); + String cc = "xception"; + Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc)); + Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex)); + String ss = "killer was started"; + Assert.assertTrue("stdout should contains `"+ss+"`, but did not",pr.stdout.contains(ss)); + String sss="Applet killing himself after 2000 ms of life"; + Assert.assertTrue("stdout should contains `"+sss+"`, but did not",pr.stdout.contains(sss)); + } + + + @Test + public void multipleSignaturesTestSamePackageJnlpApplication() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1_SamePackage.jnlp"); + String s = GSJE; + Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s)); + String cc = "xception"; + Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc)); + Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex)); + } + + @Test + public void multipleSignaturesTestSamePackageJnlpApplicationRequesting() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1_SamePackage_requesting.jnlp"); + String s = GSJE; + Assert.assertFalse("stdout should NOT contain `"+s+"`, but did", pr.stdout.contains(s)); + Assert.assertTrue("stderr should contain `" + launchExcDiffCerts + "`, but did not", pr.stderr.contains(launchExcDiffCerts)); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html --- icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html 2013-05-03 19:08:24.790513333 +0000 @@ -0,0 +1,42 @@ + + +

    +

    + + \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html --- icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html 2013-05-03 19:08:24.791513321 +0000 @@ -0,0 +1,42 @@ + + +

    +

    + + \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java --- icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java 2013-04-10 11:40:24.010668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java 2013-05-03 19:08:24.791513321 +0000 @@ -1,48 +1,57 @@ + +import java.applet.Applet; + /* AddShutdownHook.java -Copyright (C) 2011 Red Hat, Inc. + Copyright (C) 2011 Red Hat, Inc. -This file is part of IcedTea. + This file is part of IcedTea. -IcedTea is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 2. - -IcedTea 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 for more details. - -You should have received a copy of the GNU General Public License -along with IcedTea; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ +public class AddShutdownHook extends Applet { -public class AddShutdownHook { public static void main(String[] args) { - Runtime.getRuntime().addShutdownHook(new Thread() { - public void run() { - // no op - } - }); - + Runtime.getRuntime().addShutdownHook(new Thread() { + public void run() { + // no op + } + }); + + } + + @Override + public void start() { + main(null); + System.err.println("WRONG - ShutdownHook was probably added"); } } diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java 2013-04-10 11:40:24.010668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java 2013-05-03 19:08:24.792513309 +0000 @@ -1,58 +1,82 @@ /* AddShutdownHookTest.java -Copyright (C) 2011 Red Hat, Inc. + Copyright (C) 2011 Red Hat, Inc. -This file is part of IcedTea. + This file is part of IcedTea. -IcedTea is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 2. - -IcedTea 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 for more details. - -You should have received a copy of the GNU General Public License -along with IcedTea; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ -import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.ClosingListener; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; +import net.sourceforge.jnlp.closinglisteners.StringMatchClosingListener; import org.junit.Assert; import org.junit.Test; -public class AddShutdownHookTest { +public class AddShutdownHookTest extends BrowserTest { - private static ServerAccess server = new ServerAccess(); + public static final String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + ".*"; + public static final String cnfString = "ClassNotFoundException"; + public static final String confirmFailure = "WRONG - ShutdownHook was probably added"; + public static final RulesFolowingClosingListener.MatchesRule mr = new RulesFolowingClosingListener.MatchesRule(s); + public static final RulesFolowingClosingListener.ContainsRule cnf = new RulesFolowingClosingListener.ContainsRule(cnfString); + public static final RulesFolowingClosingListener.ContainsRule cf = new RulesFolowingClosingListener.ContainsRule(confirmFailure); + public static final RulesFolowingClosingListener rfc = new RulesFolowingClosingListener(mr); @Test public void AddShutdownHookTestLunch1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp"); - String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + ".*"; - Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); - String cc="ClassNotFoundException"; - Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); - Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2); - Assert.assertFalse("AddShutdownHookTestLunch1 should not be terminated, but was",pr.wasTerminated); + ProcessResult pr = server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp"); + Assert.assertTrue("stderr " + mr.toPassingString(), mr.evaluate(pr.stderr)); + Assert.assertFalse("stderr " + cnf.toFailingString(), cnf.evaluate(pr.stderr)); + Assert.assertFalse("stdout length should be <=2, but was " + pr.stdout.length(), pr.stdout.length() > 2); + Assert.assertFalse("AddShutdownHookTestLunch1 should not be terminated, but was", pr.wasTerminated); + Assert.assertFalse("stderr " + cf.toFailingString(), cf.evaluate(pr.stderr)); Assert.assertEquals((Integer) 0, pr.returnValue); } + + @Test + @TestInBrowsers(testIn = Browsers.one) + public void AddShutdownHookApplet() throws Exception { + ProcessResult pr = server.executeBrowser("/AddShutdownHook.html", null, rfc); + + if (server.getCurrentBrowsers() == Browsers.firefox) { + //lookslike only firefox is able to recieve this + Assert.assertTrue("stderr " + mr.toPassingString(), mr.evaluate(pr.stderr)); + } + Assert.assertFalse("stderr " + cnf.toFailingString(), cnf.evaluate(pr.stderr)); + Assert.assertFalse("stderr " + cf.toFailingString(), cf.evaluate(pr.stderr)); + } } diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java --- icedtea-web-1.3.2/tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java 2013-05-03 19:08:24.792513309 +0000 @@ -0,0 +1,124 @@ +/* AddShutdownHookTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; +import org.junit.Assert; + +import org.junit.Test; + +/** + +If this test has failed, you may try the following to reproduce the problem more consistently: + +- private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 4; +- private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 2; ++ private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 2; ++ private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 1; + +in PluginMessageConsumer.java + + +*/ +public class HangFirefoxTests extends BrowserTest { + + String leString = "LaunchException"; + ; + String startedString = "applet was started"; + RulesFolowingClosingListener.ContainsRule leRule = new RulesFolowingClosingListener.ContainsRule(leString); + RulesFolowingClosingListener.ContainsRule appleStartedRule = new RulesFolowingClosingListener.ContainsRule(startedString); + + @Test + @TestInBrowsers(testIn = Browsers.firefox) + public void HangFirefoxWithRuntimeExceptionTests() throws Exception { + ProcessResult pr = server.executeBrowser("/AddShutdownHook.html", new RulesFolowingClosingListener(appleStartedRule), new CountingClosingListener() { + private boolean launched = false; + + @Override + protected boolean isAlowedToFinish(String content) { + if (AddShutdownHookTest.mr.evaluate(content) && !launched) { + launched = true; + try { + server.executeBrowser("/appletAutoTests2.html", null, (CountingClosingListener) null); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + return false; + } + }); + Assert.assertTrue("stderr " + AddShutdownHookTest.mr.toPassingString(), AddShutdownHookTest.mr.evaluate(pr.stderr)); + Assert.assertTrue("stdout " + appleStartedRule.toPassingString(), appleStartedRule.evaluate(pr.stdout)); + Assert.assertFalse("stderr " + AddShutdownHookTest.cnf.toFailingString(), AddShutdownHookTest.cnf.evaluate(pr.stderr)); + } + + @Test + @TestInBrowsers(testIn = Browsers.firefox) + public void HangFirefoxWithLaunchException() throws Exception { + ProcessResult pr = server.executeBrowser("/AddShutdownHook_wrong.html", new RulesFolowingClosingListener(appleStartedRule), new CountingClosingListener() { + private boolean launched = false; + + @Override + protected boolean isAlowedToFinish(String content) { + if (leRule.evaluate(content) && !launched) { + launched = true; + try { + server.executeBrowser("/appletAutoTests2.html", null, (CountingClosingListener) null); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + return false; + } + }); + Assert.assertTrue("stderr " + leRule.toPassingString(), leRule.evaluate(pr.stderr)); + Assert.assertTrue("stdout " + appleStartedRule.toPassingString(), appleStartedRule.evaluate(pr.stdout)); + Assert.assertFalse("stderr " + AddShutdownHookTest.cnf.toFailingString(), AddShutdownHookTest.cnf.evaluate(pr.stderr)); + } + + @Test + @TestInBrowsers(testIn = Browsers.one) + public void TestAddShutdownHookWrong() throws Exception { + ProcessResult pr = server.executeBrowser("/AddShutdownHook_wrong.html", null, new RulesFolowingClosingListener(leRule)); + Assert.assertTrue("stderr " + leRule.toPassingString(), leRule.evaluate(pr.stderr)); + Assert.assertFalse("stderr " + AddShutdownHookTest.cnf.toFailingString(), AddShutdownHookTest.cnf.evaluate(pr.stderr)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletBaseURLTest/srcs/AppletBaseURL.java icedtea-web-1.4/tests/reproducers/simple/AppletBaseURLTest/srcs/AppletBaseURL.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletBaseURLTest/srcs/AppletBaseURL.java 2013-04-10 11:40:24.012668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletBaseURLTest/srcs/AppletBaseURL.java 2013-05-03 19:08:24.795513270 +0000 @@ -37,28 +37,13 @@ import java.applet.Applet; public class AppletBaseURL extends Applet { - - private class Killer extends Thread { - - public int n = 1000; - - @Override - public void run() { - try { - Thread.sleep(n); - System.out.println("Aplet killing himself after " + n + " ms of life"); - System.exit(0); - } catch (Exception ex) { - } - } - } - private Killer killer; - @Override public void init() { System.out.println("Document base is " + getDocumentBase() + " for this applet"); System.out.println("Codebase is " + getCodeBase() + " for this applet"); - killer = new Killer(); - killer.start(); + System.out.println("*** APPLET FINISHED ***"); + + // Exits JNLP-launched applets, throws exception on normal applet: + System.exit(0); } } diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletBaseURLTest/testcases/AppletBaseURLTest.java icedtea-web-1.4/tests/reproducers/simple/AppletBaseURLTest/testcases/AppletBaseURLTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletBaseURLTest/testcases/AppletBaseURLTest.java 2013-04-10 11:40:24.013668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletBaseURLTest/testcases/AppletBaseURLTest.java 2013-05-03 19:08:24.795513270 +0000 @@ -35,7 +35,8 @@ exception statement from your version. */ -import net.sourceforge.jnlp.ServerAccess.ProcessResult; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -48,18 +49,18 @@ public class AppletBaseURLTest extends BrowserTest{ private void evaluateApplet(ProcessResult pr, String baseName) { - String s8 = "(?s).*Codebase is http://localhost:[0-9]{5}/ for this applet(?s).*"; - Assert.assertTrue("AppletBaseURL stdout should match" + s8 + " but didn't", pr.stdout.matches(s8)); - String s9 = "(?s).*Document base is http://localhost:[0-9]{5}/" + baseName + " for this applet(?s).*"; - Assert.assertTrue("AppletBaseURL stdout should match" + s9 + " but didn't", pr.stdout.matches(s9)); - String ss = "xception"; - Assert.assertFalse("AppletBaseURL stderr should not contain" + ss + " but did", pr.stderr.contains(ss)); + String codebaseRule = "(?s).*Codebase is http://localhost:[0-9]{5}/ for this applet(?s).*"; + Assert.assertTrue("AppletBaseURL stdout should match" + codebaseRule + " but didn't", + pr.stdout.matches(codebaseRule)); + String documentbaseRule = "(?s).*Document base is http://localhost:[0-9]{5}/" + baseName + " for this applet(?s).*"; + Assert.assertTrue("AppletBaseURL stdout should match" + documentbaseRule + " but didn't", + pr.stdout.matches(documentbaseRule)); } @NeedsDisplay @Test public void AppletWebstartBaseURLTest() throws Exception { - ProcessResult pr = server.executeJavaws(null, "/AppletBaseURLTest.jnlp"); + ProcessResult pr = server.executeJavaws("/AppletBaseURLTest.jnlp"); evaluateApplet(pr, ""); Assert.assertFalse(pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); @@ -70,7 +71,7 @@ @Test @TestInBrowsers(testIn={Browsers.one}) public void AppletInFirefoxTest() throws Exception { - ProcessResult pr = server.executeBrowser("/AppletBaseURLTest.html"); + ProcessResult pr = server.executeBrowser("/AppletBaseURLTest.html", AutoClose.CLOSE_ON_BOTH); pr.process.destroy(); evaluateApplet(pr, "AppletBaseURLTest.html"); Assert.assertTrue(pr.wasTerminated); @@ -81,7 +82,7 @@ @Test @TestInBrowsers(testIn={Browsers.one}) public void AppletWithJNLPHrefTest() throws Exception { - ProcessResult pr = server.executeBrowser("/AppletJNLPHrefBaseURLTest.html"); + ProcessResult pr = server.executeBrowser("/AppletJNLPHrefBaseURLTest.html", AutoClose.CLOSE_ON_BOTH); pr.process.destroy(); evaluateApplet(pr, "AppletJNLPHrefBaseURLTest.html"); Assert.assertTrue(pr.wasTerminated); diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_dotCodeBaseTest.java icedtea-web-1.4/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_dotCodeBaseTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_dotCodeBaseTest.java 2013-04-11 15:38:41.250179000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_dotCodeBaseTest.java 2013-05-03 19:08:24.805513145 +0000 @@ -39,8 +39,8 @@ import java.io.IOException; import java.net.URL; import java.util.ArrayList; -import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.annotations.Bug; @@ -48,6 +48,9 @@ import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; +import net.sourceforge.jnlp.closinglisteners.Rule; +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; @@ -60,97 +63,64 @@ private static String reaadOneKeyword = readingKeyword + " 1 X"; public static final String writingKeyword = "Writing"; public static final String unknownKeyword = "Unknown destiny"; - public static final ReadShared readShared = new ReadShared(); - public static final WriteShared writeShared = new WriteShared(); - public static final TooMuchReading tooMuchReading = new TooMuchReading(); - - public static class Matcher { - - protected String s; - - public Matcher(String s) { - this.s = s; - } - - public boolean evaluate(String where) { - return where.matches(s); - } - - public String toPassingString() { - return "should match" + s + " but have not"; - } - - public String toFailingString() { - return "should not match" + s + " but have " + reaadOneKeyword; - } - } - - public static class ReadShared extends Matcher { - - public ReadShared() { - super("(?s).*" + readingKeyword + "\\s+[1-9][0-9]+\\sX.*"); - } - } - - public static class WriteShared extends Matcher { + public static final RulesFolowingClosingListener.MatchesRule readShared = new RulesFolowingClosingListener.MatchesRule("(?s).*" + readingKeyword + "\\s+[1-9][0-9]+\\sX.*"); + public static final RulesFolowingClosingListener.MatchesRule writeShared = new RulesFolowingClosingListener.MatchesRule("(?s).*" + writingKeyword + "\\s+[1-9][0-9]+\\sX.*"); + public static final Rule tooMuchReading = new Rule() { + public static final int countsToBelieve = 5; - public WriteShared() { - super("(?s).*" + writingKeyword + "\\s+[1-9][0-9]+\\sX.*"); + @Override + public void setRule(Object rule) { + //noop } - } - - public static class TooMuchReading { - - public static final int countsToBelieve = 5; + @Override public boolean evaluate(String upon) { return countStrings(upon) > countsToBelieve; } + @Override public String toPassingString() { return "should contain at least" + countsToBelieve + " occurences of: " + reaadOneKeyword; } + @Override public String toFailingString() { return "should contain no more than " + countsToBelieve + " occurences of: " + reaadOneKeyword; } }; - public static class UrlLaunchingListener implements net.sourceforge.jnlp.ContentReaderListener { + public static class UrlLaunchingListener extends net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener { - StringBuilder sb = new StringBuilder(); private final URL url; private boolean launched = false; public UrlLaunchingListener(URL url) { + super(writeShared); this.url = url; } - protected void isAlowedToFinish(String content) { - if (!launched) { + @Override + protected boolean isAlowedToFinish(String content) { + boolean b = super.isAlowedToFinish(content); + if (b && !launched) { launched = true; try { //should imidately return because browser is running, if not, launch ins another thread - ServerAccess.executeProcessUponURL(server.getBrowserLocation(),server.getBrowserParams(), url); + ProcessWrapper pw = new ProcessWrapper(server.getBrowserLocation(), + new ArrayList(), + url); + pw.execute(); } catch (Exception ex) { throw new RuntimeException(ex); } } - } - - @Override - public void charReaded(char ch) { - sb.append(ch); - isAlowedToFinish(sb.toString()); - } - - @Override - public void lineReaded(String s) { - //no op + return readShared.evaluate(content)/*ok*/ || tooMuchReading.evaluate(content)/*not ok*/; } } + public static final String dotCodeBaseSuffix = ""; - public static final String dotCodeBaseFileSuffix = dotCodeBaseSuffix + ".html"; + public static final String dotCodeBaseFileSuffix = dotCodeBaseSuffix+".html"; + //names of used resources public static final String namePrefix = "LaunchSharedClassLoaderApplet-"; public static final String namePrefix2 = "LaunchSharedClassLoaderApplet2-"; @@ -172,7 +142,7 @@ @BeforeClass public static void createAlternativeArchive() throws IOException { - SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.copyFile(new File(server.getDir(), jar1), new File(server.getDir(), jar2)); + FirefoxProfilesOperator.copyFile(new File(server.getDir(), jar1), new File(server.getDir(), jar2)); } @@ -186,8 +156,8 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAll_onePage() throws Exception { - ProcessResult pr = server.executeBrowser(r1w1 + dotCodeBaseFileSuffix); - assertSharedLoader(pr, false); + ProcessResult pr = server.executeBrowser(r1w1 + dotCodeBaseFileSuffix, new RulesFolowingClosingListener(readShared), null); + assertSharedLoader(pr,false); } @@ -196,8 +166,8 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMain_OnePage() throws Exception { - ProcessResult pr = server.executeBrowser(r1w2 + dotCodeBaseFileSuffix); - assertSharedLoader(pr, false); + ProcessResult pr = server.executeBrowser(r1w2 + dotCodeBaseFileSuffix, new RulesFolowingClosingListener(readShared), null); + assertSharedLoader(pr,false); } @TestInBrowsers(testIn = {Browsers.one}) @@ -206,7 +176,7 @@ @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1 + dotCodeBaseFileSuffix, new UrlLaunchingListener(server.getUrl(r1 + dotCodeBaseFileSuffix)), null); - assertSharedLoader(pr, true); + assertSharedLoader(pr,true); } @@ -216,14 +186,14 @@ @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1 + dotCodeBaseFileSuffix, new UrlLaunchingListener(server.getUrl(r2 + dotCodeBaseFileSuffix)), null); - assertSharedLoader(pr, true); + assertSharedLoader(pr,true); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test - @Bug(id = "RH916774") + //codebase seems to be compared by dots only public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1 + dotCodeBaseFileSuffix, new UrlLaunchingListener(secondServer.getUrl(r1 + dotCodeBaseFileSuffix)), null); assertNotSharedLoader(pr); @@ -233,7 +203,7 @@ @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test - @Bug(id = "RH916774") + //codebase seems to be compared by dots only public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseCodeBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1 + dotCodeBaseFileSuffix, new UrlLaunchingListener(secondServer.getUrl(r2 + dotCodeBaseFileSuffix)), null); assertNotSharedLoader(pr); @@ -261,7 +231,7 @@ return count; } - public static void assertSharedLoader(ProcessResult pr, boolean twoSyncPages) { + public static void assertSharedLoader(ProcessResult pr, boolean twoSyncPages) { Assert.assertFalse("stdout must not contains " + unknownKeyword, pr.stdout.contains(unknownKeyword)); Assert.assertTrue("stdout " + readShared.toPassingString(), readShared.evaluate(pr.stdout)); Assert.assertTrue("stdout " + writeShared.toPassingString(), writeShared.evaluate(pr.stdout)); @@ -284,7 +254,7 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButArchives_onePage() throws Exception { - ProcessResult pr = server.executeBrowser(r1w1_2 + dotCodeBaseFileSuffix); + ProcessResult pr = server.executeBrowser(r1w1_2 + dotCodeBaseFileSuffix, new RulesFolowingClosingListener(readShared), null); assertNotSharedLoader(pr); } @@ -294,7 +264,7 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMainAndArchives_OnePage() throws Exception { - ProcessResult pr = server.executeBrowser(r1w2_2 + dotCodeBaseFileSuffix); + ProcessResult pr = server.executeBrowser(r1w2_2 + dotCodeBaseFileSuffix, new RulesFolowingClosingListener(readShared), null); assertNotSharedLoader(pr); } @@ -303,7 +273,7 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndArchives_twoPages() throws Exception { - ProcessResult pr = server.executeBrowser(w1_2 + dotCodeBaseFileSuffix, new UrlLaunchingListener(server.getUrl(r1 + dotCodeBaseFileSuffix)), null); + ProcessResult pr = server.executeBrowser(w1_2 + dotCodeBaseFileSuffix,new UrlLaunchingListener(server.getUrl(r1 + dotCodeBaseFileSuffix)), null); assertNotSharedLoader(pr); } diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.java icedtea-web-1.4/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.java 2013-04-11 13:58:53.194089000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.java 2013-05-03 19:08:24.804513157 +0000 @@ -37,9 +37,7 @@ import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.nio.channels.FileChannel; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; @@ -48,7 +46,8 @@ import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; - +import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -61,7 +60,7 @@ }; private static final ServerLauncher secondServer = ServerAccess.getIndependentInstance(); private static final String writtenCodeBaseSuffix = "_WCB"; - private static final String writtenCodeBaseServer2Suffix = writtenCodeBaseSuffix + "_2"; + private static final String writtenCodeBaseServer2Suffix =writtenCodeBaseSuffix+"_2"; private static final String writtenCodeBaseFileSuffix = writtenCodeBaseSuffix + ".html"; private static final String writtenCodeBaseFileServer2Suffix = writtenCodeBaseServer2Suffix + ".html"; public static final String[] originalNames = new String[]{ @@ -78,22 +77,9 @@ X.r2_2, X.w2_2}; - public static void copyFile(File from, File to) throws IOException { - FileInputStream is = new FileInputStream(from); - FileOutputStream fos = new FileOutputStream(to); - FileChannel f = is.getChannel(); - FileChannel f2 = fos.getChannel(); - try { - f.transferTo(0, f.size(), f2); - } finally { - f2.close(); - f.close(); - } - } - @BeforeClass public static void createAlternativeArchive() throws IOException { - copyFile(new File(server.getDir(), X.jar1), new File(server.getDir(), X.jar2)); + FirefoxProfilesOperator.copyFile(new File(server.getDir(), X.jar1), new File(server.getDir(), X.jar2)); } @@ -101,12 +87,12 @@ public static void prepareFakeFiles() throws IOException { for (int i = 0; i < originalNames.length; i++) { String string = originalNames[i]; - String content = ServerAccess.getContentOfStream(new FileInputStream(new File(server.getDir(), string + X.dotCodeBaseFileSuffix)), "utf-8"); - String content1 = content.replaceAll("codebase=\"\\.\"", "codebase=\"" + server.getUrl("") + "\""); - ServerAccess.saveFile(content1, new File(server.getDir(), string + writtenCodeBaseFileSuffix)); - if (string.equals(X.r1) || string.equals(X.r2)) { - String content2 = content.replaceAll("codebase=\"\\.\"", "codebase=\"" + secondServer.getUrl() + "\""); - ServerAccess.saveFile(content2, new File(server.getDir(), string + writtenCodeBaseFileServer2Suffix)); + String content = ServerAccess.getContentOfStream(new FileInputStream(new File(server.getDir(),string+X.dotCodeBaseFileSuffix)), "utf-8"); + String content1=content.replaceAll("codebase=\"\\.\"", "codebase=\""+server.getUrl("") +"\""); + ServerAccess.saveFile(content1, new File(server.getDir(),string+writtenCodeBaseFileSuffix)); + if (string.equals(X.r1) || string.equals(X.r2)){ + String content2=content.replaceAll("codebase=\"\\.\"", "codebase=\""+secondServer.getUrl() +"\""); + ServerAccess.saveFile(content2, new File(server.getDir(),string+writtenCodeBaseFileServer2Suffix)); } } } @@ -115,14 +101,14 @@ public static void stopSecondServer() { secondServer.stop(); } - + @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAll_onePage() throws Exception { - ProcessResult pr = server.executeBrowser(X.r1w1 + writtenCodeBaseFileSuffix); - X.assertSharedLoader(pr, false); + ProcessResult pr = server.executeBrowser(X.r1w1 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); + X.assertSharedLoader(pr,false); } @@ -131,8 +117,8 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMain_OnePage() throws Exception { - ProcessResult pr = server.executeBrowser(X.r1w2 + writtenCodeBaseFileSuffix); - X.assertSharedLoader(pr, false); + ProcessResult pr = server.executeBrowser(X.r1w2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); + X.assertSharedLoader(pr,false); } @TestInBrowsers(testIn = {Browsers.one}) @@ -141,7 +127,7 @@ @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); - X.assertSharedLoader(pr, true); + X.assertSharedLoader(pr,true); } @@ -151,7 +137,7 @@ @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r2 + writtenCodeBaseFileSuffix)), null); - X.assertSharedLoader(pr, true); + X.assertSharedLoader(pr,true); } @@ -160,7 +146,7 @@ @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r1 + writtenCodeBaseFileServer2Suffix)), null); - X.assertNotSharedLoader(pr); + X.assertNotSharedLoader(pr); } @@ -178,7 +164,7 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButArchives_onePage() throws Exception { - ProcessResult pr = server.executeBrowser(X.r1w1_2 + writtenCodeBaseFileSuffix); + ProcessResult pr = server.executeBrowser(X.r1w1_2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertNotSharedLoader(pr); } @@ -188,16 +174,16 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMainAndArchives_OnePage() throws Exception { - ProcessResult pr = server.executeBrowser(X.r1w2_2 + writtenCodeBaseFileSuffix); + ProcessResult pr = server.executeBrowser(X.r1w2_2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertNotSharedLoader(pr); } - @TestInBrowsers(testIn = {Browsers.one}) + @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndArchives_twoPages() throws Exception { - ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); + ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix,new X.UrlLaunchingListener(server.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); } @@ -217,7 +203,7 @@ @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBaseAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r1 + writtenCodeBaseFileServer2Suffix)), null); - X.assertNotSharedLoader(pr); + X.assertNotSharedLoader(pr); } diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenPartialStubCodeBaseTest.java icedtea-web-1.4/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenPartialStubCodeBaseTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenPartialStubCodeBaseTest.java 2013-04-11 14:11:20.759100000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenPartialStubCodeBaseTest.java 2013-05-03 19:08:24.804513157 +0000 @@ -46,6 +46,8 @@ import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -69,8 +71,9 @@ private static final File subRoot = new File(root, subFolderName); private static final File origJar1 = new File(server.getDir(), X.jar1); private static final File origJar2 = new File(server.getDir(), X.jar2); - private static final String renamedJar1Name = X.jar1 + "XYZ"; - private static final String renamedJar2Name = X.jar2 + "XYZ"; + + private static final String renamedJar1Name=X.jar1+"XYZ"; + private static final String renamedJar2Name=X.jar2+"XYZ"; private static final File renamedJar1 = new File(server.getDir(), renamedJar1Name); private static final File renamedJar2 = new File(server.getDir(), renamedJar2Name); @@ -78,41 +81,41 @@ public static void createAlternativeAndEnsureOriginalArchivesDontExist() throws IOException { if (!subRoot.exists()) { boolean b = subRoot.mkdir(); - if (!b) { - throw new RuntimeException(subRoot.toString() + " was not created"); - } + if (!b){ + throw new RuntimeException(subRoot.toString()+" was not created"); + } } - SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.copyFile(origJar1, new File(subRoot, X.jar1)); - SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.copyFile(origJar1, new File(subRoot, X.jar2)); + FirefoxProfilesOperator.copyFile(origJar1, new File(subRoot, X.jar1)); + FirefoxProfilesOperator.copyFile(origJar1, new File(subRoot, X.jar2)); //origJar2 is actually created by SharedClassLoaderApplet_dotCodeBaseTestcreateAlternativeArchive //so it do not need to exists - if (origJar2.exists()) { - boolean b = origJar2.renameTo(renamedJar2); + if (origJar2.exists()){ + boolean b = origJar2.renameTo(renamedJar2); if (!b) { - throw new RuntimeException(origJar2.toString() + " was not renamed"); + throw new RuntimeException(origJar2.toString()+" was not renamed"); } } - boolean b = origJar1.renameTo(renamedJar1); + boolean b = origJar1.renameTo(renamedJar1); if (!b) { - throw new RuntimeException(origJar1.toString() + " was not renamed"); + throw new RuntimeException(origJar1.toString()+" was not renamed"); } - + } - + @AfterClass - public static void restoreRenamedJars() { - if (renamedJar2.exists()) { - boolean b = renamedJar2.renameTo(origJar2); - if (!b) { - throw new RuntimeException(renamedJar2.toString() + " was not renamed"); - } + public static void restoreRenamedJars(){ + if (renamedJar2.exists()){ + boolean b = renamedJar2.renameTo(origJar2); + if (!b){ + throw new RuntimeException(renamedJar2.toString()+" was not renamed"); + } } - boolean b = renamedJar1.renameTo(origJar1); + boolean b = renamedJar1.renameTo(origJar1); if (!b) { - throw new RuntimeException(renamedJar1.toString() + " was not renamed"); - } - + throw new RuntimeException(renamedJar1.toString()+" was not renamed"); + } + } @BeforeClass @@ -137,7 +140,7 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAll_onePage() throws Exception { - ProcessResult pr = server.executeBrowser(X.r1w1 + writtenCodeBaseFileSuffix); + ProcessResult pr = server.executeBrowser(X.r1w1 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertSharedLoader(pr, false); } @@ -147,7 +150,7 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMain_OnePage() throws Exception { - ProcessResult pr = server.executeBrowser(X.r1w2 + writtenCodeBaseFileSuffix); + ProcessResult pr = server.executeBrowser(X.r1w2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertSharedLoader(pr, false); } @@ -174,7 +177,6 @@ @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test - @Bug(id = "RH916774") public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); @@ -184,7 +186,6 @@ @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test - @Bug(id = "RH916774") public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseCodeBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r2 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); @@ -196,7 +197,7 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButArchives_onePage() throws Exception { - ProcessResult pr = server.executeBrowser(X.r1w1_2 + writtenCodeBaseFileSuffix); + ProcessResult pr = server.executeBrowser(X.r1w1_2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertNotSharedLoader(pr); } @@ -206,7 +207,7 @@ @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMainAndArchives_OnePage() throws Exception { - ProcessResult pr = server.executeBrowser(X.r1w2_2 + writtenCodeBaseFileSuffix); + ProcessResult pr = server.executeBrowser(X.r1w2_2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertNotSharedLoader(pr); } diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp icedtea-web-1.4/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp 2013-05-03 19:08:24.805513145 +0000 @@ -0,0 +1,57 @@ + + + + + AppletJnlpWithMainClass + IcedTea + + AppletJnlpWithMainClass + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html icedtea-web-1.4/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html --- icedtea-web-1.3.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html 2013-05-03 19:08:24.806513133 +0000 @@ -0,0 +1,44 @@ + + +

    + + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java icedtea-web-1.4/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java 2013-05-03 19:08:24.806513133 +0000 @@ -0,0 +1,57 @@ +/* AppletTagWithMissingCodeAttribute.java + Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +import junit.framework.Assert; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Test; + +public class AppletTagWithMissingCodeAttribute extends BrowserTest { + + final static String closingString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; + + @Test + @TestInBrowsers(testIn = { Browsers.firefox }) + public void EmbeddedAppletWithMissingCodeAttribute() throws Exception { + ProcessResult pr = server.executeBrowser("/AppletTagWithMissingCodeAttribute.html", AutoClose.CLOSE_ON_CORRECT_END); + Assert.assertTrue("Stdout should contain " + closingString + " but did not", pr.stdout.contains(closingString)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java icedtea-web-1.4/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java 2013-04-10 11:40:24.015668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java 2013-05-03 19:08:24.807513120 +0000 @@ -38,26 +38,11 @@ exception statement from your version. */ public class AppletTakesLastParam extends Applet { - - private class Killer extends Thread { - - public int n = 2000; - - @Override - public void run() { - try { - Thread.sleep(n); - System.out.println("Applet killing itself after " + n + " ms"); - System.exit(0); - } catch (Exception ex) { - } - } - } - private Killer killer = new Killer(); - - @Override public void init() { System.out.println(getParameter("param")); - killer.start(); + System.out.println("*** APPLET FINISHED ***"); + + // Exits JNLP-launched applets, throws exception on normal applet: + System.exit(0); } } diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java icedtea-web-1.4/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java 2013-04-10 11:40:24.015668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java 2013-05-03 19:08:24.808513107 +0000 @@ -1,4 +1,4 @@ -/* AppletTestTests.java +/* AppletTakesLastParamTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. @@ -35,8 +35,8 @@ exception statement from your version. */ -import net.sourceforge.jnlp.ServerAccess; -import net.sourceforge.jnlp.ServerAccess.ProcessResult; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -45,24 +45,25 @@ import org.junit.Test; public class AppletTakesLastParamTests extends BrowserTest { - - @Test - public void AppletTest() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavaws(null, "/appletTakesLastParam.jnlp"); - evaluateApplet(pr); - } - - private void evaluateApplet(ProcessResult pr) { - String s0 = "value1"; - Assert.assertTrue("AppletTakesLastParam stdout should not contain " + s0 + " but did.", !pr.stdout.contains(s0)); - String s1 = "value2"; - Assert.assertTrue("AppletTakesLastParam stdout should contain " + s1 + " but did not.", pr.stdout.contains(s1)); + private void evaluate(ProcessResult pr) { + String firstParam = "value1"; + String secondParam = "value2"; + + Assert.assertFalse("AppletTakesLastParam stdout should not contain " + firstParam + " but did.", + pr.stdout.contains(firstParam)); + Assert.assertTrue("AppletTakesLastParam stdout should contain " + secondParam + " but did not.", + pr.stdout.contains(secondParam)); } @Test @TestInBrowsers(testIn = {Browsers.one}) - public void AppletInFirefoxTest() throws Exception { - ServerAccess.ProcessResult pr = server.executeBrowser("/appletTakesLastParam.html"); - evaluateApplet(pr); + public void appletTakesLastParam() throws Exception { + ProcessResult pr = server.executeBrowser("/appletTakesLastParam.html", AutoClose.CLOSE_ON_BOTH); + evaluate(pr); + } + @Test + public void jnlpTakesLastParam() throws Exception { + ProcessResult pr = server.executeJavaws("/appletTakesLastParam.jnlp"); + evaluate(pr); } -} +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html icedtea-web-1.4/tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html --- icedtea-web-1.3.2/tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html 2013-05-03 19:08:24.810513081 +0000 @@ -0,0 +1,43 @@ + + +

    + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java icedtea-web-1.4/tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java 2013-05-03 19:08:24.810513081 +0000 @@ -0,0 +1,269 @@ +/* AppletErrorTest.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + * + */ + +import java.applet.Applet; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.GridLayout; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.Random; +import javax.swing.JApplet; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +public class AppletErrorTest extends JApplet { + + private class Killer extends Thread { + + public int n = 20000; + + @Override + public void run() { + try { + Thread.sleep(n); + System.out.println("Error Applet killing himself after " + n + " ms of life"); + System.exit(0); + } catch (Exception ex) { + } + } + } + private volatile boolean waiting = true; + private boolean isApplet = true; + private Killer killer; + private final String IN_GUI_THREAD = "IN_GUI_THREAD"; + private final String BEHIND_GUI_THREAD = "BEHIND_GUI_THREAD"; + private final String IN_GUI = "IN_GUI"; + private final String IN_INIT = "IN_INIT"; + private final String IN_START = "IN_START"; + private final String IN_STOP = "IN_STOP"; + private final String IN_DESTROY = "IN_DESTROY"; + private String levelOfDeath = BEHIND_GUI_THREAD; + + @Override + public void init() { + if (isApplet) { + String s = getParameter("levelOfDeath"); + if (s != null) { + levelOfDeath = s; + } + } + System.out.println("Error applet was initialised"); + killer = new Killer(); + if (levelOfDeath.equals(IN_INIT)) { + throw new RuntimeException("Intentional exception from init"); + } + } + + public static void main(String[] args) { + final JFrame f = new JFrame(); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + f.setSize(899, 600); + f.setLayout(new BorderLayout()); + AppletErrorTest ae = new AppletErrorTest(); + ae.isApplet=false; + ae.init(); + f.add(ae); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + f.setVisible(true); + } + }); + ae.start(); + + + } + + @Override + public void start() { + final AppletErrorTest aSelf = this; + final JPanel self = new JPanel(); + aSelf.setLayout(new BorderLayout()); + aSelf.add(self); + self.setLayout(new GridLayout(0, 4)); + final Random r = new Random(); + new Thread(new Runnable() { + + @Override + public void run() { + new Colorer(self, r).run(); + } + }).start(); + + + System.out.println("Error applet was started"); + killer.start(); + System.out.println("killer was started"); + if (levelOfDeath.equals(IN_GUI_THREAD) || levelOfDeath.equals(IN_GUI) || levelOfDeath.equals(BEHIND_GUI_THREAD)) { + new Thread(new Runnable() { + + @Override + public void run() { + try { + + for (int i = 0; i < 15; i++) { + try { + System.out.println("Rainbow is shining"); + new GuiRainbow(self, r, i).run(); + if (levelOfDeath.equals(BEHIND_GUI_THREAD) && i >= 12) { + throw new RuntimeException("Intentional error from start (gui is running)- " + levelOfDeath); + } + Thread.sleep(200); + } catch (InterruptedException ex) { + throw new RuntimeException(ex); + } + } + } finally { + waiting = false; + } + + + + } + }).start(); + } + if (!isApplet) { + if (levelOfDeath.equals(IN_GUI)) { + while (waiting) { + try { + Thread.sleep(100); + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + aSelf.repaint(); + aSelf.validate(); + aSelf.repaint(); + } + }); + + } catch (InterruptedException ex) { + throw new RuntimeException(ex); + } + } + throw new RuntimeException("Intentional error from start (gui was running)- " + levelOfDeath); + } + } + if (levelOfDeath.equals(IN_START)) { + throw new RuntimeException("Intentional error from start (gui was not running)- " + levelOfDeath); + } + } + + @Override + public void stop() { + System.out.println("Error applet was stopped"); + if (levelOfDeath.equals(IN_STOP)) { + throw new RuntimeException("Intentional exception from stop" + levelOfDeath); + } + } + + @Override + public void destroy() { + System.out.println("Error applet will be destroyed"); + if (levelOfDeath.equals(IN_DESTROY)) { + throw new RuntimeException("Intentional exception from destroy" + levelOfDeath); + } + } + + private class GuiRainbow implements Runnable { + + private final JComponent self; + private final Random r; + private final int i; + + public GuiRainbow(JComponent self, Random r, int i) { + this.self = self; + this.r = r; + this.i = i; + } + + @Override + public void run() { + if (self.getComponentCount() > 1 && r.nextInt(2) == 0) { + int x = r.nextInt(self.getComponentCount()); + self.remove(x); + self.validate(); + } else { + JLabel ll=new JLabel("Hi, its error applet here " + i); + self.add(ll); + self.validate(); + ll.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + throw new RuntimeException("Intentional exception by click to "+i); + } + }); + } + System.out.println("Components are handled"); + if (levelOfDeath.equals(IN_GUI_THREAD) && i >= 8) { + throw new RuntimeException("Intentional error from swing thread (gui is running)- " + levelOfDeath); + } + + } + } + + class Colorer implements Runnable { + + private final JComponent self; + private final Random r; + + public Colorer(JComponent self, Random r) { + this.self = self; + this.r = r; + } + + @Override + public void run() { + int i = 0; + while (true) { + i++; + try { + self.setBackground(new Color(r.nextInt())); + System.out.println("Applet is coloring " + i); + Thread.sleep(200); + } catch (Exception ex) { + //intentionally silenced + } + } + } + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java icedtea-web-1.4/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java --- icedtea-web-1.3.2/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java 2013-04-10 11:40:24.016668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java 2013-05-03 19:08:24.811513069 +0000 @@ -35,6 +35,7 @@ exception statement from your version. */ +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; @@ -47,6 +48,24 @@ public class AppletTestTests extends BrowserTest { + private final String s7 = "Aplet killing himself after 2000 ms of life"; + private final String ss = "xception"; + private final String s2 = "value2"; + private final String s1 = "value1"; + private final String s0 = "applet was started"; + private final String s3 = "applet was initialised"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + if (s.contains(ss)) { + return true; + } + return (s.contains(s0) && s.contains(s1) && s.contains(s2) && s.contains(s3) && s.contains(s7)); + } + } + @Test @TestInBrowsers(testIn = {Browsers.googleChrome}) @NeedsDisplay @@ -55,7 +74,7 @@ try { //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString()); //just verify loging is recording browser - ProcessResult pr1 = server.executeBrowser("/appletAutoTests.html"); + ProcessResult pr1 = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); if (pr1.process == null) { Assert.assertTrue("If proces was null here, then google-chrome had to not exist, and so " + ServerAccess.UNSET_BROWSER @@ -64,12 +83,12 @@ pr1.deadlyException.getMessage().contains(ServerAccess.UNSET_BROWSER)); return; } - evaluateApplet(pr1,false); + evaluateApplet(pr1, false); Assert.assertTrue(pr1.wasTerminated); //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString()); // just verify loging is recording browser - ServerAccess.ProcessResult pr = server.executeBrowser("/appletAutoTests.html"); - evaluateApplet(pr,false); + ServerAccess.ProcessResult pr = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + evaluateApplet(pr, false); Assert.assertTrue(pr.wasTerminated); } finally { ServerAccess.PROCESS_TIMEOUT = 20 * 1000; //back to normal @@ -80,30 +99,24 @@ @NeedsDisplay public void AppletTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/AppletTest.jnlp"); - evaluateApplet(pr,true); + evaluateApplet(pr, true); Assert.assertFalse(pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } private void evaluateApplet(ProcessResult pr, boolean javawsApplet) { - String s3 = "applet was initialised"; Assert.assertTrue("AppletTest stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3)); - String s0 = "applet was started"; Assert.assertTrue("AppletTest stdout should contains " + s0 + " bud didn't", pr.stdout.contains(s0)); - String s1 = "value1"; Assert.assertTrue("AppletTest stdout should contains " + s1 + " bud didn't", pr.stdout.contains(s1)); - String s2 = "value2"; Assert.assertTrue("AppletTest stdout should contains " + s2 + " bud didn't", pr.stdout.contains(s2)); - String ss = "xception"; Assert.assertFalse("AppletTest stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); - String s7 = "Aplet killing himself after 2000 ms of life"; Assert.assertTrue("AppletTest stdout should contains " + s7 + " bud didn't", pr.stdout.contains(s7)); if (!javawsApplet) { /*this is working correctly in most browser, but not in all. temporarily disabling - String s4 = "applet was stopped"; - Assert.assertTrue("AppletTest stdout should contains " + s4 + " bud did't", pr.stdout.contains(s4)); - String s5 = "applet will be destroyed"; - Assert.assertTrue("AppletTest stdout should contains " + s5 + " bud did't", pr.stdout.contains(s5)); + String s4 = "applet was stopped"; + Assert.assertTrue("AppletTest stdout should contain " + s4 + " bud did't", pr.stdout.contains(s4)); + String s5 = "applet will be destroyed"; + Assert.assertTrue("AppletTest stdout should contain " + s5 + " bud did't", pr.stdout.contains(s5)); */ } } @@ -116,9 +129,9 @@ //just verify loging is recordingb rowser ServerAccess.PROCESS_TIMEOUT = 30 * 1000; try { - ProcessResult pr = server.executeBrowser("/appletAutoTests2.html"); - evaluateApplet(pr,false); - Assert.assertTrue(pr.wasTerminated); + ProcessResult pr = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + evaluateApplet(pr, false); + //Assert.assertTrue(pr.wasTerminated); this checks asre evil //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null } finally { ServerAccess.PROCESS_TIMEOUT = 20 * 1000; //back to normal @@ -132,9 +145,9 @@ //just verify loging is recording browser ServerAccess.PROCESS_TIMEOUT = 30 * 1000; try { - ProcessResult pr = server.executeBrowser("/appletAutoTests.html"); + ProcessResult pr = server.executeBrowser("/appletAutoTests.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); pr.process.destroy(); - evaluateApplet(pr,false); + evaluateApplet(pr, false); Assert.assertTrue(pr.wasTerminated); //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null } finally { Binary files /tmp/NuT9CcZAiZ/icedtea-web-1.3.2/tests/reproducers/simple/AWTCommonResourcesOnly/resources/marker.png and /tmp/WZlglBfzlP/icedtea-web-1.4/tests/reproducers/simple/AWTCommonResourcesOnly/resources/marker.png differ diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy1.jnlp icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy1.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy1.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy1.jnlp 2013-05-03 19:08:24.814513032 +0000 @@ -0,0 +1,58 @@ + + + + + ClipboardContentCopy1 + IcedTea + + ClipboardContentCopy1 + + + + + + + + copy1 + 10 + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy2.jnlp icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy2.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy2.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy2.jnlp 2013-05-03 19:08:24.814513032 +0000 @@ -0,0 +1,58 @@ + + + + + ClipboardContentCopy2 + IcedTea + + ClipboardContentCopy2 + + + + + + + + copy2 + 10 + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste1.jnlp icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste1.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste1.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste1.jnlp 2013-05-03 19:08:24.814513032 +0000 @@ -0,0 +1,57 @@ + + + + + ClipboardContentPaste1 + IcedTea + + ClipboardContentPaste1 + + + + + + + + paste1 + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste2.jnlp icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste2.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste2.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste2.jnlp 2013-05-03 19:08:24.815513019 +0000 @@ -0,0 +1,57 @@ + + + + + ClipboardContentPaste2 + IcedTea + + ClipboardContentPaste2 + + + + + + + + paste2 + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/srcs/ClipboardContent.java icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/srcs/ClipboardContent.java --- icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/srcs/ClipboardContent.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/srcs/ClipboardContent.java 2013-05-03 19:08:24.815513019 +0000 @@ -0,0 +1,183 @@ +/* ClipboardContent.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.concurrent.TimeUnit; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.text.JTextComponent; + +public class ClipboardContent extends JPanel { + + private static final String contentC = "COPY#$REPRODUCER"; + private static final String contentP = "PASTE#$REPRODUCER"; + + private static class LocalFrame extends JFrame { + + JTextField t; + + public LocalFrame(String str) { + super(); + t = new JTextField(str); + this.add(t); + this.setSize(100, 100); + this.pack(); + t.selectAll(); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + } + + public void run() throws InterruptedException { + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + setVisible(true); + + } + }); + while (!this.isVisible()) { + Thread.sleep(100); + } + } + + public JTextField getT() { + return t; + } + } + + public void putToClipboard1(String str) { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Clipboard clipboard = toolkit.getSystemClipboard(); + StringSelection strSel = new StringSelection(str); + clipboard.setContents(strSel, null); + printFlavors(); + } + + public void putToClipboard2(final String str) throws InterruptedException, NoSuchMethodException, IllegalAccessException, UnsupportedFlavorException, IllegalArgumentException, InvocationTargetException, IOException { + final LocalFrame lf = new LocalFrame(str); + lf.run(); + ((JTextComponent) (lf.getT())).copy(); + printFlavors(); + lf.dispose(); + } + + public String pasteFromClipboard2() throws InterruptedException, NoSuchMethodException, IllegalAccessException, UnsupportedFlavorException, IllegalArgumentException, InvocationTargetException, IOException { + final LocalFrame lf = new LocalFrame("xxx"); + lf.run(); + ((JTextComponent) (lf.getT())).paste(); + printFlavors(); + String s = lf.getT().getText(); + lf.dispose(); + return s; + } + + private void printFlavors() { +//just for debugging +// Toolkit toolkit = Toolkit.getDefaultToolkit(); +// Clipboard clipboard = toolkit.getSystemClipboard(); +// Transferable clipData = clipboard.getContents(clipboard); +// DataFlavor[] cd = clipData.getTransferDataFlavors(); +// for (DataFlavor dataFlavor : cd) { +// System.out.println(dataFlavor.getMimeType()); +// } + } + + public String pasteFromClipboard1() throws UnsupportedFlavorException, IOException { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Clipboard clipboard = toolkit.getSystemClipboard(); + Transferable clipData = clipboard.getContents(clipboard); + printFlavors(); + String s = (String) (clipData.getTransferData( + DataFlavor.stringFlavor)); + return s; + } + + public static void main(String[] args) throws Exception { + ClipboardContent cl = new ClipboardContent(); + if (args.length == 0) { + throw new IllegalArgumentException("at least copy1|2 or paste1|2 must be as argument (+mandatory number giving use timeout in seconds before termination)"); + } else if (args.length == 1) { + cl.proceed(args[0]); + } else { + cl.proceed(args[0], args[1]); + } + + } + + public void proceed(String arg) throws Exception { + proceed(arg, 0); + } + + public void proceed(String arg, String keepAliveFor) throws Exception { + proceed(arg, Long.valueOf(keepAliveFor)); + } + + public void proceed(String arg, long timeOut) throws Exception { + if (arg.equals("copy1")) { + System.out.println(this.getClass().getName() + " copying1 to clipboard " + contentC); + putToClipboard1(contentC); + System.out.println(this.getClass().getName() + " copied1 to clipboard " + pasteFromClipboard1()); + } else if (arg.equals("paste1")) { + System.out.println(this.getClass().getName() + " pasting1 from clipboard "); + String nwContent = pasteFromClipboard1(); + System.out.println(this.getClass().getName() + " pasted1 from clipboard " + nwContent); + } else if (arg.equals("copy2")) { + System.out.println(this.getClass().getName() + " copying2 to clipboard " + contentC); + putToClipboard2(contentC); + System.out.println(this.getClass().getName() + " copied2 to clipboard " + pasteFromClipboard2()); + } else if (arg.equals("paste2")) { + System.out.println(this.getClass().getName() + " pasting2 from clipboard "); + String nwContent = pasteFromClipboard2(); + System.out.println(this.getClass().getName() + " pasted2 from clipboard " + nwContent); + } else { + throw new IllegalArgumentException("supported copy1|2 paste1|2"); + } + long start = System.nanoTime(); + while (TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start) < timeOut) { + Thread.sleep(500); + } + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/testcases/ClipboardContentTests.java icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/testcases/ClipboardContentTests.java --- icedtea-web-1.3.2/tests/reproducers/simple/ClipboardContent/testcases/ClipboardContentTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ClipboardContent/testcases/ClipboardContentTests.java 2013-05-03 19:08:24.816513006 +0000 @@ -0,0 +1,136 @@ +/* ClipboardContentTests.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.tools.WaitingForStringProcess; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import net.sourceforge.jnlp.ContentReaderListener; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.tools.AsyncJavaws; +import static net.sourceforge.jnlp.tools.ClipboardHelpers.pasteFromClipboard; +import static net.sourceforge.jnlp.tools.ClipboardHelpers.putToClipboard; +import org.junit.Assert; +import org.junit.Test; + + + +@Bug(id="PR708") +public class ClipboardContentTests { + + private static final String XCEPTION = "xception"; + private static final String contentC = "COPY#$REPRODUCER"; + private static final String contentP = "PASTE#$REPRODUCER"; + private static final String emptyContent = "empty content"; + private static ServerAccess server = new ServerAccess(); + private static final List javawsTrustArg = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); + + + @Test + public void assertClipboardIsWorking() throws Exception { + putToClipboard(emptyContent); + Assert.assertEquals(emptyContent, pasteFromClipboard()); + putToClipboard(contentC); + Assert.assertEquals(contentC, pasteFromClipboard()); + } + + @Test + @Bug(id = "PR708") + public void ClipboardContentTestCopy1() throws Exception { + putToClipboard(emptyContent); + Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); + WaitingForStringProcess wfsp = new WaitingForStringProcess(server, "/ClipboardContentCopy1.jnlp", javawsTrustArg, true, "copied"); + wfsp.run(); + String ss = pasteFromClipboard(); + Assert.assertEquals("Clipboard content must not be changed - was", emptyContent, ss); + Assert.assertNotNull("Result had to be delivered, was not", wfsp.getAj().getResult()); + Assert.assertTrue("ClipboardContentSignedCopy stderr should contain " + XCEPTION + " but did not ", wfsp.getAj().getResult().stderr.contains(XCEPTION)); + } + + //@Test needs awt robot to close dialog + @Bug(id = "PR708") + @NeedsDisplay + public void ClipboardContentTestCopy2() throws Exception { + putToClipboard(emptyContent); + Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); + WaitingForStringProcess wfsp = new WaitingForStringProcess(server, "/ClipboardContentCopy2.jnlp", javawsTrustArg, false, "copied"); + wfsp.run(); + String ss = pasteFromClipboard(); + Assert.assertEquals("Clipboard content must not be changed, was", emptyContent, ss); + Assert.assertNotNull("Result had to be delivered, was not", wfsp.getAj().getResult()); + Assert.assertTrue("ClipboardContentSignedCopy stderr should contain " + XCEPTION + " but did not", wfsp.getAj().getResult().stderr.contains(XCEPTION)); + + } + + @Test + @Bug(id = "PR708") + public void ClipboardContentTestPaste1() throws Exception { + //necessery errasing + putToClipboard(emptyContent); + Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); + //now put the tested data + putToClipboard(contentP); + Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); + ProcessResult pr = server.executeJavawsHeadless(javawsTrustArg, "/ClipboardContentPaste1.jnlp"); + Assert.assertFalse("ClipboardContentTestPaste stdout should not contain " + contentP + " but didn't", pr.stdout.contains(contentP)); + Assert.assertTrue("ClipboardContentTestPaste stderr should contain " + XCEPTION + " but didn't ", pr.stderr.contains(XCEPTION)); + + } + + //@Test + //needs awt robot to close dialog + //Q - can this test be headless,and so automated? + //A - no, headless test are present. Swing is handling clipoard by little bit more complicated ways + // but imho at the end its the same privlidges. So this test is kept only fo record + @Bug(id = "PR708") + @NeedsDisplay + public void ClipboardContentTestPaste2() throws Exception { + //necessery errasing + putToClipboard(emptyContent); + Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); + //now put the tested data + putToClipboard(contentP); + Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); + Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); + ProcessResult pr = server.executeJavaws(javawsTrustArg, "/ClipboardContentPaste2.jnlp"); + Assert.assertFalse("ClipboardContentTestPaste stdout should not contain " + contentP + " but didn't", pr.stdout.contains(contentP)); + Assert.assertTrue("ClipboardContentTestPaste stderr should contain " + XCEPTION + " but didn't ", pr.stderr.contains(XCEPTION)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html 2013-05-03 19:08:24.816513006 +0000 @@ -0,0 +1,44 @@ + + +

    +

    +

    +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html 2013-05-03 19:08:24.818512982 +0000 @@ -0,0 +1,44 @@ + + +

    +

    +

    +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1k_x_2.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1k_x_2.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1k_x_2.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1k_x_2.html 2013-05-03 19:08:24.818512982 +0000 @@ -0,0 +1,45 @@ + + +

    + +

    +

    +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2.html 2013-05-03 19:08:24.819512970 +0000 @@ -0,0 +1,48 @@ + + +

    + + +

    +

    + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.html 2013-05-03 19:08:24.819512970 +0000 @@ -0,0 +1,48 @@ + + +

    + + +

    +

    + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.html 2013-05-03 19:08:24.819512970 +0000 @@ -0,0 +1,44 @@ + + +

    +

    +

    +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_1.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_1.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_1.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_1.html 2013-05-03 19:08:24.816513006 +0000 @@ -0,0 +1,44 @@ + + +

    +

    +

    +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html 2013-05-03 19:08:24.817512994 +0000 @@ -0,0 +1,44 @@ + + +

    +

    +

    +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2e.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2e.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2e.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2e.html 2013-05-03 19:08:24.817512994 +0000 @@ -0,0 +1,44 @@ + + +

    +

    +

    +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html 2013-05-03 19:08:24.817512994 +0000 @@ -0,0 +1,44 @@ + + +

    +

    +

    +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.html icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.html --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.html 2013-05-03 19:08:24.818512982 +0000 @@ -0,0 +1,45 @@ + + +

    +

    +

    + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/srcs/CountingApplet1.java icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/srcs/CountingApplet1.java --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/srcs/CountingApplet1.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/srcs/CountingApplet1.java 2013-05-03 19:08:24.820512957 +0000 @@ -0,0 +1,109 @@ + +import java.applet.Applet; +import java.awt.BorderLayout; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; + +/* CountingApplet1.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +public class CountingApplet1 extends Applet { + + public static void main(String[] args) throws InterruptedException { + Integer counter = null; + if (args.length > 0) { + counter = new Integer(args[0]); + } + int i = 0; + while (true) { + System.out.println("counting... " + i); + if (counter != null && i == counter.intValue()) { + System.exit(-i); + } + i++; + Thread.sleep(1000); + } + } + + @Override + public void init() { + System.out.println("applet was initialised"); + final CountingApplet1 self = this; + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + self.setLayout(new BorderLayout()); + self.add(new JLabel("C1")); + self.validateTree(); + self.repaint(); + } + }); + } + + @Override + public void start() { + System.out.println("applet was started"); + String s = getParameter("kill"); + final String[] params; + if (s != null) { + params = new String[]{s}; + } else { + params = new String[0]; + } + new Thread(new Runnable() { + + @Override + public void run() { + try { + main(params); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }).start(); + } + + @Override + public void stop() { + System.out.println("applet was stopped"); + } + + @Override + public void destroy() { + System.out.println("applet will be destroyed"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java 2013-05-03 19:08:24.820512957 +0000 @@ -0,0 +1,227 @@ +/* ParallelAppletsTest.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Assert; + +import org.junit.Test; + +public class ParallelAppletsTest extends BrowserTest { + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1Ex2s() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1EE_x_2s.html"); + checkSimpleSignedStarted(pr); + checkNotInitialised(pr); + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1x2E() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2EE.html"); + checkExactCounts(1, 10, pr); + checkNotInitialised(pr); + + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1x2e() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2e.html"); + checkExactCounts(1, 10, pr); + checkException(pr); + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1ex2s() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1e_x_2s.html"); + checkSimpleSignedStarted(pr); + checkException(pr); + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1sx2() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1s_x_2.html"); + checkAppletStarted(pr); + checkSimpleSignedStarted(pr); + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1sx2s() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1s_x_2s.html"); + int found=countCounts(SimpleSignedStarted, pr.stdout); + assertExactCount(SimpleSignedStarted, 2, found); + + + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1sx2ssk() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1s_x_2ss.html"); + checkSimpleSigned2Started(pr); + checkSimpleSignedStarted(pr); + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1x2sk() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2sk.html"); + checkExitNotAllowed(pr); + checkAtLeastCounts(1, 10, pr); + checkExactCounts(2, 5, pr); + + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1kx2() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1k_x_2.html"); + checkExitNotAllowed(pr); + checkAtLeastCounts(1, 10, pr); + checkExactCounts(2, 5, pr); + + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1x2() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2.html"); + checkExactCounts(2, 10, pr); + } + + @Test + @TestInBrowsers(testIn = {Browsers.one}) + @NeedsDisplay + public void testParallelAppletsTest1x1() throws Exception { + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_1.html"); + checkExactCounts(2, 10, pr); + } + private static final String ACE = "java.security.AccessControlException"; + private static final String Sexit = "System.exit()"; + private static final String LE1 = "net.sourceforge.jnlp.LaunchException"; + private static final String LE2 = "Fatal: Initialization Error"; + private static final String Cinit = "Could not initialize applet"; + private static final String CountStub = "counting... "; + private static final String SimpleSignedStarted = "AppletTestSigned was started"; + private static final String SimpleSigned2Started = "AppletTestSigned2 was started"; + private static final String AppletStarted = "applet was started"; + private static final String AppletThrowedException = "java.lang.RuntimeException: Correct exception"; + + + + + private void checkExitNotAllowed(ProcessResult pr) { + Assert.assertTrue("Applets cant call " + Sexit, pr.stderr.matches("(?s).*" + ACE + ".*" + Sexit + ".*")); + } + + private void checkNotInitialised(ProcessResult pr) { + Assert.assertTrue("Applets should not be initialised ", pr.stderr.matches("(?s).*" + LE1 + ".*" + LE2 + ".*" + Cinit + ".*")); + } + + private void checkSimpleSignedStarted(ProcessResult pr) { + Assert.assertTrue("Applet's start should be confirmed by " + SimpleSignedStarted, pr.stdout.contains(SimpleSignedStarted)); + } + private void checkSimpleSigned2Started(ProcessResult pr) { + Assert.assertTrue("Applet's start should be confirmed by " + SimpleSigned2Started, pr.stdout.contains(SimpleSigned2Started)); + } + private void checkAppletStarted(ProcessResult pr) { + Assert.assertTrue("Applet's start should be confirmed by " + AppletStarted, pr.stdout.contains(AppletStarted)); + } + private void checkException(ProcessResult pr) { + Assert.assertTrue("Applet's exception should be confirmed by " + AppletThrowedException, pr.stderr.contains(AppletThrowedException)); + } + + private void checkExactCounts(int howManyTimes, int countIdTill, ProcessResult pr) { + for (int i = 0; i <= countIdTill; i++) { + String countId = CountStub + i+"\n"; + int found = countCounts(countId, pr.stdout); + assertExactCount(countId, howManyTimes, found); + } + + } + + private void assertExactCount(String what, int howManyTimes, int found) { + Assert.assertEquals(what + " was expected exactly " + howManyTimes + " but was found " + found, howManyTimes, found); + } + + private void checkAtLeastCounts(int howManyTimes, int countIdTill, ProcessResult pr) { + for (int i = 0; i <= countIdTill; i++) { + String countId = CountStub + i; + int found = countCounts(countId, pr.stdout); + Assert.assertTrue(countId + " was expected et least " + howManyTimes + " but was found " + found, found >= howManyTimes); + } + + } + + private int countCounts(String what, String where) { + int lastIndex = 0; + int count = 0; + + while (lastIndex != -1) { + + lastIndex = where.indexOf(what, lastIndex); + + if (lastIndex != -1) { + count++; + lastIndex += what.length(); + } + } + return count; + + } + + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet2/srcs/CountingApplet2.java icedtea-web-1.4/tests/reproducers/simple/CountingApplet2/srcs/CountingApplet2.java --- icedtea-web-1.3.2/tests/reproducers/simple/CountingApplet2/srcs/CountingApplet2.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/CountingApplet2/srcs/CountingApplet2.java 2013-05-03 19:08:24.821512944 +0000 @@ -0,0 +1,109 @@ + +import java.applet.Applet; +import java.awt.BorderLayout; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; + +/* CountingApplet1.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +public class CountingApplet2 extends Applet { + + public static void main(String[] args) throws InterruptedException { + Integer counter = null; + if (args.length > 0) { + counter = new Integer(args[0]); + } + int i = 0; + while (true) { + System.out.println("counting... " + i); + if (counter != null && i == counter.intValue()) { + System.exit(-i); + } + i++; + Thread.sleep(1000); + } + } + + @Override + public void init() { + System.out.println("applet was initialised"); + final CountingApplet2 self = this; + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + self.setLayout(new BorderLayout()); + self.add(new JLabel("C2")); + self.validateTree(); + self.repaint(); + } + }); + } + + @Override + public void start() { + System.out.println("applet was started"); + String s = getParameter("kill"); + final String[] params; + if (s != null) { + params = new String[]{s}; + } else { + params = new String[0]; + } + new Thread(new Runnable() { + + @Override + public void run() { + try { + main(params); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }).start(); + } + + @Override + public void stop() { + System.out.println("applet was stopped"); + } + + @Override + public void destroy() { + System.out.println("applet will be destroyed"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/DocumentBaseEncoding/resources/Document Base Encoding.html icedtea-web-1.4/tests/reproducers/simple/DocumentBaseEncoding/resources/Document Base Encoding.html --- icedtea-web-1.3.2/tests/reproducers/simple/DocumentBaseEncoding/resources/Document Base Encoding.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/DocumentBaseEncoding/resources/Document Base Encoding.html 2013-05-03 19:08:24.823512918 +0000 @@ -0,0 +1,43 @@ + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/DocumentBaseEncoding/srcs/DocumentBaseEncoding.java icedtea-web-1.4/tests/reproducers/simple/DocumentBaseEncoding/srcs/DocumentBaseEncoding.java --- icedtea-web-1.3.2/tests/reproducers/simple/DocumentBaseEncoding/srcs/DocumentBaseEncoding.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/DocumentBaseEncoding/srcs/DocumentBaseEncoding.java 2013-05-03 19:08:24.823512918 +0000 @@ -0,0 +1,47 @@ +/* +Copyright (C) 2013 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.applet.Applet; + +public class DocumentBaseEncoding extends Applet { + @Override + public void init() { + System.out.println("DocumentBase: " + getDocumentBase()); + System.out.println("CodeBase: " + getCodeBase()); + System.out.println("*** APPLET FINISHED ***"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/DocumentBaseEncoding/testcases/DocumentBaseEncodingTests.java icedtea-web-1.4/tests/reproducers/simple/DocumentBaseEncoding/testcases/DocumentBaseEncodingTests.java --- icedtea-web-1.3.2/tests/reproducers/simple/DocumentBaseEncoding/testcases/DocumentBaseEncodingTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/DocumentBaseEncoding/testcases/DocumentBaseEncodingTests.java 2013-05-03 19:08:24.824512905 +0000 @@ -0,0 +1,84 @@ +/* +Copyright (C) 2013 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; + +import org.junit.Assert; +import org.junit.Test; + +public class DocumentBaseEncodingTests extends BrowserTest { + + static final private String urlPattern = "http://localhost:\\d+"; + + private String escapePattern(String plainText) { + return "\\Q" + plainText + "\\E"; + } + + // Surround a pattern with two plain text matches and wildcards to match any occurence + private String surroundPattern(String plainText1, String pattern, String plainText2) { + return "(?s).*" + escapePattern(plainText1) + pattern + escapePattern(plainText2) + "\\W.*"; + } + + private void testEncoding(String urlParam, String encodedUrlParam) throws Exception { + ProcessResult pr = server.executeBrowser("Document Base Encoding.html" + urlParam, AutoClose.CLOSE_ON_CORRECT_END); + final String codeBasePattern = surroundPattern("CodeBase: ", urlPattern, "/"); + final String documentBasePattern = surroundPattern("DocumentBase: ", urlPattern, "/Document%20Base%20Encoding.html" + encodedUrlParam); + + Assert.assertTrue("DocumentBaseEncoding stdout should match '" + codeBasePattern + "' but did not.", + pr.stdout.matches(codeBasePattern)); + Assert.assertTrue("DocumentBaseEncoding stdout should match '" + documentBasePattern + "' but did not.", + pr.stdout.matches(documentBasePattern)); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + public void testSpacesInUrl() throws Exception { + testEncoding("?spaces test", "?spaces%20test"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + public void testComplexParameterInUrl() throws Exception { + + String urlParam = "?testkey=http%3A%2F%2Ftest.com%3Ftest%3Dtest"; // test value is 'http://test.com?test=test' percent-encoded + testEncoding(urlParam, urlParam /* Already encoded. */); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCodebase.html icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCodebase.html --- icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCodebase.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCodebase.html 2013-05-03 19:08:24.825512893 +0000 @@ -0,0 +1,97 @@ + + +

    + + + + + + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDotCodebase.html icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDotCodebase.html --- icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDotCodebase.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDotCodebase.html 2013-05-03 19:08:24.825512893 +0000 @@ -0,0 +1,97 @@ + + +

    + + + + + + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlp.jnlp icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlp.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlp.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlp.jnlp 2013-05-03 19:08:24.824512905 +0000 @@ -0,0 +1,61 @@ + + + + + SignedAppletTest + IcedTea + + SignedAppletTest + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/JnlpInApplet.html icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/JnlpInApplet.html --- icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/JnlpInApplet.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/JnlpInApplet.html 2013-05-03 19:08:24.825512893 +0000 @@ -0,0 +1,45 @@ + + +

    + + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/EmbeddedJnlp.java icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/EmbeddedJnlp.java --- icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/EmbeddedJnlp.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/EmbeddedJnlp.java 2013-05-03 19:08:24.826512881 +0000 @@ -0,0 +1,47 @@ +/* EmbeddedJnlp.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.applet.Applet; + +@SuppressWarnings("serial") +public class EmbeddedJnlp extends Applet { + + @Override + public void start() { + System.out.println("*** APPLET FINISHED ***"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java 2013-05-03 19:08:24.826512881 +0000 @@ -0,0 +1,71 @@ +/* EmbeddedJnlpInAppletTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import junit.framework.Assert; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Test; + +public class EmbeddedJnlpInAppletTest extends BrowserTest { + + final static String s = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + public void JnlpInApplet() throws Exception { + ProcessResult pr = server.executeBrowser("/JnlpInApplet.html", AutoClose.CLOSE_ON_CORRECT_END); + Assert.assertTrue("Stdout should contain " + s + " but did not", pr.stdout.contains(s)); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + public void EmbeddedJnlpInAppletWithADotAsCodebase() throws Exception { + ProcessResult pr = server.executeBrowser("/EmbeddedJnlpInAppletWithDotCodebase.html", AutoClose.CLOSE_ON_CORRECT_END); + Assert.assertTrue("Stdout should contain " + s + " but did not", pr.stdout.contains(s)); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + public void EmbeddedJnlpInAppletWithNoCodebase() throws Exception { + ProcessResult pr = server.executeBrowser("/EmbeddedJnlpInAppletNoCodebase.html", AutoClose.CLOSE_ON_CORRECT_END); + Assert.assertTrue("Stdout should contain " + s + " but did not", pr.stdout.contains(s)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-ISO88592.jnlp icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-ISO88592.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-ISO88592.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-ISO88592.jnlp 2013-05-03 19:08:24.894512027 +0000 @@ -0,0 +1,54 @@ + + + + + encodingTest1 + IcedTea + + =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ + + + + + + + + =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ1 + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-UTF8.jnlp icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-UTF8.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-UTF8.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-UTF8.jnlp 2013-05-03 19:08:24.894512027 +0000 @@ -0,0 +1,54 @@ + + + + + encodingTest1 + IcedTea + + ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ + + + + + + + + ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1 + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-ISO88592.jnlp icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-ISO88592.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-ISO88592.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-ISO88592.jnlp 2013-05-03 19:08:24.894512027 +0000 @@ -0,0 +1,54 @@ + + + + + encodingTest2̩خثϮ + IcedTea + + =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ + + + + + + + + =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ1 + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-UTF8.jnlp icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-UTF8.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-UTF8.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-UTF8.jnlp 2013-05-03 19:08:24.895512014 +0000 @@ -0,0 +1,54 @@ + + + + + encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ + IcedTea + + ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ + + + + + + + + ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1 + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-ISO88592.jnlp icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-ISO88592.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-ISO88592.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-ISO88592.jnlp 2013-05-03 19:08:24.895512014 +0000 @@ -0,0 +1,54 @@ + + + + + encodingTest3 + IcedTea + + =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ + + + + + + + + =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ1 + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-UTF8.jnlp icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-UTF8.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-UTF8.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-UTF8.jnlp 2013-05-03 19:08:24.896512001 +0000 @@ -0,0 +1,54 @@ + + + + + encodingTest3 + IcedTea + + ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ + + + + + + + + ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1 + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-ISO88592.html icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-ISO88592.html --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-ISO88592.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-ISO88592.html 2013-05-03 19:08:24.896512001 +0000 @@ -0,0 +1,45 @@ + + + + +

    + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-UTF8.html icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-UTF8.html --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-UTF8.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-UTF8.html 2013-05-03 19:08:24.896512001 +0000 @@ -0,0 +1,45 @@ + + + + +

    + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-ISO88592.jnlp icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-ISO88592.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-ISO88592.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-ISO88592.jnlp 2013-05-03 19:08:24.897511988 +0000 @@ -0,0 +1,62 @@ + + + + + encodingTest + IcedTea + + =!@#$%^*()_+).-?:_\"!'(/^;+̩خثϮ1 + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-UTF8.jnlp icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-UTF8.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-UTF8.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-UTF8.jnlp 2013-05-03 19:08:24.897511988 +0000 @@ -0,0 +1,62 @@ + + + + + encodingTest + IcedTea + + ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_\"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1 + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/srcs/EncodingTest.java icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/srcs/EncodingTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/srcs/EncodingTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/srcs/EncodingTest.java 2013-05-03 19:08:24.898511975 +0000 @@ -0,0 +1,90 @@ + +import java.applet.Applet; + +/* EncodingTest.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +public class EncodingTest extends Applet { + + + public static void main(String[] args){ + System.out.println("Encoded jar decoded correctly"); + for (int i = 0; i < args.length; i++) { + String string = args[i]; + System.out.println(string); + } + } + private class Killer extends Thread { + + public int n = 2000; + + @Override + public void run() { + try { + Thread.sleep(n); + System.out.println("Aplet killing himself after " + n + " ms of life"); + System.exit(0); + } catch (Exception ex) { + } + } + } + private Killer killer; + + @Override + public void init() { + System.out.println("applet was initialised"); + killer = new Killer(); + } + + @Override + public void start() { + System.out.println("applet was started"); + System.out.println(getParameter("key1")); + killer.start(); + System.out.println("killer was started"); + } + + @Override + public void stop() { + System.out.println("applet was stopped"); + } + + @Override + public void destroy() { + System.out.println("applet will be destroyed"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/testcases/EncodingTestTest.java icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/testcases/EncodingTestTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/testcases/EncodingTestTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/testcases/EncodingTestTest.java 2013-05-03 19:08:24.898511975 +0000 @@ -0,0 +1,258 @@ +/* EncodingTestTest.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FilenameFilter; +import java.util.Arrays; +import java.util.List; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.KnownToFail; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import org.junit.Assert; +import org.junit.Test; + +public class EncodingTestTest extends BrowserTest { + + List verboseArg = Arrays.asList(new String[]{ServerAccess.VERBOSE_OPTION}); + private static final String arg = "ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_\"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1"; + private static final String argEscaped = arg.replace("\"", """); + private static final String utf = "UTF8"; + private static final String iso88592 = "ISO88592"; + private FileInputStream is; + File[] utf8Files = server.getDir().listFiles(new FilenameFilter() { + + @Override + public boolean accept(File dir, String name) { + return name.contains(utf); + } + }); + File[] iso88592Files = server.getDir().listFiles(new FilenameFilter() { + + @Override + public boolean accept(File dir, String name) { + return name.contains(iso88592); + } + }); + + @Test + public void iso88592FileCanBeDecodedCorrectly() throws Exception { + Assert.assertTrue("there must be more then 1 iso file in server's directory", iso88592Files.length > 0); + for (int i = 0; i < iso88592Files.length; i++) { + File f = iso88592Files[i]; + is = new FileInputStream(f); + String ff = ServerAccess.getContentOfStream(is, "ISO-8859-2"); + ServerAccess.logOutputReprint(f.getName()); + ServerAccess.logOutputReprint(ff); + Assert.assertTrue("file " + f.getName() + " should contain " + arg + " bud didn't", ff.contains(arg) || ff.contains(argEscaped)); + } + } + + @Test + public void iso88592FileCanBeDecodedWrongly() throws Exception { + Assert.assertTrue("there must be more then 1 iso file in server's directory", iso88592Files.length > 0); + for (int i = 0; i < iso88592Files.length; i++) { + File f = iso88592Files[i]; + is = new FileInputStream(f); + String ff = ServerAccess.getContentOfStream(is, "UTF-8"); + ServerAccess.logOutputReprint(f.getName()); + ServerAccess.logOutputReprint(ff); + Assert.assertFalse("file " + f.getName() + " should NOT contain " + arg + " bud did", ff.contains(arg) || ff.contains(argEscaped)); + } + } + + @Test + public void utf8FileCanBeDecodedCorrectly() throws Exception { + Assert.assertTrue("there must be more then 1 utf file in server's directory", utf8Files.length > 0); + for (int i = 0; i < utf8Files.length; i++) { + File f = utf8Files[i]; + is = new FileInputStream(f); + String ff = ServerAccess.getContentOfStream(is, "UTF-8"); + ServerAccess.logOutputReprint(f.getName()); + ServerAccess.logOutputReprint(ff); + Assert.assertTrue("file " + f.getName() + " should contain " + arg + " bud didn't", ff.contains(arg) || ff.contains(argEscaped)); + } + } + + @Test + public void utf8FileCanBeDecodedWrongly() throws Exception { + Assert.assertTrue("there must be more then 1 utf file in server's directory", utf8Files.length > 0); + for (int i = 0; i < utf8Files.length; i++) { + File f = utf8Files[i]; + is = new FileInputStream(f); + String ff = ServerAccess.getContentOfStream(is, "ISO-8859-2"); + ServerAccess.logOutputReprint(f.getName()); + ServerAccess.logOutputReprint(ff); + Assert.assertFalse("file " + f.getName() + " should NOT contain " + arg + " bud did", ff.contains(arg) || ff.contains(argEscaped)); + } + } + + @Test + public void testEncodingTest1Utf8() throws Exception { + testEncodingTest1(utf); + } + + @Test + @KnownToFail + @Bug(id = "PR1108") + public void testEncodingTest1Iso88592() throws Exception { + testEncodingTest1(iso88592); + } + + @Test + public void testEncodingTest2Utf8() throws Exception { + testEncodingTest2(utf); + } + + @Test + @KnownToFail + @Bug(id = "PR1108") + public void testEncodingTest2Iso88592() throws Exception { + testEncodingTest2(iso88592); + } + + @Test + public void testEncodingTest3Utf8() throws Exception { + testEncodingTest3(utf); + } + + @Test + @KnownToFail + @Bug(id = "PR1108") + public void testEncodingTest3Iso88592() throws Exception { + testEncodingTest3(iso88592); + } + + @Test + @NeedsDisplay + @TestInBrowsers(testIn = Browsers.one) + public void testEncodingTest4Utf8() throws Exception { + testEncodingTest4(utf); + } + + @Test + @NeedsDisplay + @TestInBrowsers(testIn = Browsers.one) + public void testEncodingTest4Iso88592() throws Exception { + testEncodingTest4(iso88592); + } + + @Test + public void testEncodingTest5Utf8() throws Exception { + testEncodingTest5(utf); + } + + @Test + @Bug(id = "PR1108") + @KnownToFail + public void testEncodingTest5Iso88592() throws Exception { + testEncodingTest5(iso88592); + } + + /** + * launching simpletest1.jar from encoding encoded jnlp + */ + public void testEncodingTest1(String encoding) throws Exception { + ProcessResult pr = server.executeJavawsHeadless(verboseArg, "/encodingTest1-" + encoding + ".jnlp"); + String s = "Good simple javaws exapmle"; + Assert.assertTrue("encodingTest1 (in " + encoding + ") stdout should contain " + s + " bud didn't", pr.stdout.contains(s)); + String ss = "xception"; + Assert.assertFalse("encodingTest1 (in " + encoding + ") stderr should not contain " + ss + " but did", pr.stderr.contains(ss)); + //javaws in verbose mode is printing out readed jnlp. I'm no sure if the following test is relevant + Assert.assertTrue("encodingTest1 (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); + } + + /** + * launching simpletest1.jar fromencoding file with utf8/ISO-8859-2 uncompatible characters + */ + public void testEncodingTest2(String encoding) throws Exception { + ProcessResult pr = server.executeJavawsHeadless(verboseArg, "/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-" + encoding + ".jnlp"); + String s = "Good simple javaws exapmle"; + Assert.assertTrue("encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ (in " + encoding + ") stdout should contain " + s + " bud didn't", pr.stdout.contains(s)); + String ss = "xception"; + Assert.assertFalse("encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ (in " + encoding + ") stderr should not contain " + ss + " but did", pr.stderr.contains(ss)); + //javaws in verbose mode is printing out readed jnlp. I'm no sure if the following test is relevant + Assert.assertTrue("encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); + } + + /** + * launching encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ.jar from encoding file with utf8/ISO-8859-2 uncompatible characters included also in args and jar filename + */ + public void testEncodingTest3(String encoding) throws Exception { + //not verbose in this case, this class is printing it's argument out + ProcessResult pr = server.executeJavawsHeadless("/encodingTest3-" + encoding + ".jnlp"); + String s = "Encoded jar decoded correctly"; + Assert.assertTrue("encodingTest3 (in " + encoding + ") stdout should contain " + s + " bud didn't", pr.stdout.contains(s)); + Assert.assertTrue("encodingTest3 (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); + String ss = "xception"; + Assert.assertFalse("encodingTest3 (in " + encoding + ") stderr should not contain " + ss + " but did", pr.stderr.contains(ss)); + } + + /** + * launching encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ.jar from encoding file with utf8/ISO-8859-2 uncompatible characters included also in args and jar filename in browser + */ + public void testEncodingTest4(String encoding) throws Exception { + ProcessResult pr = server.executeBrowser("/encodingTest4-" + encoding + ".html"); + String s3 = "applet was initialised"; + Assert.assertTrue("encodingTest4 stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3)); + String s0 = "applet was started"; + Assert.assertTrue("encodingTest4 stdout should contains " + s0 + " bud didn't", pr.stdout.contains(s3)); + Assert.assertTrue("encodingTest4 (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); + String ss = "xception"; + Assert.assertFalse("encodingTest4 (in " + encoding + ") stderr should not contain " + ss + " but did", pr.stderr.contains(ss)); + } + + /** + * launching encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ.jar from encoding file with utf8/ISO-8859-2 uncompatible characters included also in args and jar filename as applet by jnlp + */ + public void testEncodingTest5(String encoding) throws Exception { + //not verbose in this case, this class is printing it's argument out + ProcessResult pr = server.executeJavawsHeadless("/encodingTest5-" + encoding + ".jnlp"); + String s3 = "applet was initialised"; + Assert.assertTrue("encodingTest5 stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3)); + String s0 = "applet was started"; + Assert.assertTrue("encodingTest5 stdout should contains " + s0 + " bud didn't", pr.stdout.contains(s3)); + Assert.assertTrue("encodingTest5 (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); + String ss = "xception"; + Assert.assertFalse("encodingTest5 (in " + encoding + ") stderr should not contain " + ss + " but did", pr.stderr.contains(ss)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncParam/resources/JavascriptFuncParam.html icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncParam/resources/JavascriptFuncParam.html --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncParam/resources/JavascriptFuncParam.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncParam/resources/JavascriptFuncParam.html 2013-05-03 19:08:24.844512656 +0000 @@ -0,0 +1,40 @@ + + + + Java JavaScript LiveConnect - Function Parameters + + + + +

    The JToJSFuncParam html page

    + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncParam/resources/javascript-funcparam.jnlp icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncParam/resources/javascript-funcparam.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncParam/resources/javascript-funcparam.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncParam/resources/javascript-funcparam.jnlp 2013-05-03 19:08:24.844512656 +0000 @@ -0,0 +1,23 @@ + + + + + Java to JavaScript LiveConnect - FuncParam + IcedTea + + LiveConnect - tests for parameter conversion between Java and JavaScript. + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncParam/srcs/JavascriptFuncParam.java icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncParam/srcs/JavascriptFuncParam.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncParam/srcs/JavascriptFuncParam.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncParam/srcs/JavascriptFuncParam.java 2013-05-03 19:08:24.845512643 +0000 @@ -0,0 +1,146 @@ +import java.applet.Applet; +import netscape.javascript.JSObject; + +public class JavascriptFuncParam extends Applet { + + public DummyObject dummyObject = new DummyObject("DummyObject1"); + private JSObject window; + + private final String jsFunctionName = "JJSParameterTypeFunc"; + + public void init() { + window = JSObject.getWindow(this); + String initStr = "JToJSFuncParam applet initialized."; + System.out.println(initStr); + } + + //methods for testing calling JavaScript function with different parameters + public void jjsCallintParam(){ + int i = 1; + passToJavascript(i); + } + + public void jjsCalldoubleParam(){ + double d = 1.1; + passToJavascript(d); + } + + public void jjsCallfloatParam(){ + float f = 1.5f; + passToJavascript(f); + } + + public void jjsCalllongParam(){ + long l = 10000; + passToJavascript(l); + } + + public void jjsCallshortParam(){ + short s = 1; + passToJavascript(s); + } + + public void jjsCallbyteParam(){ + byte b = 1; + passToJavascript(b); + } + + public void jjsCallcharParam(){ + char c = 'a'; + passToJavascript(c, "97"); + } + + public void jjsCallbooleanParam(){ + boolean b = true; + passToJavascript(b); + } + + public void jjsCallIntegerParam(){ + Integer i = new Integer(1); + passToJavascript(i); + } + + public void jjsCallDoubleParam(){ + Double i = new Double(1.5); + passToJavascript(i); + } + + public void jjsCallFloatParam(){ + Float i = new Float(1.5); + passToJavascript(i); + } + + public void jjsCallLongParam(){ + Long i = new Long(10000); + passToJavascript(i); + } + + public void jjsCallShortParam(){ + Short i = new Short((short)1); + passToJavascript(i); + } + + public void jjsCallByteParam(){ + Byte i = new Byte((byte)1); + passToJavascript(i); + } + + public void jjsCallBooleanParam(){ + Boolean i = new Boolean(true); + passToJavascript(i); + } + + public void jjsCallCharacterParam(){ + Character i = new Character('a');//97 + passToJavascript(i, "97"); + } + + public void jjsCallStringParam(){ + String i = "teststring"; + passToJavascript(i, "\"teststring\""); + } + + public void jjsCallDummyObjectParam(){ + DummyObject i = new DummyObject("dummy1"); + passToJavascript(i, "applet.getNewDummyObject(\"dummy1\")"); + } + + public void jjsCallJSObjectParam(){ + JSObject i = window; + passToJavascript(i, "window"); + } + + private void passToJavascript(Object obj, String repr){ + window.call(jsFunctionName, new Object[]{ obj, repr }); + } + + private void passToJavascript(Object obj){ + passToJavascript(obj, obj.toString()); + } + + // auxiliary methods and class: + public void printOut(String s) { + System.out.println(s); + } + + public class DummyObject { + private String str; + + public DummyObject(String s) { + this.str = s; + } + + public void setStr(String s) { + this.str = s; + } + + public String toString() { + return str; + } + } + + public DummyObject getNewDummyObject(String s){ + return new DummyObject(s); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java 2013-05-03 19:08:24.845512643 +0000 @@ -0,0 +1,234 @@ +/* JToJSFuncParamTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.annotations.KnownToFail; +import org.junit.Assert; + +import org.junit.Test; + +public class JavascriptFuncParamTest extends BrowserTest { + + public final boolean doNotRunInOpera = true; + + private final String initStr = "JToJSFuncParam applet initialized."; + private final String afterStr = "afterTests"; + private final String globStart = "Call with "; + private final String globEnd = " from JS"; + private final String jEnd = " from J"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + return (s.contains(initStr) && s.contains(afterStr)); + } + } + + private void evaluateStdoutContents(ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JToJSFuncParamTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the results of two calls of js func are the same + + int gs = pr.stdout.indexOf(globStart); + int ge = pr.stdout.indexOf(globEnd); + int je = pr.stdout.indexOf(jEnd); + int jss = je + jEnd.length() + 1; + + String javaOutput = pr.stdout.substring(gs, je); + String jsOutput = pr.stdout.substring(jss, ge); + + Assert.assertTrue("JToJSFuncParam: the J and JS outputs are not equal!", javaOutput.equals(jsOutput)); + } + + private void javaToJSFuncParamTest(String funcStr) throws Exception { + + if( doNotRunInOpera){ + Browsers b = server.getCurrentBrowser().getID(); + if(b == Browsers.opera){ + return; + } + } + + String strURL = "/JavascriptFuncParam.html?" + funcStr; + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + evaluateStdoutContents(pr); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_int_Test() throws Exception { + javaToJSFuncParamTest("jjsCallintParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_double_Test() throws Exception { + javaToJSFuncParamTest("jjsCalldoubleParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_float_Test() throws Exception { + javaToJSFuncParamTest("jjsCallfloatParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_long_Test() throws Exception { + javaToJSFuncParamTest("jjsCalllongParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_short_Test() throws Exception { + javaToJSFuncParamTest("jjsCallshortParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_byte_Test() throws Exception { + javaToJSFuncParamTest("jjsCallbyteParam"); + } + + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_char_Test() throws Exception { + javaToJSFuncParamTest("jjsCallcharParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_boolean_Test() throws Exception { + javaToJSFuncParamTest("jjsCallbooleanParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_Integer_Test() throws Exception { + javaToJSFuncParamTest("jjsCallIntegerParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_Double_Test() throws Exception { + javaToJSFuncParamTest("jjsCallDoubleParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_Float_Test() throws Exception { + javaToJSFuncParamTest("jjsCallFloatParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_Long_Test() throws Exception { + javaToJSFuncParamTest("jjsCallLongParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_Short_Test() throws Exception { + javaToJSFuncParamTest("jjsCallShortParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_Byte_Test() throws Exception { + javaToJSFuncParamTest("jjsCallByteParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_Boolean_Test() throws Exception { + javaToJSFuncParamTest("jjsCallBooleanParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_Character_Test() throws Exception { + javaToJSFuncParamTest("jjsCallCharacterParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_String_Test() throws Exception { + javaToJSFuncParamTest("jjsCallStringParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncParam_DummyObject_Test() throws Exception { + javaToJSFuncParamTest("jjsCallDummyObjectParam"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail(failsIn={Browsers.googleChrome, Browsers.chromiumBrowser}) + public void AppletJToJSFuncParam_JSObject_Test() throws Exception { + javaToJSFuncParamTest("jjsCallJSObjectParam"); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.html icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.html --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.html 2013-05-03 19:08:24.846512630 +0000 @@ -0,0 +1,27 @@ + + + + Java JavaScript LiveConnect - Function Return types + + + + + + + +

    The JToJSFuncReturn html page

    + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/resources/javascript-funcreturn.jnlp icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/resources/javascript-funcreturn.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/resources/javascript-funcreturn.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/resources/javascript-funcreturn.jnlp 2013-05-03 19:08:24.847512617 +0000 @@ -0,0 +1,23 @@ + + + + + Java to JavaScript LiveConnect - FuncReturn + IcedTea + + LiveConnect - tests for returning different types of values when calling JS function from Java. + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/resources/Javascript_FuncReturn.js icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/resources/Javascript_FuncReturn.js --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/resources/Javascript_FuncReturn.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/resources/Javascript_FuncReturn.js 2013-05-03 19:08:24.846512630 +0000 @@ -0,0 +1,15 @@ +function doJToJSFuncReturnTests(){ + var applet = document.getElementById('jtojsFuncReturnApplet'); + + var urlArgs = document.URL.split("?"); + value = eval(decodeURIComponent(urlArgs[1])); + + applet.jCallJSFunction(); + + applet.writeAfterTests(); +} + +function jsReturningFunction(){ + return value; +} + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/srcs/JavascriptFuncReturn.java icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/srcs/JavascriptFuncReturn.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/srcs/JavascriptFuncReturn.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/srcs/JavascriptFuncReturn.java 2013-05-03 19:08:24.847512617 +0000 @@ -0,0 +1,46 @@ +import java.applet.Applet; +import netscape.javascript.JSObject; + +public class JavascriptFuncReturn extends Applet { + + private JSObject window; + + public void init() { + window = JSObject.getWindow(this); + String initStr = "JToJSFuncReturn applet initialized."; + System.out.println(initStr); + } + + // method for testing return types of JavaScript function + public void jCallJSFunction() { + String returnTypeTestFuncName = "jsReturningFunction"; + Object ret = window.call(returnTypeTestFuncName, new Object[]{}); + System.out.println(ret.toString()); + } + + // auxiliary class and methods + public void writeAfterTests() { + System.out.print("afterTests"); + } + + public class DummyObject { + private String str; + + public DummyObject(String s) { + this.str = s; + } + + public void setStr(String s) { + this.str = s; + } + + public String toString() { + return str; + } + } + + public DummyObject getNewDummyObject(String s){ + return new DummyObject(s); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/testcases/JavascriptFuncReturnTest.java icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/testcases/JavascriptFuncReturnTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptFuncReturn/testcases/JavascriptFuncReturnTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptFuncReturn/testcases/JavascriptFuncReturnTest.java 2013-05-03 19:08:24.847512617 +0000 @@ -0,0 +1,125 @@ +/* JToJSFuncReturnTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Assert; + +import org.junit.Test; + +public class JavascriptFuncReturnTest extends BrowserTest { + + public final boolean doNotRunInOpera = true; + + private final String initStr = "JToJSFuncReturn applet initialized."; + private final String afterStr = "afterTests"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + return (s.contains(initStr) && s.contains(afterStr)); + } + } + + private void evaluateStdoutContents(String[] expectedStdoutsOR, ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JToJSFuncReturnTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the values set from JavaScript are ok + boolean atLeastOne = false; + for(String s : expectedStdoutsOR){ + if(pr.stdout.contains(s)) atLeastOne = true; + } + Assert.assertTrue("JToJSFuncReturn: the output should include at least one of expected Stdouts, but it didnt.", atLeastOne); + } + + private void javaToJSFuncReturnTest(String urlEnd, String[] expectedValsOR) throws Exception { + + if( doNotRunInOpera){ + Browsers b = server.getCurrentBrowser().getID(); + if(b == Browsers.opera){ + return; + } + } + + String strURL = "/JavascriptFuncReturn.html?" + urlEnd; + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + evaluateStdoutContents(expectedValsOR, pr); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncReturn_number_Test() throws Exception { + javaToJSFuncReturnTest("123", new String[] {"123"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncReturn_boolean_Test() throws Exception { + javaToJSFuncReturnTest("true", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncReturn_String_Test() throws Exception { + javaToJSFuncReturnTest("\"𠁎〒£$ǣ€𝍖\"", new String[] {"𠁎〒£$ǣ€𝍖"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncReturn_Object_Test() throws Exception { + javaToJSFuncReturnTest("applet.getNewDummyObject(\"dummy1\")", new String[] {"dummy1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSFuncReturn_JSObject_Test() throws Exception { + javaToJSFuncReturnTest("window", new String[] {"[object Window]", "[object DOMWindow]"}); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/resources/JavascriptGet.html icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/resources/JavascriptGet.html --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/resources/JavascriptGet.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/resources/JavascriptGet.html 2013-05-03 19:08:24.848512604 +0000 @@ -0,0 +1,27 @@ + + + + Java JavaScript LiveConnect - Get values from applet + + + + + + + +

    The JToJSGet html page

    + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/resources/javascript-get.jnlp icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/resources/javascript-get.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/resources/javascript-get.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/resources/javascript-get.jnlp 2013-05-03 19:08:24.849512591 +0000 @@ -0,0 +1,23 @@ + + + + + Java to JavaScript LiveConnect - Get + IcedTea + + LiveConnect - tests for reading JavaScript values from Java. + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/resources/Javascript_Get.js icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/resources/Javascript_Get.js --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/resources/Javascript_Get.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/resources/Javascript_Get.js 2013-05-03 19:08:24.848512604 +0000 @@ -0,0 +1,14 @@ +function doJToJSGetTests(){ + + var applet = document.getElementById('jtojsGetApplet'); + + var urlArgs = document.URL.split("?"); + var testParams = urlArgs[1].split(";"); + var func = testParams[0]; + var value = decodeURIComponent(testParams[1]); + + eval('jsvar='+value); + eval('applet.'+func+'()'); + + applet.writeAfterTests(); +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/srcs/JavascriptGet.java icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/srcs/JavascriptGet.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/srcs/JavascriptGet.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/srcs/JavascriptGet.java 2013-05-03 19:08:24.849512591 +0000 @@ -0,0 +1,91 @@ +import java.applet.Applet; +import java.util.Arrays; +import netscape.javascript.JSObject; + +public class JavascriptGet extends Applet { + + public DummyObject dummyObject = new DummyObject("DummyObject1"); + public Object value; + private JSObject window; + + private final String jsvar = "jsvar"; + + public void init() { + window = JSObject.getWindow(this); + + String initStr = "JToJSGet applet initialized."; + System.out.println(initStr); + } + + // methods for testing read from JavaScript variables + public void jjsReadInt() { +// value = new Integer(window.getMember(jsvar).toString()); + int num = ((Number) window.getMember(jsvar)).intValue(); + System.out.println(value); + } + + public void jjsReadDouble() { + value = new Double(window.getMember(jsvar).toString()); + System.out.println(value); + } + + public void jjsReadBoolean() { + value = new Boolean(window.getMember(jsvar).toString()); + System.out.println(value); + } + + public void jjsReadString() { + value = window.getMember(jsvar).toString(); + System.out.println(value); + } + + public void jjsReadObject() { + value = window.getMember(jsvar).toString(); + System.out.println(value); + } + + public void jjsRead1DArray() { + Object[] arrayvalue = (Object[]) window.getMember(jsvar); + + System.out.println(Arrays.toString(arrayvalue)); + } + + public void jjsRead2DArray() { + Object[][] arrayvalue = (Object[][])window.getMember(jsvar); + + System.out.println(Arrays.deepToString(arrayvalue)); + } + + public void jjsReadJSObject() { + JSObject jsobjectvalue = (JSObject) window.getMember(jsvar); + + System.out.println(jsobjectvalue); + } + + //auxiliary class DummyObject + public class DummyObject { + private String str; + + public DummyObject(String s) { + this.str = s; + } + + public void setStr(String s) { + this.str = s; + } + + public String toString() { + return str; + } + } + + //auxiliary methods: + public DummyObject getNewDummyObject(String s){ + return new DummyObject(s); + } + + public void writeAfterTests(){ + System.out.println("afterTests"); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java 2013-05-03 19:08:24.850512579 +0000 @@ -0,0 +1,141 @@ +/* JToJSGetTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.annotations.KnownToFail; +import org.junit.Assert; + +import org.junit.Test; + +public class JavascriptGetTest extends BrowserTest { + + public final boolean doNotRunInOpera = true; + + private final String initStr = "JToJSGet applet initialized."; + private final String afterStr = "afterTests"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + + return (s.contains(initStr) && s.contains(afterStr)); + + } + } + + private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JToJSGetTest stdout should contain " + initStr + + " but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the values get from JavaScript are ok + Assert.assertTrue("JToJSGet: the output should include: "+expectedStdout+", but it didnt.", pr.stdout.contains(expectedStdout)); + } + + private void javaToJSGetTest(String funcStr, String paramStr, String expectedVal) throws Exception { + + if( doNotRunInOpera){ + Browsers b = server.getCurrentBrowser().getID(); + if(b == Browsers.opera){ + return; + } + } + + String strURL = "/JavascriptGet.html?" + funcStr + ";" + paramStr; + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + evaluateStdoutContents(expectedVal, pr); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSGet_double_Test() throws Exception { + javaToJSGetTest("jjsReadDouble", "1.1", "1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSGet_boolean_Test() throws Exception { + javaToJSGetTest("jjsReadBoolean", "true", "true"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSGet_string_Test() throws Exception { + javaToJSGetTest("jjsReadString", "\"teststring\"", "teststring"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSGet_object_Test() throws Exception { + javaToJSGetTest("jjsReadObject", "applet.getNewDummyObject(\"dummy1\")", "dummy1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail(failsIn={Browsers.midori, Browsers.epiphany, Browsers.googleChrome, Browsers.chromiumBrowser}) + public void AppletJToJSGet_1DArray_Test() throws Exception { + javaToJSGetTest("jjsRead1DArray", "[1,2,3]", "[1, 2, 3]"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail(failsIn={Browsers.midori, Browsers.epiphany, Browsers.googleChrome, Browsers.chromiumBrowser}) + public void AppletJToJSGet_2DArray_Test() throws Exception { + javaToJSGetTest("jjsRead2DArray", "[[1,2],[3,4]]","[[1, 2], [3, 4]]"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSGet_JSObject_Test() throws Exception { + javaToJSGetTest("jjsReadJSObject", "window","Window]");//[object Window], [object DOMWindow] + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/resources/JavascriptSet.html icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/resources/JavascriptSet.html --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/resources/JavascriptSet.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/resources/JavascriptSet.html 2013-05-03 19:08:24.850512579 +0000 @@ -0,0 +1,27 @@ + + + + Java JavaScript LiveConnect - Set values from applet + + + + + + + +

    The JToJSSet html page

    + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/resources/javascript-set.jnlp icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/resources/javascript-set.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/resources/javascript-set.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/resources/javascript-set.jnlp 2013-05-03 19:08:24.851512567 +0000 @@ -0,0 +1,23 @@ + + + + + Java to JavaScript LiveConnect - Set + IcedTea + + LiveConnect - tests for setting JS values from Java. + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/resources/Javascript_Set.js icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/resources/Javascript_Set.js --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/resources/Javascript_Set.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/resources/Javascript_Set.js 2013-05-03 19:08:24.850512579 +0000 @@ -0,0 +1,31 @@ +function doJToJSSetTests(){ + + var applet = document.getElementById('jtojsSetApplet'); + + var urlArgs = document.URL.split("?"); + var func = urlArgs[1]; + + //pre-initialization of arrays + if(func === "jjsSet1DArray"){ + setvar = new Array(); + }else if(func === "jjsSet2DArray" ){ + setvar = new Array(); + setvar[1] = new Array(); + } + + //calling the applet function + eval('applet.'+func+'()'); + + //preparing jsvar value string for output + if(func === "jjsSet1DArray"){ + str = ""+setvar[1]; + }else if(func === "jjsSet2DArray" ){ + str = ""+setvar[1][1]; + }else if(func === "jjsSetObject" ){ + str = setvar.toString(); + }else{ + var str = ""+setvar; + } + + applet.printStrAndFinish(str); +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/srcs/JavascriptSet.java icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/srcs/JavascriptSet.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/srcs/JavascriptSet.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/srcs/JavascriptSet.java 2013-05-03 19:08:24.851512567 +0000 @@ -0,0 +1,123 @@ +import java.applet.Applet; +import netscape.javascript.JSObject; + +public class JavascriptSet extends Applet { + + private JSObject window; + + public void init() { + window = JSObject.getWindow(this); + String initStr = "JToJSSet applet initialized."; + System.out.println(initStr); + } + + // methods for testing setting of JavaScript variables + public void jjsSetInt() { + window.setMember("setvar", (int) 1); + } + + public void jjsSetInteger() { + window.setMember("setvar", new Integer(2)); + } + + public void jjsSetdouble() { + window.setMember("setvar", (double) 2.5); + } + + public void jjsSetDouble() { + window.setMember("setvar", new Double(2.5)); + } + + public void jjsSetfloat() { + window.setMember("setvar", (float) 2.5); + } + + public void jjsSetFloat() { + window.setMember("setvar", new Float(2.5)); + } + + public void jjsSetshort() { + window.setMember("setvar", (short) 3); + } + + public void jjsSetShort() { + window.setMember("setvar", new Short((short) 4)); + } + + public void jjsSetlong() { + window.setMember("setvar", (long) 4294967296L); + } + + public void jjsSetLong() { + window.setMember("setvar", new Long(4294967297L)); + } + + public void jjsSetbyte() { + window.setMember("setvar", (byte) 5); + } + + public void jjsSetByte() { + window.setMember("setvar", new Byte((byte) 6)); + } + + public void jjsSetchar() { + window.setMember("setvar", (char) 'a'); + } + + public void jjsSetCharacter() { + window.setMember("setvar", new Character('a')); + } + + public void jjsSetboolean() { + window.setMember("setvar", (boolean) true); + } + + public void jjsSetBoolean() { + window.setMember("setvar", new Boolean(true)); + } + + public void jjsSetString() { + window.setMember("setvar", "𠁎〒£$ǣ€𝍖"); + } + + public void jjsSetObject() { + DummyObject dummyObject = new DummyObject("DummyObject2"); + window.setMember("setvar", dummyObject); + } + + public void jjsSet1DArray() { + ((JSObject) window.getMember("setvar")).setSlot(1, 100); + } + + public void jjsSet2DArray() { + ((JSObject) ((JSObject) window.getMember("setvar")).getSlot(1)).setSlot(1, 200); + } + + public void jjsSetJSObject(){ + window.setMember("setvar", window); + } + + + // auxiliary class and method for writing output: + public void printStrAndFinish(String str){ + System.out.println(str); + System.out.println("afterTests"); + } + + public class DummyObject { + private String str; + + public DummyObject(String s) { + this.str = s; + } + + public void setStr(String s) { + this.str = s; + } + + public String toString() { + return str; + } + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java 2013-05-03 19:08:24.852512555 +0000 @@ -0,0 +1,238 @@ +/* JToJSSetTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Assert; + +import org.junit.Test; + +public class JavascriptSetTest extends BrowserTest { + + public final boolean doNotRunInOpera = true; + + private final String initStr = "JToJSSet applet initialized."; + private final String afterStr = "afterTests"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + return (s.contains(initStr) && s.contains(afterStr)); + } + } + + private void evaluateStdoutContents(String[] expectedStdoutsOR, ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JToJSSetTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the values set from JavaScript are ok + boolean atLeastOne = false; + for(String s : expectedStdoutsOR){ + if(pr.stdout.contains(s)) atLeastOne = true; + } + Assert.assertTrue("JToJSSet: the output should include at least one of expected Stdouts, but it didnt.", atLeastOne); + } + + private void javaToJSSetTest(String urlEnd, String[] expectedValsOR) throws Exception { + + if( doNotRunInOpera){ + Browsers b = server.getCurrentBrowser().getID(); + if(b == Browsers.opera){ + return; + } + } + + String strURL = "/JavascriptSet.html?" + urlEnd; + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + evaluateStdoutContents(expectedValsOR, pr); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_int_Test() throws Exception { + javaToJSSetTest("jjsSetInt", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_Integer_Test() throws Exception { + javaToJSSetTest("jjsSetInteger", new String[] {"2"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_double_Test() throws Exception { + javaToJSSetTest("jjsSetdouble", new String[] {"2.5"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_Double_Test() throws Exception { + javaToJSSetTest("jjsSetDouble", new String[] {"2.5"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_float_Test() throws Exception { + javaToJSSetTest("jjsSetfloat", new String[]{"2.5"}); //2.3->2.2999... + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_Float_Test() throws Exception { + javaToJSSetTest("jjsSetFloat", new String[] {"2.5"}); + } + + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_long_Test() throws Exception { + javaToJSSetTest("jjsSetlong", new String[] {"4294967296"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_Long_Test() throws Exception { + javaToJSSetTest("jjsSetLong", new String[] {"4294967297"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_short_Test() throws Exception { + javaToJSSetTest("jjsSetshort", new String[] {"3"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_Short_Test() throws Exception { + javaToJSSetTest("jjsSetShort", new String[] {"4"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_byte_Test() throws Exception { + javaToJSSetTest("jjsSetbyte", new String[] {"5"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_Byte_Test() throws Exception { + javaToJSSetTest("jjsSetByte", new String[] {"6"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_char_Test() throws Exception { + javaToJSSetTest("jjsSetchar", new String[] {"97"}); //i.e. 'a' + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_Character_Test() throws Exception { + javaToJSSetTest("jjsSetCharacter", new String[] {"97"}); //i.e. 'a' + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_boolean_Test() throws Exception { + javaToJSSetTest("jjsSetboolean", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_Boolean_Test() throws Exception { + javaToJSSetTest("jjsSetBoolean", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_String_Test() throws Exception { + javaToJSSetTest("jjsSetString", new String[] {"𠁎〒£$ǣ€𝍖"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_object_Test() throws Exception { + javaToJSSetTest("jjsSetObject", new String[] {"DummyObject2"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_1DArrayElement_Test() throws Exception { + javaToJSSetTest("jjsSet1DArray", new String[] {"100"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_2DArrayElement_Test() throws Exception { + javaToJSSetTest("jjsSet2DArray", new String[] {"200"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJToJSSet_JSObject_Test() throws Exception { + javaToJSSetTest("jjsSetJSObject", new String[] {"[object Window]","[object DOMWindow]", "[object Object]"}); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp 2013-05-03 19:08:24.852512555 +0000 @@ -0,0 +1,57 @@ + + + + + AWTRobot usage sample + IcedTea + + AWTRobot usage sample + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.java icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.java 2013-05-03 19:08:24.853512542 +0000 @@ -0,0 +1,166 @@ +/* JavawsAWTRobotFindsButton.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.applet.Applet; +import java.awt.Graphics; +import java.awt.Color; +import java.awt.Image; +import java.awt.Panel; +import java.awt.Button; +import java.awt.Dimension; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +public class JavawsAWTRobotFindsButton extends Applet { + + private static final String initStr = "JavawsAWTRobotFindsButton is ready for awt tests!"; + public static final String iconFile = "marker.png"; + + public static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender + public static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green + + public Image img; + public Panel panel; + + public void init(){ + img = getImage(getCodeBase(), iconFile); + + createGUI(); + + writeAppletInitialized(); + } + + //this method should be called by the extending applet + //when the whole gui is ready + public void writeAppletInitialized(){ + System.out.println(initStr); + } + + //paint the icon in upper left corner + @Override public void paint(Graphics g){ + int width = 32; + int height = 32; + int x = 0; + int y = 0; + g.drawImage(img, x, y, width, height, this); + super.paint(g); + } + + private Button createButton(String label, Color color) { + Button b = new Button(label); + b.setBackground(color); + b.setPreferredSize(new Dimension(100, 50)); + return b; + } + + // sets background of the applet + // and adds the panel with 2 buttons + private void createGUI() { + setBackground(APPLET_COLOR); + + panel = new Panel(); + panel.setBounds(33,33,267,267); + + Button bA = createButton("Button A", BUTTON_COLOR1); + + + bA.addMouseListener(new MouseListener() { + + public void mouseClicked(MouseEvent e) { + System.out.println("Mouse clicked button A."); + } + + @Override + public void mouseEntered(MouseEvent arg0) { + + } + + @Override + public void mouseExited(MouseEvent arg0) { + + } + + @Override + public void mousePressed(MouseEvent arg0) { + + } + + @Override + public void mouseReleased(MouseEvent arg0) { + + } + + }); + + panel.add(bA); + + + Button bB = createButton("Button B", BUTTON_COLOR1); + + + bB.addMouseListener(new MouseListener() { + + public void mouseClicked(MouseEvent e) { + System.out.println("Mouse clicked button B."); + } + + @Override + public void mouseEntered(MouseEvent e) { + + } + + @Override + public void mouseExited(MouseEvent e) { + + } + + @Override + public void mousePressed(MouseEvent e) { + + } + + @Override + public void mouseReleased(MouseEvent e) { + + } + }); + + panel.add(bB); + + this.add(panel); + } +} Binary files /tmp/NuT9CcZAiZ/icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/buttonA.png and /tmp/WZlglBfzlP/icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/buttonA.png differ diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java 2013-05-03 19:08:24.853512542 +0000 @@ -0,0 +1,138 @@ +/* JavawsAWTRobotFindsButtonTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.awt.Color; +import java.awt.event.InputEvent; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.awt.AWTFrameworkException; +import net.sourceforge.jnlp.awt.AWTHelper; +import net.sourceforge.jnlp.awt.imagesearch.ComponentFinder; +import net.sourceforge.jnlp.awt.imagesearch.ComponentNotFoundException; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.closinglisteners.Rule; + +import org.junit.Assert; +import org.junit.Test; + +public class JavawsAWTRobotFindsButtonTest { + + public static final ServerAccess server = new ServerAccess(); + + private final String initStr = "JavawsAWTRobotFindsButton is ready for awt tests!"; + private static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender + private static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green + + private static final BufferedImage buttonIcon; + + static{ + try { + buttonIcon = ImageIO.read(JavawsAWTRobotFindsButtonTest.class.getClassLoader().getResource("buttonA.png")); + } catch (IOException e) { + throw new RuntimeException("Problem initializing buttonIcon",e); + } + } + + private class AWTHelperImpl_ClickButtonIcon extends AWTHelper{ + + public AWTHelperImpl_ClickButtonIcon() { + super(initStr, 400, 400); + + this.setAppletColor(APPLET_COLOR); + } + + @Override + public void run() { + // move mouse into the button area and out + try { + clickOnIconExact(buttonIcon, InputEvent.BUTTON1_MASK); + } catch (ComponentNotFoundException e) { + Assert.fail("Button icon not found: "+e.getMessage()); + } + + } + } + + private void evaluateStdoutContents(ProcessResult pr, AWTHelper helper) { + + // Assert that the applet was initialized. + Rule i = helper.getInitStrAsRule(); + Assert.assertTrue(i.toPassingString(), i.evaluate(initStr)); + + // Assert there are all the test messages from applet + for (Rule r : helper.getRules() ) { + Assert.assertTrue(r.toPassingString(), r.evaluate(pr.stdout)); + } + + } + + + private void appletAWTMouseTest(String url, AWTHelper helper) throws Exception { + + String strURL = "/" + url; + + try { + ServerAccess.PROCESS_TIMEOUT = 40 * 1000;// ms + ProcessResult pr = server.executeJavaws(strURL, helper, helper); + evaluateStdoutContents(pr, helper); + } finally { + ServerAccess.PROCESS_TIMEOUT = 20 * 1000;// ms + } + } + + @Test + @NeedsDisplay + public void findAndClickButtonByIcon_Test() throws Exception { + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_ClickButtonIcon(); + helper.addClosingRulesFromStringArray(new String[] { "Mouse clicked button A." }); + appletAWTMouseTest("javaws-awtrobot-finds-button.jnlp", helper); + } + + @Test + public void iconFileLoaded_Test() throws IOException { + Assert.assertNotNull("buttonIcon should not be null", buttonIcon); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSample.html icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSample.html --- icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSample.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSample.html 2013-05-03 19:08:24.854512529 +0000 @@ -0,0 +1,72 @@ + + + + + AWTRobot usage sample page with an applet + + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + + +
    + +
    +
    +
    + +
    + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp 2013-05-03 19:08:24.854512529 +0000 @@ -0,0 +1,57 @@ + + + + + AWTRobot usage sample + IcedTea + + AWTRobot usage sample + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.java icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.java 2013-05-03 19:08:24.855512516 +0000 @@ -0,0 +1,176 @@ +/* JavawsAWTRobotUsageSample.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.applet.Applet; +import java.awt.Graphics; +import java.awt.Color; +import java.awt.Image; +import java.awt.Panel; +import java.awt.Button; +import java.awt.Dimension; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +public class JavawsAWTRobotUsageSample extends Applet { + + private static final String initStr = "JavawsAWTRobotUsageSample is ready for awt tests!"; + public static final String iconFile = "marker.png"; + + public static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender + public static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green + + public Image img; + public Panel panel; + + public void init(){ + img = getImage(getCodeBase(), iconFile); + + createGUI(); + + writeAppletInitialized(); + } + + //this method should be called by the extending applet + //when the whole gui is ready + public void writeAppletInitialized(){ + System.out.println(initStr); + } + + //paint the icon in upper left corner + @Override public void paint(Graphics g){ + int width = 32; + int height = 32; + int x = 0; + int y = 0; + g.drawImage(img, x, y, width, height, this); + super.paint(g); + } + + private Button createButton(String label, Color color) { + Button b = new Button(label); + b.setBackground(color); + b.setPreferredSize(new Dimension(100, 50)); + return b; + } + + // sets background of the applet and adds the panel with one button + private void createGUI() { + setBackground(APPLET_COLOR); + + panel = new Panel(); + panel.setBounds(33,33,267,267); + + Button b = createButton("", BUTTON_COLOR1); + + b.addMouseMotionListener(new MouseMotionListener() { + public void mouseDragged(MouseEvent e) { + System.out.println("mouseDragged"); + } + + public void mouseMoved(MouseEvent e) { + System.out.println("mouseMoved"); + } + }); + + b.addMouseListener(new MouseListener() { + + public void mouseClicked(MouseEvent e) { + // figure out which mouse button is pressed + switch (e.getButton()) { + case MouseEvent.BUTTON1: + System.out.println("mouseClickedButton1"); + break; + case MouseEvent.BUTTON2: + System.out.println("mouseClickedButton2"); + break; + case MouseEvent.BUTTON3: + System.out.println("mouseClickedButton3"); + break; + default: + break; + } + } + + public void mouseEntered(MouseEvent e) { + System.out.println("mouseEntered"); + } + + public void mouseExited(MouseEvent e) { + System.out.println("mouseExited"); + } + + public void mousePressed(MouseEvent e) { + // figure out which mouse button is pressed + switch (e.getButton()) { + case MouseEvent.BUTTON1: + System.out.println("mousePressedButton1"); + break; + case MouseEvent.BUTTON2: + System.out.println("mousePressedButton2"); + break; + case MouseEvent.BUTTON3: + System.out.println("mousePressedButton3"); + break; + default: + break; + } + } + + public void mouseReleased(MouseEvent e) { + // figure out which mouse button was pressed + switch (e.getButton()) { + case MouseEvent.BUTTON1: + System.out.println("mouseReleasedButton1"); + break; + case MouseEvent.BUTTON2: + System.out.println("mouseReleasedButton2"); + break; + case MouseEvent.BUTTON3: + System.out.println("mouseReleasedButton3"); + break; + default: + break; + } + } + }); + + panel.add(b); + + this.add(panel); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSampleTest.java icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSampleTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSampleTest.java 2013-05-03 19:08:24.855512516 +0000 @@ -0,0 +1,256 @@ +/* AppletAWTRobotUsageSampleTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.awt.AWTException; +import java.awt.Color; +import java.awt.event.InputEvent; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.awt.AWTFrameworkException; +import net.sourceforge.jnlp.awt.AWTHelper; +import net.sourceforge.jnlp.awt.imagesearch.ComponentNotFoundException; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.Rule; + +import org.junit.Assert; +import org.junit.Test; + +public class AppletAWTRobotUsageSampleTest extends BrowserTest { + + private final String initStr = "JavawsAWTRobotUsageSample is ready for awt tests!"; + + private static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender + private static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green + + private abstract class AWTHelperImpl extends AWTHelper{ + + public AWTHelperImpl() { + super(initStr, 400, 400); + + this.setAppletColor(APPLET_COLOR); + } + + } + + private class AWTHelperImpl_EnterExit extends AWTHelperImpl { + + @Override + public void run() { + // move mouse into the button area and out + try { + moveToMiddleOfColoredRectangle(BUTTON_COLOR1); + moveOutsideColoredRectangle(BUTTON_COLOR1); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseClick1 extends AWTHelperImpl{ + + @Override + public void run() { + // click in the middle of the button + + try { + clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON1_MASK); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseClick2 extends AWTHelperImpl{ + @Override + public void run() { + // move mouse in the middle of the button and click 2nd + // button + try { + clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON2_MASK); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseClick3 extends AWTHelperImpl{ + @Override + public void run() { + // move mouse in the middle of the button and click 3rd + // button + try { + clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON3_MASK); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseDrag extends AWTHelperImpl{ + @Override + public void run() { + // move into the rectangle, press 1st button, drag out + try { + dragFromColoredRectangle(BUTTON_COLOR1); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseMove extends AWTHelperImpl{ + @Override + public void run() { + clickInTheMiddleOfApplet(); + try { + moveInsideColoredRectangle(BUTTON_COLOR1); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + + private void evaluateStdoutContents(ProcessResult pr, AWTHelper helper) { + + // Assert that the applet was initialized. + Rule i = helper.getInitStrAsRule(); + Assert.assertTrue(i.toPassingString(), i.evaluate(initStr)); + + // Assert there are all the test messages from applet + for (Rule r : helper.getRules() ) { + Assert.assertTrue(r.toPassingString(), r.evaluate(pr.stdout)); + } + + } + + + private void appletAWTMouseTest(String url, AWTHelper helper) + throws Exception { + + String strURL = "/" + url; + + ProcessResult pr = server.executeBrowser(strURL, helper, helper); + evaluateStdoutContents(pr, helper); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + @NeedsDisplay + public void AppletAWTMouse_EnterAndExit_Test() throws Exception { + + // display the page, activate applet, move over the button + AWTHelper helper = new AWTHelperImpl_EnterExit(); + helper.addClosingRulesFromStringArray(new String[] { "mouseEntered", "mouseExited"}); + appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + @NeedsDisplay + public void AppletAWTMouse_ClickButton1_Test() throws Exception { + + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseClick1(); + helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton1", "mouseReleasedButton1", "mouseClickedButton1" }); + appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + @NeedsDisplay + public void AppletAWTMouse_ClickButton2_Test() throws Exception { + + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseClick2(); + helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton2", "mouseReleasedButton2", "mouseClickedButton2" }); + appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + @NeedsDisplay + public void AppletAWTMouse_ClickButton3_Test() throws Exception { + + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseClick3(); + helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton3", "mouseReleasedButton3", "mouseClickedButton3" }); + appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + @NeedsDisplay + public void AppletAWTMouse_Drag_Test() throws Exception { + + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseDrag(); + helper.addClosingRulesFromStringArray(new String[] { "mouseDragged" }); + appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); + } + + @Test + @TestInBrowsers(testIn = { Browsers.one }) + @NeedsDisplay + public void AppletAWTMouse_Move_Test() throws Exception { + + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseMove(); + helper.addClosingRulesFromStringArray(new String[] { "mouseMoved" }); + appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSampleTest.java icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSampleTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSampleTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSampleTest.java 2013-05-03 19:08:24.856512503 +0000 @@ -0,0 +1,249 @@ +/* JavawsAWTRobotUsageSampleTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.awt.Color; +import java.awt.event.InputEvent; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.awt.AWTFrameworkException; +import net.sourceforge.jnlp.awt.AWTHelper; +import net.sourceforge.jnlp.awt.imagesearch.ComponentNotFoundException; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.closinglisteners.Rule; + +import org.junit.Assert; +import org.junit.Test; + +public class JavawsAWTRobotUsageSampleTest { + + public static final ServerAccess server = new ServerAccess(); + + private final String initStr = "JavawsAWTRobotUsageSample is ready for awt tests!"; + private static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender + private static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green + + private abstract class AWTHelperImpl extends AWTHelper{ + + public AWTHelperImpl() { + super(initStr, 400, 400); + + this.setAppletColor(APPLET_COLOR); + } + + } + + private class AWTHelperImpl_EnterExit extends AWTHelperImpl { + + @Override + public void run() { + // move mouse into the button area and out + try { + moveToMiddleOfColoredRectangle(BUTTON_COLOR1); + moveOutsideColoredRectangle(BUTTON_COLOR1); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseClick1 extends AWTHelperImpl{ + + @Override + public void run() { + // click in the middle of the button + + try { + clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON1_MASK); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseClick2 extends AWTHelperImpl{ + @Override + public void run() { + // move mouse in the middle of the button and click 2nd + // button + try { + clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON2_MASK); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseClick3 extends AWTHelperImpl{ + @Override + public void run() { + // move mouse in the middle of the button and click 3rd + // button + try { + clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON3_MASK); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseDrag extends AWTHelperImpl{ + @Override + public void run() { + // move into the rectangle, press 1st button, drag out + try { + dragFromColoredRectangle(BUTTON_COLOR1); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + private class AWTHelperImpl_MouseMove extends AWTHelperImpl{ + @Override + public void run() { + clickInTheMiddleOfApplet(); + try { + moveInsideColoredRectangle(BUTTON_COLOR1); + } catch (ComponentNotFoundException e) { + Assert.fail("Button not found: "+e.getMessage()); + } catch (AWTFrameworkException e2){ + Assert.fail("AWTFrameworkException: "+e2.getMessage()); + } + } + } + + + private void evaluateStdoutContents(ProcessResult pr, AWTHelper helper) { + + // Assert that the applet was initialized. + Rule i = helper.getInitStrAsRule(); + Assert.assertTrue(i.toPassingString(), i.evaluate(initStr)); + + // Assert there are all the test messages from applet + for (Rule r : helper.getRules() ) { + Assert.assertTrue(r.toPassingString(), r.evaluate(pr.stdout)); + } + + } + + + private void appletAWTMouseTest(String url, AWTHelper helper) + throws Exception { + + String strURL = "/" + url; + + try { + ServerAccess.PROCESS_TIMEOUT = 40 * 1000;// ms + ProcessResult pr = server.executeJavaws(strURL, helper, helper); + evaluateStdoutContents(pr, helper); + } finally { + ServerAccess.PROCESS_TIMEOUT = 20 * 1000;// ms + } + } + + @Test + @NeedsDisplay + public void AppletAWTMouse_EnterAndExit_Test() throws Exception { + // display the page, activate applet, move over the button + AWTHelper helper = new AWTHelperImpl_EnterExit(); + helper.addClosingRulesFromStringArray(new String[] { "mouseEntered", "mouseExited"}); + appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); + } + + @Test + @NeedsDisplay + public void AppletAWTMouse_ClickButton1_Test() throws Exception { + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseClick1(); + helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton1", "mouseReleasedButton1", "mouseClickedButton1" }); + appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); + } + + @Test + @NeedsDisplay + public void AppletAWTMouse_ClickButton2_Test() throws Exception { + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseClick2(); + helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton2", "mouseReleasedButton2", "mouseClickedButton2" }); + appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); + } + + @Test + @NeedsDisplay + public void AppletAWTMouse_ClickButton3_Test() throws Exception { + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseClick3(); + helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton3", "mouseReleasedButton3", "mouseClickedButton3" }); + appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); + } + + @Test + @NeedsDisplay + public void AppletAWTMouse_Drag_Test() throws Exception { + + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseDrag(); + helper.addClosingRulesFromStringArray(new String[] { "mouseDragged" }); + appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); + } + + @Test + @NeedsDisplay + public void AppletAWTMouse_Move_Test() throws Exception { + // display the page, activate applet, click on button + AWTHelper helper = new AWTHelperImpl_MouseMove(); + helper.addClosingRulesFromStringArray(new String[] { "mouseMoved" }); + appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.html icedtea-web-1.4/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.html --- icedtea-web-1.3.2/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.html 2013-05-03 19:08:24.829512844 +0000 @@ -0,0 +1,54 @@ + + + + + + + + + + + \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.js icedtea-web-1.4/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.js --- icedtea-web-1.3.2/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.js 2013-05-03 19:08:24.829512844 +0000 @@ -0,0 +1,22 @@ +function testJSObjectFromEval() { + var applet = document.getElementById("applet"); + var obj; + + applet.output("*** Test JSObject from JS ***"); + + applet.output("JS create"); + obj = new Object(); + applet.output("Java set"); + applet.setJSMember(obj, "test", 0); + applet.output("obj.test = " + obj.test); + + applet.output("*** Test JSObject from Java ***"); + + applet.output("Java create"); + obj = applet.newJSObject(); + applet.output("Java set"); + applet.setJSMember(obj, "test", 0); + applet.output("obj.test = " + obj.test); + + applet.output("*** APPLET FINISHED ***"); //We're done here +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java icedtea-web-1.4/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java 2013-05-03 19:08:24.830512831 +0000 @@ -0,0 +1,60 @@ +/* +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.applet.Applet; + +import netscape.javascript.JSObject; + +public class JSObjectFromEval extends Applet { + @Override + public void start() { + System.out.println(getClass().getSimpleName() + " started."); + } + + public void output(String s) { + System.out.println(s); + } + + public JSObject newJSObject() { + JSObject win = JSObject.getWindow(this); + return (JSObject) win.eval("new Object()"); + } + + public void setJSMember(JSObject js, String memb, Object val) { + js.setMember(memb, val); + } +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java icedtea-web-1.4/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java 2013-05-03 19:08:24.830512831 +0000 @@ -0,0 +1,86 @@ +/* +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import static org.junit.Assert.assertTrue; + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; + +import org.junit.Test; + +public class JSObjectFromEvalTest extends BrowserTest { + + private static final String END_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; + + private static final String JAVA_CREATE = "Java create\n"; + private static final String JS_CREATE = "JS create\n"; + private static final String JAVA_SET = "Java set\n"; + private static final String CORRECT_VALUE = "obj.test = 0"; + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @Bug(id = { "PR1198" }) + public void testJSObjectSetMemberIsSet() throws Exception { + ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html", + AutoClose.CLOSE_ON_BOTH); + + String expectedJSCreateOutput = JS_CREATE + JAVA_SET + CORRECT_VALUE; + String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET + + CORRECT_VALUE; + + // No reason JS create should fail, this is mostly a sanity check: + assertTrue("stdout should contain 'JS create [...] " + CORRECT_VALUE + + "' but did not.", pr.stdout.contains(expectedJSCreateOutput)); + + // Demonstrates PR1198: + assertTrue("stdout should contain 'Java create [...] " + CORRECT_VALUE + + "' but did not.", + pr.stdout.contains(expectedJavaCreateOutput)); + + // Make sure we got to the end of the script + assertTrue("stdout should contain '" + END_STRING + "' but did not.", + pr.stdout.contains(END_STRING)); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js 2013-05-03 19:08:24.831512818 +0000 @@ -0,0 +1,18 @@ +//dummy javascript class whose instance is passed as JSObject parameter: +function JSCar(mph,color){ + this.mph = mph; + this.color = color; +} + +//the main routine used for all tests: +function doFuncParamTests( ){ + + var urlArgs = document.URL.split("?"); + var testParams = urlArgs[1].split(";"); + var applet = document.getElementById('jstojFuncParamApplet'); + var func = testParams[0]; + var value = decodeURIComponent(testParams[1]); + + eval('applet.' + func + '(' + value + ')'); + applet.writeAfterTest(); +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html 2013-05-03 19:08:24.831512818 +0000 @@ -0,0 +1,23 @@ + + + + JavaScript to Java LiveConnect - function parameter conversion + + + + + + + +

    The JSToJFuncParam html page

    + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp 2013-05-03 19:08:24.831512818 +0000 @@ -0,0 +1,23 @@ + + + + + JavaScript to Java LiveConnect - FuncParam + IcedTea + + LiveConnect - tests for function parameter conversion when calling Java from JS. + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java 2013-05-03 19:08:24.832512805 +0000 @@ -0,0 +1,114 @@ +import java.applet.Applet; +import java.util.Arrays; +import netscape.javascript.JSObject; + +public class JSToJFuncParam extends Applet { + + public void init() { + String initStr = "JSToJFuncParam applet initialized."; + System.out.println(initStr); + } + + public void intParam(int i) { + System.out.println("intParam "+i); + } + + public void doubleParam(double d) { + System.out.println("doubleParam "+d); + } + + public void floatParam(float f) { + System.out.println("floatParam "+f); + } + + public void longParam(long l) { + System.out.println("longParam "+l); + } + + public void booleanParam(boolean b) { + System.out.println("booleanParam "+b); + } + + public void charParam(char c) { + System.out.println("charParam "+c); + } + + public void byteParam(byte b) { + System.out.println("byteParam "+b); + } + + public void charArrayParam(char[] ca) { + System.out.println("charArrayParam "+Arrays.toString(ca)); + } + + public void StringParam(String s) { + System.out.println("StringParam "+s); + } + + public void IntegerParam(Integer p) { + System.out.println("IntegerParam "+p); + } + + public void DoubleParam(Double p) { + System.out.println("DoubleParam "+p); + } + + public void FloatParam(Float p) { + System.out.println("FloatParam "+p); + } + + public void LongParam(Long p) { + System.out.println("LongParam "+p); + } + + public void BooleanParam(Boolean p) { + System.out.println("BooleanParam "+p); + } + + public void CharacterParam(Character p) { + System.out.println("CharacterParam "+p); + } + + public void ByteParam(Byte p) { + System.out.println("ByteParam "+p); + } + + public void StringIntMixedParam(String[] s) { + System.out.println("StringIntMixedParam "+Arrays.toString(s)); + } + + public void DummyObjectArrayParam(DummyObject[] ca) { + System.out.println("DummyObjectArrayParam "+Arrays.toString(ca)); + } + + public void JSObjectParam(JSObject car){ + Integer mph = (Integer)car.getMember("mph"); + String color = (String)car.getMember("color"); + + System.out.println("JSObjectParam "+mph+", "+color); + } + + public void writeAfterTest(){ + System.out.println("afterTests"); + } + + public class DummyObject { + private String str; + + public DummyObject(String s) { + this.str = s; + } + + public void setStr(String s) { + this.str = s; + } + + public String toString() { + return str; + } + } + + public DummyObject getNewDummyObject(String str){ + return new DummyObject(str); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java 2013-05-03 19:08:24.832512805 +0000 @@ -0,0 +1,236 @@ +/* JSToJFuncParamTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Assert; + +import org.junit.Test; + +public class JSToJFuncParamTest extends BrowserTest { + + //the JS<->J tests tend to make Opera unusable + public final boolean doNotRunInOpera = true; + + private final String initStr = "JSToJFuncParam applet initialized."; + private final String afterStr = "afterTests"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + return (s.contains(initStr) && s.contains(afterStr)); + } + } + + private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JSToJFuncParam: the stdout should contain " + initStr + + ", but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the values set by JavaScript are ok + Assert.assertTrue("JSToJFuncParam: the output should include: "+expectedStdout+", but it didnt.", pr.stdout.contains(expectedStdout)); + + } + + private void jsToJavaFuncParamTest(String funcStr, String paramStr, String expectedVal) throws Exception { + + if( doNotRunInOpera){ + if(server.getCurrentBrowser().getID() == Browsers.opera){ + return; + } + } + + String strURL = "/JSToJFuncParam.html?" + funcStr + ";" + paramStr; + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + String expectedStdout = funcStr + " " + expectedVal; + evaluateStdoutContents(expectedStdout, pr); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_int_Test() throws Exception { + jsToJavaFuncParamTest("intParam", "1", "1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_double_Test() throws Exception { + jsToJavaFuncParamTest("doubleParam", "1.1", "1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_float_Test() throws Exception { + jsToJavaFuncParamTest("floatParam", "1.1", "1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_long_Test() throws Exception { + jsToJavaFuncParamTest("longParam", "10000", "10000"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_boolean_Test() throws Exception { + jsToJavaFuncParamTest("booleanParam", "true", "true"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_char_Test() throws Exception { + jsToJavaFuncParamTest("charParam", "97", "a"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_byte_Test() throws Exception { + jsToJavaFuncParamTest("byteParam", "10", "10"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_charArray_Test() throws Exception { + jsToJavaFuncParamTest("charArrayParam", "[97,98,99]", "[a, b, c]"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_String_Test() throws Exception { + jsToJavaFuncParamTest("StringParam", "\"test\"", "test"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_Integer_Test() throws Exception { + jsToJavaFuncParamTest("IntegerParam", "1", "1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_Double_Test() throws Exception { + jsToJavaFuncParamTest("DoubleParam", "1.1", "1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_Float_Test() throws Exception { + jsToJavaFuncParamTest("FloatParam", "1.1", "1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_Long_Test() throws Exception { + jsToJavaFuncParamTest("LongParam", "10000", "10000"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_Boolean_Test() throws Exception { + jsToJavaFuncParamTest("BooleanParam", "true", "true"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_Character_Test() throws Exception { + jsToJavaFuncParamTest("CharacterParam", "new applet.Packages.java.lang.Character(65)", "A"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_Byte_Test() throws Exception { + jsToJavaFuncParamTest("ByteParam", "10", "10"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_StringIntMixed_Test() throws Exception { + jsToJavaFuncParamTest("StringIntMixedParam", "[\"test\",123]", "[test, 123]"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_DummyObjectArray_Test() throws Exception { + jsToJavaFuncParamTest("DummyObjectArrayParam", "[applet.getNewDummyObject(\"Dummy1\"),applet.getNewDummyObject(\"Dummy2\")]", "[Dummy1, Dummy2]"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_JSObject_Test() throws Exception { + jsToJavaFuncParamTest("JSObjectParam", "new JSCar(100,\"red\")", "100, red"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_booleanFalseStr_Test() throws Exception { + jsToJavaFuncParamTest("booleanParam", "false", "true"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncParam_BooleanFalseStr_Test() throws Exception { + jsToJavaFuncParamTest("BooleanParam", "false", "true"); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js 2013-05-03 19:08:24.833512792 +0000 @@ -0,0 +1,11 @@ +function doFuncResolTests(){ + + var urlArgs = document.URL.split("?"); + var testParams = urlArgs[1].split(";"); + var applet = document.getElementById('jstojFuncResolApplet'); + var func = testParams[0]; + var value = decodeURIComponent(testParams[1]); + + eval('applet.' + func + '(' + value + ')'); + applet.writeAfterTests(); +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html 2013-05-03 19:08:24.833512792 +0000 @@ -0,0 +1,25 @@ + + + + JavaScript to Java LiveConnect - FuncResol values from applet + + + + + + + +

    The JSToJFuncResol html page

    + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp 2013-05-03 19:08:24.834512780 +0000 @@ -0,0 +1,23 @@ + + + + + JavaScript to Java LiveConnect - FuncResol + IcedTea + + LiveConnect - tests for overloaded function resolution when calling Java functions from JS. + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java 2013-05-03 19:08:24.834512780 +0000 @@ -0,0 +1,235 @@ +import java.applet.Applet; +import netscape.javascript.JSObject; + +public class JSToJFuncResol extends Applet { + + /****** Primitive (numeric) value resolutions ******/ + + /* Javascript primitive numeric (int) value resolutions: + * - to an analogous primitive Java type (best - lowest cost) + * - to another primitive numeric Java type (long) (second lowest) + * - to Java String type (third lowest) + */ + + public void numeric( int p){ + System.out.println("numeric(int) with "+p); + } + + public void numeric(long p) { + System.out.println("numeric(long) with "+p); + } + + public void numeric(String p) { + System.out.println("numeric(String) with "+p); + } + + /* Javascript primitive numeric (int) value resolutions: + * - to a different primitive Java numeric type (double) (best - second lowest cost) + * - to Java string (third lowest cost) + */ + + public void numericToDifferentNumeric(double p) { + System.out.println("numericToDifferentNumeric(double) with "+p); + } + + public void numericToDifferentNumeric(String p) { + System.out.println("numericToDifferentNumeric(String) with "+p); + } + + /* Javascript primitive numeric (floating point) value resolutions: + * - to a primitive Java numeric type (double) (best - lowest cost) + * - to Java char + */ + + public void numericToDouble(double p) { + System.out.println("numericToDouble(double) with "+p); + } + + public void numericToDouble(char p) { + System.out.println("numericToDouble(char) with "+p); + } + + + + /****** Null resolutions ******/ + + /* Javascript null value resolutions: + * - to any nonprimitive Java type (e.g. Integer) (best) + * - to a primitive Java type (int) (not allowed) + */ + + public void nullToInteger(Integer p) { + + System.out.println("nullToInteger(Integer) with "+p); + } + + public void nullToInteger(int p) { + System.out.println("nullToInteger(int) with "+p); + } + + /****** Java inherited class resolutions ******/ + + /* Java inherited class (OverloadTestHelper2) value resolutions: + * - to the same class type (OverloadTestHelper2) (best) + * - to a superclass (OverloadTestHelper1) (second best) + * - to a subclass (OverloadTestHelper3) (not possible) + */ + + public void inheritedClass(OverloadTestHelper2 p) { + System.out.println("inheritedClass(OverloadTestHelper2) with "+p); + } + + public void inheritedClass(OverloadTestHelper1 p) { + System.out.println("inheritedClass(OverloadTestHelper1) with "+p); + } + + public void inheritedClass(OverloadTestHelper3 p) { + System.out.println("inheritedClass(OverloadTestHelper3) with "+p); + } + + /* Java inherited class (OverloadTestHelper3) value resolutions: + * - to a superclass (OverloadTestHelper2) (best - second lowest cost) + * - to a superclass of superclass (OverloadTestHelper1) (higher cost) + */ + + public void inheritedClassToParent1(OverloadTestHelper2 p) { + System.out.println("inheritedClassToParent1(OverloadTestHelper2) with "+p); + } + + public void inheritedClassToParent1(OverloadTestHelper1 p) { + System.out.println("inheritedClassToParent1(OverloadTestHelper1) with "+p); + } + + /* Java inherited class (OverloadTestHelper2) resolutions: + * - to the superclass (OverloadTestHelper1) (best - second lowest cost) + * - to Java String (third lowest cost) + */ + + public void inheritedClassToParent2(OverloadTestHelper1 p) { + System.out.println("inheritedClassToParent2(OverloadTestHelper1) with "+p); + } + + public void inheritedClassToParent2(String p) { + System.out.println("inheritedClassToParent2(String) with "+p); + } + + + /****** Java object resolutions ******/ + + /* Java object (OverloadTestHelper1) value resolutions: + * - to Java String (best - third lowest cost) + * - to a different nonprimitive Java class (JSObject) (not possible) + */ + + public void javaObjectToString(String p) { + System.out.println("javaObjectToString(String) with "+p); + } + + public void javaObjectToString(JSObject p) { + System.out.println("javaObjectToString(JSObject) with "+p); + } + + /****** String resolutions ******/ + + /* Javascript string value resolutions: + * - to a primitive numeric Java type (double) (best - second lowest cost) + * - to a nonprimitive Java class (OverloadTestHelper1 as a dummy)(not possible) + */ + + public void javascriptStringToNumeric(double p) { + System.out.println("javascriptStringToNumeric(double) with "+p); + } + + public void javascriptStringToNumeric(OverloadTestHelper1 p) { + System.out.println("javascriptStringToNumeric(OverloadTestHelper1) with "+p); + } + + /****** Javascript object resolutions ******/ + + /* Javascript object value resolutions: + * - to JSObject Java type (best - lowest cost) + * - to Java String type (fourth lowest cost) + * - to Java array of Strings (fourth lowest cost) + * - to a Java superclass (Object) (second lowest cost) + */ + + public void javascriptObject(JSObject p) { + System.out.println("javascriptObject(JSObject) with "+p); + } + + public void javascriptObject(String p) { + System.out.println("javascriptObject(String) with "+p); + } + + public void javascriptObject(String[] p) { + System.out.println("javascriptObject(String[]) with "+p); + } + + public void javascriptObject(Object p) { + System.out.println("javascriptObject(Object) with "+p); + } + + /* Javascript object (array) value resolutions: + * - to a Java array of primitive numeric Java type (int[]) (best - fourth lowest cost) + * - to a nonprimitive Java class Integer (impossible) + */ + + public void javascriptObjectToArray(int[] p) { + System.out.println("javascriptObjectToArray(int[]) with "+p); + } + + public void javascriptObjectToArray(Integer p) { + System.out.println("javascriptObjectToArray(Integer) with "+p); + } + + + /****** Not allowed resolutions *******/ + + /* Impossible resolutions all should result in + * "Error on Java side: No suitable method named ... with matching args found" + * - null to a primitive numeric Java type (int) + * - JSObject (window) to a different nonprimitive Java class (OverloadTestHelper1) + * - non-array value (numeric primitive 25) to array + */ + + public void nullToPrimitive(int p) { + System.out.println("nullToPrimitive(int) with "+p); + } + + public void javascriptObjectToUnrelatedType(OverloadTestHelper1 p) { + System.out.println("javascriptObjectToUnrelatedType(OverloadTesthelper1) with "+p); + } + + public void unsupported(Object[] p) { + System.out.println("unsupported(Object[]) with "+p); + } + + /****** Auxiliary methods and classes ******/ + + public void init() { + String initStr = "JSToJFuncResol applet initialized."; + System.out.println(initStr); + } + + public void writeAfterTests(){ + System.out.println("afterTests"); + } + + //dummy classes for passing objects as function parameters + public class OverloadTestHelper1 {}; + public class OverloadTestHelper2 extends OverloadTestHelper1 {}; + public class OverloadTestHelper3 extends OverloadTestHelper2 {}; + + public OverloadTestHelper1 getNewOverloadTestHelper1(){ + return new OverloadTestHelper1(); + } + + public OverloadTestHelper2 getNewOverloadTestHelper2(){ + return new OverloadTestHelper2(); + } + + public OverloadTestHelper3 getNewOverloadTestHelper3(){ + return new OverloadTestHelper3(); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java 2013-05-03 19:08:24.835512768 +0000 @@ -0,0 +1,193 @@ +/* JSToJFuncResolTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.annotations.KnownToFail; +import org.junit.Assert; +import org.junit.Test; + +public class JSToJFuncResolTest extends BrowserTest { + + private final String initStr = "JSToJFuncResol applet initialized."; + private final String afterStr = "afterTests"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + + return (s.contains(initStr) && s.contains(afterStr)); + } + } + + private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JSToJFuncResol: the stdout should contain " + initStr + + ", but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the values set by JavaScript are ok + Assert.assertTrue("JSToJFuncResol: the output should include: "+expectedStdout+", but it didnt.", + pr.stdout.contains(expectedStdout)); + + } + + private void jsToJavaFuncResolTest( String methodStr, String valueStr, String expectedStdout) throws Exception { + String strURL = "/JSToJFuncResol.html?" + methodStr + ";" + valueStr; + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + evaluateStdoutContents(expectedStdout, pr); + } + + /****** Primitive (numeric) value resolutions ******/ + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_numeric_Test() throws Exception { + jsToJavaFuncResolTest("numeric", "1", "numeric(int) with 1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_numericToDifferentNumeric_Test() throws Exception { + jsToJavaFuncResolTest("numericToDifferentNumeric", "1.1", "numericToDifferentNumeric(double) with 1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJFuncResol_numericToDouble_Test() throws Exception { + jsToJavaFuncResolTest("numericToDouble", "1.1", "numericToDouble(double) with 1.1"); + } + + /****** Null resolutions ******/ + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_nullToInteger_Test() throws Exception { + jsToJavaFuncResolTest("nullToInteger", "null", "nullToInteger(Integer) with null"); + } + + /****** Java inherited class resolutions ******/ + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_inheritedClass_Test() throws Exception { + jsToJavaFuncResolTest("inheritedClass", "applet.getNewOverloadTestHelper2()", "inheritedClass(OverloadTestHelper2) with JSToJFuncResol$OverloadTestHelper2@"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_inheritedClassToParent1_Test() throws Exception { + jsToJavaFuncResolTest("inheritedClassToParent1", "applet.getNewOverloadTestHelper3()", "inheritedClassToParent1(OverloadTestHelper2) with JSToJFuncResol$OverloadTestHelper3@"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_inheritedClassToParent2_Test() throws Exception { + jsToJavaFuncResolTest("inheritedClassToParent2", "applet.getNewOverloadTestHelper2()", "inheritedClassToParent2(OverloadTestHelper1) with JSToJFuncResol$OverloadTestHelper2@"); + } + + /****** Java object resolutions ******/ + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_javaObjectToString_Test() throws Exception { + jsToJavaFuncResolTest("javaObjectToString", "applet.getNewOverloadTestHelper1()", "javaObjectToString(String) with JSToJFuncResol$OverloadTestHelper1@"); + } + + /****** String resolutions ******/ + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_javascriptStringToNumeric_Test() throws Exception { + jsToJavaFuncResolTest("javascriptStringToNumeric", "\"1.1\"", "javascriptStringToNumeric(double) with 1.1"); + } + + /****** Javascript object resolutions ******/ + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_javascriptObject_Test() throws Exception { + jsToJavaFuncResolTest("javascriptObject", "window", "javascriptObject(JSObject) with [object Window]"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_javascriptObjectToArray_Test() throws Exception { + jsToJavaFuncResolTest("javascriptObjectToArray", "[10]", "javascriptObjectToArray(int[]) with [I@"); + } + + /****** The unsupported resolutions: *****/ + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_nullToPrimitive_Test() throws Exception { + jsToJavaFuncResolTest("nullToPrimitive", "null", "Error on Java side: No suitable method named nullToPrimitive with matching args found"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_javascriptObjectToUnrelatedType_Test() + throws Exception { + jsToJavaFuncResolTest("javascriptObjectToUnrelatedType", "window", "Error on Java side: No suitable method named javascriptObjectToUnrelatedType with matching args found"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncResol_unsupported_Test() throws Exception { + jsToJavaFuncResolTest("unsupported", "25", "Error on Java side: No suitable method named unsupported with matching args found"); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJava_FuncReturn.js icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJava_FuncReturn.js --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJava_FuncReturn.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJava_FuncReturn.js 2013-05-03 19:08:24.835512768 +0000 @@ -0,0 +1,17 @@ +function doFuncReturnTests(){ + var urlArgs = document.URL.split("?"); + var applet = document.getElementById('jstojFuncReturnApplet'); + var method = urlArgs[1]; + + eval('var value = applet.' + method + '()'); + + var checked_string = typeof(value)+' '; + if( method === '_JSObject'){ + checked_string = checked_string +value.key1; + }else{ + checked_string = checked_string +value; + } + + applet.printStringAndFinish(checked_string); +} + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJFuncReturn.html icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJFuncReturn.html --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJFuncReturn.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJFuncReturn.html 2013-05-03 19:08:24.835512768 +0000 @@ -0,0 +1,26 @@ + + + + JavaScript to Java LiveConnect - Function return values from applet + + + + + + + +

    The JSToJFuncReturn html page

    + + + + + + +
    + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/resources/jstoj-funcreturn.jnlp icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/resources/jstoj-funcreturn.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/resources/jstoj-funcreturn.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/resources/jstoj-funcreturn.jnlp 2013-05-03 19:08:24.836512756 +0000 @@ -0,0 +1,23 @@ + + + + + JavaScript to Java LiveConnect - FuncReturn + RedHat + + LiveConnect - tests to process various return types from Java side function calls. + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/srcs/JSToJFuncReturn.java icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/srcs/JSToJFuncReturn.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/srcs/JSToJFuncReturn.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/srcs/JSToJFuncReturn.java 2013-05-03 19:08:24.836512756 +0000 @@ -0,0 +1,142 @@ +import java.applet.Applet; +import java.awt.Label; +import java.awt.BorderLayout; +import netscape.javascript.JSObject; + +public class JSToJFuncReturn extends Applet { + + private Label statusLabel; + + public int _int() { + int i = 1; + return i; + } + + public double _double() { + double d = 1.1; + return d; + } + + public float _float() { + float f = 1.1F; + return f; + } + + public long _long() { + long l = 10000L; + return l; + } + + public boolean _boolean() { + boolean b = true; + return b; + } + + public char _char() { + char c = 'a'; + return c; + } + + public byte _byte() { + byte by = 10; + return by; + } + + public char _charArrayElement(){ + char[] ca = new char[]{'a', 'b', 'c'}; + + return ca[0]; + } + + public char[] _charArray() { + char[] ca = new char[]{'a', 'b', 'c'}; + + return ca; + } + + public String _regularString() { + String rs = "test"; + return rs; + } + + public String _specialString() { + String ss = "𠁎〒£$ǣ€𝍖"; + return ss; + } + + public void _void() { + } + + public Object _null() { + return null; + } + + public Integer _Integer() { + Integer I = 1; + return I; + } + + public Double _Double() { + Double D = 1.1; + return D; + } + + public Float _Float() { + Float F = 1.1F; + return F; + } + + public Long _Long() { + Long L = 10000L; + return L; + } + + public Boolean _Boolean() { + Boolean B = true; + return B; + } + + public Character _CharacterArrayElement(){ + Character[] Ca = new Character[]{'A', 'B', 'C'}; + + return Ca[0]; + } + + public Character _Character() { + Character C = 'A'; + return C; + } + + public Byte _Byte() { + Byte By = 10; + return By; + } + + public Character[] _CharacterArray() { + Character[] Ca = new Character[]{'A', 'B', 'C'}; + + return Ca; + } + + public JSObject _JSObject(){ + JSObject win = JSObject.getWindow(this); + JSObject jso = (JSObject) win.getMember("document"); + jso.setMember("key1","value1"); + + return jso; + } + + public void init() { + setLayout(new BorderLayout()); + statusLabel = new Label(); + add(statusLabel); + String initStr = "JSToJFuncReturn applet initialized."; + System.out.println(initStr); + statusLabel.setText(initStr); + } + + public void printStringAndFinish(String str){ + System.out.println(str); + System.out.println("afterTests"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/testcases/JSToJFuncReturnTest.java icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/testcases/JSToJFuncReturnTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJFuncReturn/testcases/JSToJFuncReturnTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJFuncReturn/testcases/JSToJFuncReturnTest.java 2013-05-03 19:08:24.837512743 +0000 @@ -0,0 +1,242 @@ +/* JSToJFuncReturnTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.KnownToFail; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Assert; + +import org.junit.Test; + +public class JSToJFuncReturnTest extends BrowserTest { + + private final String initStr = "JSToJFuncReturn applet initialized."; + private final String afterStr = "afterTests"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + + return (s.contains(initStr) && s.contains(afterStr)); + } + } + + private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JSToJFuncReturnTest stdout should contain "+ initStr + " but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the tests have passed. + Assert.assertTrue("JSToJFuncReturnTest stdout should contain "+ expectedStdout + " but it didnt.", pr.stdout.contains(expectedStdout)); + } + + + private void jsToJavaFuncReturnNormalTest(String methodStr, String expectedStdout) throws Exception { + String strURL = "/JSToJFuncReturn.html?" + methodStr; + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + evaluateStdoutContents(expectedStdout, pr); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_int_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_int", "number 1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_double_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_double", "number 1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_float_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_float", "number 1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_long_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_long", "number 10000"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_boolean_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_boolean", "boolean true"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_char_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_char", "number 97"); //'a' + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_byte_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_byte", "number 10"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_charArrayElement_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_charArrayElement", "number 97"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_void_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_void", "undefined undefined"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_regularString_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_regularString", "string test"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_specialCharsString_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_specialString", "string 𠁎〒£$ǣ€𝍖"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_null_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_null", "object null"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJFuncReturn_Integer_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_Integer", "object 1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJFuncReturn_Double_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_Double", "object 1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJFuncReturn_Float_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_Float", "object 1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJFuncReturn_Long_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_Long", "object 10000"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJFuncReturn_Boolean_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_Boolean", "object true"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJFuncReturn_Character_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_Character", "object A"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJFuncReturn_Byte_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_Byte", "object 10"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJFuncReturn_CharArrayElement_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_CharacterArrayElement", "object A"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_CharFullArray_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_CharacterArray", "object [Ljava.lang.Character;@"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJFuncReturn_JSObject_Test() throws Exception { + jsToJavaFuncReturnNormalTest("_JSObject", "object value1"); + } + + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js icedtea-web-1.4/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js 2013-05-03 19:08:24.837512743 +0000 @@ -0,0 +1,58 @@ +/* +JSToJ_auxiliary.js +This file contains auxiliary JavaScript functions for LiveConnect tests output +it is used by JSToJGet reproducer. +*/ + +function check(actual, expected, expectedtype, testid, appletName ) { + if (actual == expected) { //the same value + if (typeof(actual) == expectedtype) { //the same type + passTest( testid, appletName ); + } else { + failTypeTest( testid, appletName, actual, expectedtype ); + } + } else { + failValTest( testid, appletName, actual, expected ); + } +} + +function passTest( testid, appletName ){ + var passStr = "Test no."+testid+" - passed."; + //applet stdout + appletStdOut( appletName, passStr); + //html page + appendMessageDiv(passStr); +} + +function failValTest( testid, appletName, actual, expected ){ + var failValStr = "Test no."+testid+" - failed, value mismatch. expected:["+expected+"] found:["+actual+"]."; + //applet stdout + appletStdOut( appletName, failValStr); + //html page + appendMessageDiv(failValStr); +} + +function failTypeTest( testid, appletName, actual, expectedtype ){ + var failTypeStr = "Test no."+testid+" - failed, type mismatch. expected:["+expectedtype+"] found:["+typeof(actual)+"]."; + //applet stdout + appletStdOutLn( appletName, failTypeStr); + //html page + appendMessageDiv(failTypeStr); +} + +function appletStdOut( appletName, str ){ + document.getElementById( appletName ).stdOutWrite( str ); +} + +function appletStdOutLn( appletName, str ){ + document.getElementById( appletName ).stdOutWriteln( str ); +} + +function afterTestsMessage( appletName ){ + document.getElementById( appletName ).stdOutWriteln("afterTests"); +} + +function appendMessageDiv( message ){ + var messageDiv = document.getElementById( 'messageDiv' ); + messageDiv.appendChild( document.createTextNode(message) ); +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js icedtea-web-1.4/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js 2013-05-03 19:08:24.838512730 +0000 @@ -0,0 +1,261 @@ +function test_get_int(){ + var appletName = 'jstojGetApplet'; + try{ + var i = document.getElementById(appletName).i; + check(i, 42, "number", " 1 - (int)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_double() +{ + var appletName = 'jstojGetApplet'; + try{ + var d = document.getElementById(appletName).d; + check(d, 42.42, "number", " 2 - (double)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_float(){ + var appletName = 'jstojGetApplet'; + try{ + var f = document.getElementById(appletName).f; + check(f, 42.099998474121094, "number", " 3 - (float)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_long(){ + var appletName = 'jstojGetApplet'; + try{ + var l = document.getElementById(appletName).l; + check(l, 4294967296, "number", " 4 - (long)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_boolean(){ + var appletName = 'jstojGetApplet'; + try{ + var b = document.getElementById(appletName).b; + check(b, true, "boolean", " 5 - (boolean)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_char(){ + var appletName = 'jstojGetApplet'; + try{ + var c = document.getElementById(appletName).c; + check(c, 8995, "number", " 6 - (char)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_byte(){ + var appletName = 'jstojGetApplet'; + try{ + var by = document.getElementById(appletName).by; + check(by, 43, "number", " 7 - (byte)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_intArrayElement(){ + var appletName = 'jstojGetApplet'; + try{ + var ia = document.getElementById(appletName).ia[4]; + check(ia, 1024, "number", " 8 - (int[] - element access)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_intArrayBeyond(){ + var appletName = 'jstojGetApplet'; + try{ + var ia2 = document.getElementById(appletName).ia[30]; + check(ia2, null, "undefined", " 9 - (int[] - beyond length)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_regularString(){ + var appletName = 'jstojGetApplet'; + try{ + var rs = document.getElementById(appletName).rs; + check(rs, "I'm a string!", "string", "10 - (regular string)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_specialCharsString(){ + var appletName = 'jstojGetApplet'; + try{ + var ss = document.getElementById(appletName).ss; + check(ss, "𠁎〒£$ǣ€𝍖", "string", "11 - (string with special characters)",appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_null(){ + var appletName = 'jstojGetApplet'; + try{ + var n = document.getElementById(appletName).n; + check(n, null, "object","12 - (null)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_Integer(){ + var appletName = 'jstojGetApplet'; + try{ + var I = document.getElementById(appletName).I; + check(I, 24, "object","13 - (Integer)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_Double(){ + var appletName = 'jstojGetApplet'; + try{ + var D = document.getElementById(appletName).D; + check(D, 24.24, "object", "14 - (Double)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_Float(){ + var appletName = 'jstojGetApplet'; + try{ + var F = document.getElementById(appletName).F; + check(F, 24.124, "object", "15 - (Float)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_Long(){ + var appletName = 'jstojGetApplet'; + try{ + var L = document.getElementById(appletName).L; + check(L, 6927694924, "object", "16 - (Long)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_Boolean(){ + var appletName = 'jstojGetApplet'; + try{ + var B = document.getElementById(appletName).B; + check(B, false, "object", "17 - (Boolean)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_Character(){ + var appletName = 'jstojGetApplet'; + try{ + var C = document.getElementById(appletName).C; + check(C, 'ᔦ', "object", "18 - (Character)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_Byte(){ + var appletName = 'jstojGetApplet'; + try{ + var By = document.getElementById(appletName).By; + check(By, 34, "object", "19 - (Byte)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_DoubleArrayElement(){ + var appletName = 'jstojGetApplet'; + try{ + var DaE = document.getElementById(appletName).Da1[9]; + check(DaE, 24.24, "object", "20 - (Double[] - element access)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_DoubleFullArray(){ + var appletName = 'jstojGetApplet'; + try{ + var DaStr = document.getElementById(appletName).Da1.toString().substr(0,20); + var Da = document.getElementById(appletName).Da1; + + var appletid = appletName; + var testid = "21 - (Double[] - full array)"; + + var expected = "[Ljava.lang.Double;@"; + var expectedtype = "object"; + + if ( DaStr == expected ) { //the same value + if ( typeof(Da) == expectedtype ) { //the same type + passTest( testid, appletid ); + } else { + failTypeTest( testid, appletid, typeof(Da), expectedtype ); + } + } else { + failValTest( testid, appletid, DaStr, expected ); + } + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } +} + +function test_get_JSObject(){ + var appletName = 'jstojGetApplet'; + try{ + var javao = new Object(document.getElementById(appletName).jso); + check(javao.key1, "value1", "string", "22 - (JSObject)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } + +} + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html icedtea-web-1.4/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html 2013-05-03 19:08:24.837512743 +0000 @@ -0,0 +1,108 @@ + + + + JavaScript to Java LiveConnect - Get values from applet + + + + + + + + +

    The JSToJGet html page

    + + + + + +
    + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/resources/jstoj-get.jnlp icedtea-web-1.4/tests/reproducers/simple/JSToJGet/resources/jstoj-get.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/resources/jstoj-get.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJGet/resources/jstoj-get.jnlp 2013-05-03 19:08:24.838512730 +0000 @@ -0,0 +1,20 @@ + + + + JavaScript to Java LiveConnect - Get + RedHat + + LiveConnect - tests for getting members from Java side. + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java icedtea-web-1.4/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java 2013-05-03 19:08:24.839512717 +0000 @@ -0,0 +1,78 @@ +import java.applet.Applet; +import java.awt.Label; +import java.awt.BorderLayout; +import netscape.javascript.JSObject; + +public class JSToJGet extends Applet { + + public static final int i = 42; + public static final double d = 42.42; + public static final float f = 42.1F; + public static final long l = 4294967296L; + public static final boolean b = true; + public static final char c = '\u2323'; + public static final byte by = 43; + public static final String rs = "I'm a string!"; + public static final String ss = "𠁎〒£$ǣ€𝍖"; + public static final Object n = null; + public int[] ia = new int[5]; + + public static final Integer I = 24; + public static final Double D = 24.24; + public static final Float F = 24.124F; + public static final Long L = 6927694924L; + public static final Boolean B = false; + public static final Character C = '\u1526'; + public static final Byte By = 34; + public Double[] Da1 = new Double[10]; + public Double[] Da2 = null; + + public char[] ca = new char[3]; + public Character[] Ca = new Character[3]; + public JSObject jso; + + private Label statusLabel; + + public void start(){ + JSObject win = JSObject.getWindow(this); + jso = (JSObject) win.getMember("document"); + jso.setMember("key1","value1"); + ia[4] = 1024; + Da1[9] = D; + + String setupStr = "JSToJGet applet set up for GET tests."; + System.out.println(setupStr); + statusLabel.setText(setupStr); + } + + public void init() { + setLayout(new BorderLayout()); + statusLabel = new Label(); + add(statusLabel); + String initStr = "JSToJGet applet initialized."; + System.out.println(initStr); + statusLabel.setText(initStr); + } + + // auxiliary method for setting the statusLabel text: + public void setStatusLabel(String s) { + statusLabel.setText(s); + } + + // auxiliary methods for writing to stdout and stderr: + public void stdOutWrite(String s) { + System.out.print(s); + } + + public void stdErrWrite(String s) { + System.err.print(s); + } + + public void stdOutWriteln(String s) { + System.out.println(s); + } + + public void stdErrWriteln(String s) { + System.err.println(s); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java icedtea-web-1.4/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java 2013-05-03 19:08:24.839512717 +0000 @@ -0,0 +1,299 @@ +/* JSToJGetTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.annotations.KnownToFail; +import org.junit.Assert; + +import org.junit.Test; + +public class JSToJGetTest extends BrowserTest { + + //the JS<->J tests tend to make Opera unusable + public final boolean doNotRunInOpera = true; + + public String passStr = " - passed."; + public String failValStr = " - failed, value mismatch."; + public String failTypeStr = " - failed, type mismatch."; + public String expStr = "expected:["; + public String foundStr = "] found:["; + public String endStr = "]."; + + private final String initStr = "JSToJGet applet initialized."; + private final String setupStr = "JSToJGet applet set up for GET tests."; + private final String afterStr = "afterTests"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + return (s.contains(initStr) && s.contains(setupStr) && s + .contains(afterStr)); + } + } + + private void evaluateStdoutContents(String testStr, ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JSToJGetTest stdout should contain " + initStr + + " but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the applet was set up for the GM tests. + Assert.assertTrue("JSToJGetTest stdout should contain " + setupStr + + " but it didnt.", pr.stdout.contains(setupStr)); + + // Assert that the tests have passed. + String s0 = testStr + passStr; + String s1 = testStr + failValStr; + String s2 = testStr + failTypeStr; + + int ind0 = pr.stdout.indexOf(s0); + int ind1 = pr.stdout.indexOf(s1); + int ind2 = pr.stdout.indexOf(s2); + int indBegin = pr.stdout.indexOf(setupStr); + if (indBegin != -1) { + indBegin += setupStr.length(); + } else { + indBegin = 0; + } + + String failStr = "JSToJGet " + testStr + + ": passed not found in the applet stdout."; + + if (ind1 != -1) { + // int inde = pr.stdout.indexOf(expStr); + // int indf = pr.stdout.indexOf(foundStr); + // int indend = pr.stdout.indexOf(endStr); + failStr = "JSToJGet: value mismatch in "+testStr; + } + + if (ind2 != -1) { + // int inde = pr.stdout.indexOf(expStr); + // int indf = pr.stdout.indexOf(foundStr); + // int indend = pr.stdout.indexOf(endStr); + failStr = "JSToJGet: type mismatch in "+testStr; + } + + Assert.assertTrue(failStr, (ind1 == -1));// no value mismatch + Assert.assertTrue(failStr, (ind2 == -1));// no type mismatch + Assert.assertTrue(failStr, (ind0 != -1));// test passed + + } + + private void jsToJavaGetTest(String urlEnd, String testStr) throws Exception { + + if( doNotRunInOpera){ + if(server.getCurrentBrowser().getID() == Browsers.opera){ + return; + } + } + + String strURL = "/JSToJGet.html?" + urlEnd; + ProcessResult pr = server.executeBrowser(strURL, + new CountingClosingListenerImpl(), + new CountingClosingListenerImpl()); + evaluateStdoutContents(testStr, pr); + + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_int_Test() throws Exception { + jsToJavaGetTest("int", "Test no. 1 - (int)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_double_Test() throws Exception { + jsToJavaGetTest("double", "Test no. 2 - (double)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_float_Test() throws Exception { + jsToJavaGetTest("float", "Test no. 3 - (float)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_long_Test() throws Exception { + jsToJavaGetTest("long", "Test no. 4 - (long)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_boolean_Test() throws Exception { + jsToJavaGetTest("boolean", "Test no. 5 - (boolean)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_char_Test() throws Exception { + jsToJavaGetTest("char", "Test no. 6 - (char)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_byte_Test() throws Exception { + jsToJavaGetTest("byte", "Test no. 7 - (byte)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_intArrayElement_Test() throws Exception { + jsToJavaGetTest("intArrayElement", "Test no. 8 - (int[] - element access)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_intArrayBeyond_Test() throws Exception { + jsToJavaGetTest("intArrayBeyond", "Test no. 9 - (int[] - beyond length)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_regularString_Test() throws Exception { + jsToJavaGetTest("regularString", "Test no.10 - (regular string)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_specialCharsString_Test() throws Exception { + jsToJavaGetTest("specialCharsString", "Test no.11 - (string with special characters)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_null_Test() throws Exception { + jsToJavaGetTest("null", "Test no.12 - (null)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJGet_Integer_Test() throws Exception { + jsToJavaGetTest("Integer", "Test no.13 - (Integer)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJGet_Double_Test() throws Exception { + jsToJavaGetTest("Double", "Test no.14 - (Double)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJGet_Float_Test() throws Exception { + jsToJavaGetTest("Float", "Test no.15 - (Float)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJGet_Long_Test() throws Exception { + jsToJavaGetTest("Long", "Test no.16 - (Long)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJGet_Boolean_Test() throws Exception { + jsToJavaGetTest("Boolean", "Test no.17 - (Boolean)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJGet_Character_Test() throws Exception { + jsToJavaGetTest("Character", "Test no.18 - (Character)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJGet_Byte_Test() throws Exception { + jsToJavaGetTest("Byte", "Test no.19 - (Byte)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + public void AppletJSToJGet_DoubleArrayElement_Test() throws Exception { + jsToJavaGetTest("DoubleArrayElement", "Test no.20 - (Double[] - element access)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_DoubleFullArray_Test() throws Exception { + jsToJavaGetTest("DoubleFullArray", "Test no.21 - (Double[] - full array)"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_JSObject_Test() throws Exception { + jsToJavaGetTest("JSObject", "Test no.22 - (JSObject)"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js icedtea-web-1.4/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js 2013-05-03 19:08:24.840512704 +0000 @@ -0,0 +1,49 @@ +//dummy javascript class whose instance is passed as JSObject parameter: +function JSCar(mph,color){ + this.mph = mph; + this.color = color; +} + +function doSetTests( ){ + + var urlArgs = document.URL.split("?"); + var testParams = urlArgs[1].split(";"); + var applet = document.getElementById('jstojSetApplet'); + var field = testParams[0]; + var value = testParams[1]; + + if( value === "JavaScript"){ + if( field === "_char"){ + value = 97; + } + + if( field === "_Character"){ + value = new (applet.Packages).java.lang.Character(65); + } + + if( field === "_specialString"){ + value = "𠁎〒£$ǣ€𝍖"; + } + + if( field === "_JSObject"){ + value = new JSCar(100,"red"); + } + + }else if(value.indexOf('[') != -1){ + + var elem = value.substring(1); + value = new Array(); + eval('value[0] = elem'); + } + + eval('applet.' + field + '= value'); + + //modifiing _intArray[0] into _intArray + // _DoubleArray[0] into _DoubleArray + var nameEnd = field.indexOf('['); + if( nameEnd != -1){ + field = field.substring(0,nameEnd); + } + + applet.printNewValueAndFinish(field); +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/resources/JSToJSet.html icedtea-web-1.4/tests/reproducers/simple/JSToJSet/resources/JSToJSet.html --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/resources/JSToJSet.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJSet/resources/JSToJSet.html 2013-05-03 19:08:24.840512704 +0000 @@ -0,0 +1,25 @@ + + + + JavaScript to Java LiveConnect - Set values from applet + + + + + + + +

    The JSToJSet html page

    + + + + + +
    + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/resources/jstoj-set.jnlp icedtea-web-1.4/tests/reproducers/simple/JSToJSet/resources/jstoj-set.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/resources/jstoj-set.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJSet/resources/jstoj-set.jnlp 2013-05-03 19:08:24.840512704 +0000 @@ -0,0 +1,21 @@ + + + + JavaScript to Java LiveConnect - Set + RedHat + + LiveConnect - tests for setting members on Java side. + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java icedtea-web-1.4/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java 2013-05-03 19:08:24.841512692 +0000 @@ -0,0 +1,53 @@ +import java.applet.Applet; +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import netscape.javascript.JSObject; + +public class JSToJSet extends Applet { + + public int _int; + public double _double; + public float _float; + public long _long; + public boolean _boolean; + public char _char; + public byte _byte; + public String _String; + public String _specialString; + public Object _Object = new String("non-null object"); + public int[] _intArray = new int[1]; + public Integer _Integer; + public Double _Double; + public Float _Float; + public Long _Long; + public Boolean _Boolean; + public Character _Character = 'B'; + public Byte _Byte; + public Double[] _DoubleArray = new Double[10]; + public Double[] _DoubleArray2; + public char[] _charArray = new char[1]; + public Character[] _CharacterArray = new Character[1]; + public JSObject _JSObject; + + public void init() { + String initStr = "JSToJSet applet initialized."; + System.out.println(initStr); + } + + public void printNewValueAndFinish(String fieldname) throws Exception { + Field field = getClass().getDeclaredField(fieldname); + Object value = field.get(this); + + if( fieldname.equals("_JSObject") ){ + Integer mph = (Integer)_JSObject.getMember("mph"); + String color = (String)_JSObject.getMember("color"); + System.out.println("New value is: "+mph+", "+color); + }else if (value != null && value.getClass().isArray()) { + System.out.println("New array value is: " + Array.get(value, 0)); + } else { + System.out.println("New value is: " + value); + } + System.out.println("afterTests"); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java icedtea-web-1.4/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java 2013-05-03 19:08:24.841512692 +0000 @@ -0,0 +1,284 @@ +/* JSToJSetTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.KnownToFail; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Assert; + +import org.junit.Test; + +@Bug( id = { "PR1298" }) +public class JSToJSetTest extends BrowserTest { + + //the JS<->J tests tend to make Opera unusable + public final boolean doNotRunInOpera = true; + + private final String exceptionStr = "xception"; + private final String errorStr = "rror"; + private final String initStr = "JSToJSet applet initialized."; + private final String afterStr = "afterTests"; + + public enum TestType{ + ARRAY_ELEMENT, WHOLE_ARRAY, NORMAL_VALUE + } + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + if (s.contains(exceptionStr) || s.contains(errorStr)) { + return true; + } + return (s.contains(initStr) && s.contains(afterStr)); + } + } + + private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JSToJSet: the stdout should contain " + initStr + + ", but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the values set by JavaScript are ok + Assert.assertTrue("JSToJSet: the output should include: "+expectedStdout+", but it didnt.", + pr.stdout.contains(expectedStdout)); + + } + + private void jsToJavaSetNormalTest(String fieldStr, String valueStr) throws Exception { + + if( doNotRunInOpera){ + if(server.getCurrentBrowser().getID() == Browsers.opera){ + return; + } + } + + String strURL = "/JSToJSet.html?" + fieldStr + ";" + valueStr; + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + String expectedStdout = "New value is: " + valueStr; + evaluateStdoutContents(expectedStdout, pr); + } + + private void jsToJavaSetSpecialTest(String fieldStr, String valueStr, TestType testType) throws Exception { + + if( doNotRunInOpera){ + Browsers b = server.getCurrentBrowser().getID(); + if(b == Browsers.opera){ + return; + } + } + + String strURL = "/JSToJSet.html?"; + String expectedStdout = ""; + switch( testType ){ + case ARRAY_ELEMENT://array element + strURL += fieldStr + ";" + valueStr; + expectedStdout = "New array value is: "+valueStr; + break; + case WHOLE_ARRAY://whole array, set 1st element + strURL += fieldStr + ";[" + valueStr; + expectedStdout = "New array value is: "+valueStr; + break; + case NORMAL_VALUE://char et al - to be set at JS side + strURL += fieldStr + ";JavaScript"; + expectedStdout = "New value is: "+valueStr; + break; + default: + break; + } + + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + evaluateStdoutContents(expectedStdout, pr); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_int_Test() throws Exception { + jsToJavaSetNormalTest("_int", "1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_double_Test() throws Exception { + jsToJavaSetNormalTest("_double", "1.0"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_float_Test() throws Exception { + jsToJavaSetNormalTest("_float", "1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_long_Test() throws Exception { + jsToJavaSetNormalTest("_long", "10000"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_boolean_Test() throws Exception { + jsToJavaSetNormalTest("_boolean", "true"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_char_Test() throws Exception { + jsToJavaSetSpecialTest("_char", "a", TestType.NORMAL_VALUE); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_byte_Test() throws Exception { + jsToJavaSetNormalTest("_byte", "10"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + @Bug( id = {"PR1298"}) + public void AppletJSToJSet_intArrayElement_Test() throws Exception { + jsToJavaSetSpecialTest("_intArray[0]", "1", TestType.ARRAY_ELEMENT); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_regularString_Test() throws Exception { + jsToJavaSetNormalTest("_String", "teststring"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_specialCharsString_Test() throws Exception { + jsToJavaSetSpecialTest("_specialString", "𠁎〒£$ǣ€𝍖", TestType.NORMAL_VALUE); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_null_Test() throws Exception { + jsToJavaSetNormalTest("_Object", "null"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_Integer_Test() throws Exception { + jsToJavaSetNormalTest("_Integer", "1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_Double_Test() throws Exception { + jsToJavaSetNormalTest("_Double", "1.0"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_Float_Test() throws Exception { + jsToJavaSetNormalTest("_Float", "1.1"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_Long_Test() throws Exception { + jsToJavaSetNormalTest("_Long", "10000"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_Boolean_Test() throws Exception { + jsToJavaSetNormalTest("_Boolean", "true"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_Character_Test() throws Exception { + jsToJavaSetSpecialTest("_Character", "A", TestType.NORMAL_VALUE); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_Byte_Test() throws Exception { + jsToJavaSetNormalTest("_Byte", "100"); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + @KnownToFail + @Bug( id = {"PR1298"}) + public void AppletJSToJSet_DoubleArrayElement_Test() throws Exception { + jsToJavaSetSpecialTest("_DoubleArray[0]", "1.1", TestType.ARRAY_ELEMENT); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_DoubleFullArray_Test() throws Exception { + jsToJavaSetSpecialTest("_DoubleArray2", "0.1", TestType.WHOLE_ARRAY); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_JSObject_Test() throws Exception { + jsToJavaSetSpecialTest("_JSObject", "100, red", TestType.NORMAL_VALUE); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/resources/JSToJava_TypeConv.js icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/resources/JSToJava_TypeConv.js --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/resources/JSToJava_TypeConv.js 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/resources/JSToJava_TypeConv.js 2013-05-03 19:08:24.842512680 +0000 @@ -0,0 +1,14 @@ +function doTypeConvTests(){ + + var urlArgs = document.URL.split("?"); + var testParams = urlArgs[1].split(";"); + var applet = document.getElementById('jstojTypeConvApplet'); + + var field = testParams[0]; + var value = decodeURIComponent(testParams[1]); + + eval('applet.' + field + '=' + value); + applet.printNewValueAndFinish(field); + +} + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/resources/JSToJTypeConv.html icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/resources/JSToJTypeConv.html --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/resources/JSToJTypeConv.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/resources/JSToJTypeConv.html 2013-05-03 19:08:24.842512680 +0000 @@ -0,0 +1,26 @@ + + + + JavaScript to Java LiveConnect - Types Conversion + + + + + + + +

    The JSToJTypeConv html page

    + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/resources/jstoj-typeconv.jnlp icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/resources/jstoj-typeconv.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/resources/jstoj-typeconv.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/resources/jstoj-typeconv.jnlp 2013-05-03 19:08:24.843512668 +0000 @@ -0,0 +1,23 @@ + + + + + JavaScript to Java LiveConnect - TypeConv + IcedTea + + LiveConnect - tests for data type conversion from JS to Java variables. + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/srcs/JSToJTypeConv.java icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/srcs/JSToJTypeConv.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/srcs/JSToJTypeConv.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/srcs/JSToJTypeConv.java 2013-05-03 19:08:24.843512668 +0000 @@ -0,0 +1,124 @@ +import java.applet.Applet; +import java.lang.reflect.Array; +import java.lang.reflect.Field; + +import netscape.javascript.JSObject; + +public class JSToJTypeConv extends Applet { + + public byte _byte = 0; + public char _char = 'A'; + public short _short = 0; + public int _int = 0; + public long _long = 0L; + public float _float = 0F; + public double _double = 0.0; + public boolean _boolean = false; + + public byte[] _byteArray = null; + public char[] _charArray = null; + public short[] _shortArray = null; + public int[] _intArray = null; + public long[] _longArray = null; + public float[] _floatArray = null; + public double[] _doubleArray = null; + public char[][] _charArray2D = null; + + public Byte _Byte = null; + public Character _Character = 'A'; + public Short _Short = 0; + public Integer _Integer = 0; + public Long _Long = 0L; + public Float _Float = 0F; + public Double _Double = 0.0; + public String _String = ""; + public Boolean _Boolean = false; + public JSObject _JSObject = null; + + public Byte[] _ByteArray = null; + public Character[] _CharacterArray = null; + public Short[] _ShortArray = null; + public Integer[] _IntegerArray = null; + public Long[] _LongArray = null; + public Float[] _FloatArray = null; + public Double[] _DoubleArray = null; + public String[] _StringArray = null; + public String[][] _StringArray2D = null; + + public Object _Object = null; + + + public String getArrayAsStr(Object array) { + if( array == null){ + return "null"; + }else{ + int size = Array.getLength(array); + + String ret = ""; + for (int i=0; i < size; i++) { + ret += ((Array.get(array, i) == null) ? "null" : Array.get(array, i).toString()); + ret += ","; + } + + if (ret.length() > 0) { + ret = ret.substring(0, ret.length()-1); + } + + return "["+ret+"]"; + } + } + + public void init() { + String initStr = "JSToJTypeConv applet initialized."; + System.out.println(initStr); + } + + public class DummyObject { + private String str; + + public DummyObject(String s) { + this.str = s; + } + + public void setStr(String s) { + this.str = s; + } + + public String toString() { + return str; + } + } + + public DummyObject getNewDummyObject(String s){ + return new DummyObject(s); + } + + public void printNewValueAndFinish(String fieldname) throws Exception { + if( fieldname.equals("_Object")){ + System.out.println( "New value is: " + _Object + " class is " + _Object.getClass().getName() + + " superclass is " + _Object.getClass().getSuperclass().getName() ); + }else{ + + Field field = getClass().getDeclaredField(fieldname); + Object value = field.get(this); + + //2D arrays + if( fieldname.contains("2D") ){ + Object row1 = Array.get(value,0); + Object row2 = Array.get(value,1); + Object row3 = Array.get(value,2); + System.out.println( "New value is: [" + getArrayAsStr(row1) + "," + getArrayAsStr(row2) + "," + getArrayAsStr(row3) + "]"); + + //arrays + }else if (value != null && value.getClass().isArray()) { + System.out.println("New value is: " + getArrayAsStr(value)); + + //classic fields + } else { + System.out.println("New value is: " + value); + } + } + + System.out.println("afterTests"); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java 2013-05-03 19:08:24.844512656 +0000 @@ -0,0 +1,478 @@ +/* JSToJTypeConvTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Assert; + +import org.junit.Test; + +public class JSToJTypeConvTest extends BrowserTest { + + //the JS<->J tests tend to make Opera unusable + public final boolean doNotRunInOpera = true; + + private final String initStr = "JSToJTypeConv applet initialized."; + private final String afterStr = "afterTests"; + + private class CountingClosingListenerImpl extends CountingClosingListener { + + @Override + protected boolean isAlowedToFinish(String s) { + return (s.contains(initStr) && s.contains(afterStr)); + } + } + + private void evaluateStdoutContents(String[] expectedStdouts, ProcessResult pr) { + // Assert that the applet was initialized. + Assert.assertTrue("JSToJTypeConv: the stdout should contain " + initStr + + ", but it didnt.", pr.stdout.contains(initStr)); + + // Assert that the values set by JavaScript are ok + for(String str : expectedStdouts){ + + String xmlStr = "new value"; + + if(str.contains("nonXML char")) + { + str = str.substring(12); + }else{ + xmlStr = str; + } + + Assert.assertTrue("JSToJTypeConv: the output should include "+xmlStr+", but it didnt.", pr.stdout.contains(str)); + } + } + + private void jsToJavaTypeConvTest(String fieldStr, String valueStr, String[] expectedValueAndOutputs) throws Exception { + + if( doNotRunInOpera){ + if(server.getCurrentBrowser().getID() == Browsers.opera){ + return; + } + } + + String strURL = "/JSToJTypeConv.html?" + fieldStr + ";" + valueStr; + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + String[] expectedStdouts = expectedValueAndOutputs; + evaluateStdoutContents(expectedStdouts, pr); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_NumToJavaStringInteger_Test() throws Exception { + jsToJavaTypeConvTest("_String", "1", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_NumToJavaStringDouble_Test() throws Exception { + jsToJavaTypeConvTest("_String", "1.1", new String[] {"1.1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_NumToJavaObjectInteger_Test() throws Exception { + jsToJavaTypeConvTest("_Object", "1.0", new String[] {"1","superclass is java.lang.Number"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_NumToJavaObjectDouble_Test() throws Exception { + jsToJavaTypeConvTest("_Object", "1.1", new String[] {"1.1","superclass is java.lang.Number"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_NumToboolean0_Test() throws Exception { + jsToJavaTypeConvTest("_boolean", "0", new String[] {"false"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_NumToboolean1dot1_Test() throws Exception { + jsToJavaTypeConvTest("_boolean", "1.1", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolToJavaBoolTrue_Test() throws Exception { + jsToJavaTypeConvTest("_Boolean", "true", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolToJavaBoolFalse_Test() throws Exception { + jsToJavaTypeConvTest("_Boolean", "false", new String[] {"false"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolToJavaObject_Test() throws Exception { + jsToJavaTypeConvTest("_Object", "true", new String[] {"true", "class is java.lang.Boolean"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolToJavaString_Test() throws Exception { + jsToJavaTypeConvTest("_String", "true", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTobyteTrue_Test() throws Exception { + jsToJavaTypeConvTest("_byte", "true", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTocharTrue_Test() throws Exception { + jsToJavaTypeConvTest("_char", "true", new String[] { "nonXML char "+((char)1) }); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolToshortTrue_Test() throws Exception { + jsToJavaTypeConvTest("_short", "true", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTointTrue_Test() throws Exception { + jsToJavaTypeConvTest("_int", "true", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTolongTrue_Test() throws Exception { + jsToJavaTypeConvTest("_long", "true", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTofloatTrue_Test() throws Exception { + jsToJavaTypeConvTest("_float", "true", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTodoubleTrue_Test() throws Exception { + jsToJavaTypeConvTest("_double", "true", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTobyteFalse_Test() throws Exception { + jsToJavaTypeConvTest("_byte", "false", new String[] {"0"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTocharFalse_Test() throws Exception { + jsToJavaTypeConvTest("_char", "false", new String[] { "nonXML char "+((char)0) }); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolToshortFalse_Test() throws Exception { + jsToJavaTypeConvTest("_short", "false", new String[] {"0"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTointFalse_Test() throws Exception { + jsToJavaTypeConvTest("_int", "false", new String[] {"0"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTolongFalse_Test() throws Exception { + jsToJavaTypeConvTest("_long", "false", new String[] {"0"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTofloatFalse_Test() throws Exception { + jsToJavaTypeConvTest("_float", "false", new String[] {"0"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_BoolTodoubleFalse_Test() throws Exception { + jsToJavaTypeConvTest("_double", "false", new String[] {"0"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringToObject_Test() throws Exception { + jsToJavaTypeConvTest("_Object", "\"𠁎〒£$ǣ€𝍖\"", new String[] {"𠁎〒£$ǣ€𝍖"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringTobyte_Test() throws Exception { + jsToJavaTypeConvTest("_byte", "\'1\'", new String[] {"1"}); //JS string 'str' or "str" both ok + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringToshort_Test() throws Exception { + jsToJavaTypeConvTest("_short", "\"1\"", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringToint_Test() throws Exception { + jsToJavaTypeConvTest("_int", "\"1\"", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringTolong_Test() throws Exception { + jsToJavaTypeConvTest("_long", "\"1\"", new String[] {"1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringTofloat_Test() throws Exception { + jsToJavaTypeConvTest("_float", "\"1.1\"", new String[] {"1.1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringTodouble_Test() throws Exception { + jsToJavaTypeConvTest("_double", "\"1.1\"", new String[] {"1.1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringTochar_Test() throws Exception { + jsToJavaTypeConvTest("_char", "\"1\"", new String[] { "nonXML char "+((char)1) }); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringTobooleanEmptyFalse_Test() throws Exception { + jsToJavaTypeConvTest("_boolean", "\"\"", new String[] {"false"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringTobooleanNonemptyTrue_Test() throws Exception { + jsToJavaTypeConvTest("_boolean", "\"a nonempty string\"", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayTobyteArr_Test() throws Exception { + jsToJavaTypeConvTest("_byteArray", "[1,null,2]", new String[] {"[1,0,2]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayTocharArr_Test() throws Exception { + jsToJavaTypeConvTest("_charArray", "[97,null,98]", new String[] {"nonXML char [a,"+((char)0) +",b]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayToshortArr_Test() throws Exception { + jsToJavaTypeConvTest("_shortArray", "[1,null,2]", new String[] {"[1,0,2]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayTointArr_Test() throws Exception { + jsToJavaTypeConvTest("_intArray", "[1,null,2]", new String[] {"[1,0,2]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayTolongArr_Test() throws Exception { + jsToJavaTypeConvTest("_longArray", "[1,null,2]", new String[] {"[1,0,2]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayTofloatArr_Test() throws Exception { + jsToJavaTypeConvTest("_floatArray", "[1,null,2]", new String[] {"[1.0,0.0,2.0]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayTodoubleArr_Test() throws Exception { + jsToJavaTypeConvTest("_doubleArray", "[1,null,2]", new String[] {"[1.0,0.0,2.0]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayToStringArr_Test() throws Exception { + jsToJavaTypeConvTest("_StringArray", "[1,null,2]", new String[] {"[1,null,2]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayTocharArrArr_Test() throws Exception { + jsToJavaTypeConvTest("_charArray2D", "[[\"97\",null,\"98\"],[],[\"99\",\"100\",null,\"101\"]]", new String[] {"nonXML char [[a,"+((char)0)+",b],[],[c,d,"+((char)0)+",e]]"}); //Error on Java side: array element type mismatch + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayToStringArrArr_Test() throws Exception { + jsToJavaTypeConvTest("_StringArray2D", "[[\"00\",null,\"02\"],[],[\"20\",\"21\",null,\"23\"]]", new String[] {"[[00,null,02],[],[20,21,null,23]]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_ArrayToString_Test() throws Exception { + jsToJavaTypeConvTest("_String", "[[\"00\",null,\"02\"],[],[\"20\",\"21\",null,\"23\"]]", new String[] {"00,,02,,20,21,,23"}); //Error on Java side: array element type mismatch + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_JSObjectToJSObject_Test() throws Exception { + jsToJavaTypeConvTest("_JSObject", "window", new String[] {"[object Window]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_JSObjectToString_Test() throws Exception { + jsToJavaTypeConvTest("_String", "window", new String[] {"[object Window]"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_JavaObjectToJavaObject_Test() throws Exception { + jsToJavaTypeConvTest("_Object", "new applet.Packages.java.lang.Float(1.1)", new String[] {"1.1","class is java.lang.Float"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_JavaObjectToString_Test() throws Exception { + jsToJavaTypeConvTest("_String", "applet.getNewDummyObject(\"dummy1\")", new String[] {"dummy1"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_nullToJavaObjectString_Test() throws Exception { + jsToJavaTypeConvTest("_String", "null", new String[] {"null"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringTobooleanFalseStr_Test() throws Exception { + jsToJavaTypeConvTest("_boolean", "\"false\"", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringTobooleanTrueStr_Test() throws Exception { + jsToJavaTypeConvTest("_boolean", "\"true\"", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringToBooleanFalseStr_Test() throws Exception { + jsToJavaTypeConvTest("_Boolean", "\"false\"", new String[] {"true"}); + } + + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJTypeConv_StringToBooleanTrueStr_Test() throws Exception { + jsToJavaTypeConvTest("_Boolean", "\"true\"", new String[] {"true"}); + } + +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java icedtea-web-1.4/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java 2013-05-03 19:08:24.857512491 +0000 @@ -0,0 +1,457 @@ +/* LocalisedInformationElementTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.PropertyResourceBundle; +import java.util.ResourceBundle; +import java.util.Set; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import org.junit.Assert; +import org.junit.Test; + +public class LocalesTestTest { + + private static ServerAccess server = new ServerAccess(); + String[] keys = { + "BOUsage", + "BOUsage2", + "BOArg", + "BOParam", + "BOProperty", + "BOLicense", + "BOVerbose", + "BOAbout", + "BONosecurity", + "BONoupdate", + "BOHeadless", + "BOStrict", + "BOViewer", + "BXnofork", + "BXclearcache", + "BOHelp"}; + + /** + * this will prepare new set of variables with wanted locale, which can be + * then passed to subprocess + * + * @param locale - locale to be set to LANG variable, eg cs_CZ.UTF-8 + */ + public static String[] getChangeLocalesForSubproces(String locale) { + ServerAccess.logOutputReprint("Setting locales"); + Map p = System.getenv(); + Set> r = p.entrySet(); + List> rr = new ArrayList(r); + Collections.sort(rr, new Comparator>() { + + @Override + public int compare(Entry o1, Entry o2) { + return o1.getKey().compareTo(o2.getKey()); + } + }); + String[] l = new String[rr.size()]; + int i = 0; + for (Iterator> it = rr.iterator(); it.hasNext(); i++) { + Entry entry = it.next(); + String v = entry.getValue(); + String s = entry.getKey() + "=" + v; + //System.out.println(s); + if (entry.getKey().equals("LANG")) { + ServerAccess.logOutputReprint("was " + v); + v = locale; + ServerAccess.logOutputReprint("set " + v); + } + s = entry.getKey() + "=" + v; + l[i] = s; + } + return l; + } + + private ResourceBundle getPropertiesDe() throws IOException { + return getProperties("_de"); + } + + + public ResourceBundle getPropertiesCz() throws IOException { + return getProperties("_cs"); + + } + + public ResourceBundle getPropertiesPl() throws IOException { + return getProperties("_pl"); + + } + + public ResourceBundle getPropertiesEn() throws IOException { + return getProperties(""); + + } + + public ResourceBundle getProperties(String s) throws IOException { + return new PropertyResourceBundle(this.getClass().getClassLoader().getResourceAsStream("net/sourceforge/jnlp/resources/Messages" + s + ".properties")); + + } + //just launching javaws -about to see if messages are corectly localised + List javaws = Arrays.asList(new String[]{server.getJavawsLocation(), "-help", ServerAccess.HEADLES_OPTION}); + + @Test + public void testLocalesEnUsUtf() throws Exception { + String[] l = getChangeLocalesForSubproces("en_US.UTF-8"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertNotDe(pr.stdout); + assertNotPl(pr.stdout); + } + + @Test + public void testLocalesCsCz() throws Exception { + String[] l = getChangeLocalesForSubproces("cs_CZ"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertNotDe(pr.stdout); + assertNotPl(pr.stdout); + iteratePropertiesForAproxCzCs(pr.stdout); + } + + @Test + public void testLocalesCsCzUtf() throws Exception { + String[] l = getChangeLocalesForSubproces("cs_CZ.UTF-8"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotDe(pr.stdout); + assertCz(pr.stdout); + assertNotPl(pr.stdout); + iteratePropertiesForAproxCzCs(pr.stdout); + } + + @Test + public void testLocalesPlPL() throws Exception { + String[] l = getChangeLocalesForSubproces("pl_PL"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertNotDe(pr.stdout); + iteratePropertiesForAproxPl(pr.stdout); + } + + @Test + public void testLocalesPlPLUtf() throws Exception { + String[] l = getChangeLocalesForSubproces("pl_PL.UTF-8"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotDe(pr.stdout); + assertNotCz(pr.stdout); + assertPl(pr.stdout); + iteratePropertiesForAproxPl(pr.stdout); + } + + @Test + public void testLocalesDeDe() throws Exception { + String[] l = getChangeLocalesForSubproces("de_DE"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertNotPl(pr.stdout); + iteratePropertiesForAproxDe(pr.stdout); + } + + @Test + public void testLocalesDeDeUtf() throws Exception { + String[] l = getChangeLocalesForSubproces("de_DE.UTF-8"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertDe(pr.stdout); + assertNotPl(pr.stdout); + iteratePropertiesForAproxDe(pr.stdout); + } + + + @Test + public void testLocalesDe_unknowButValidDeLocale() throws Exception { + String[] l = getChangeLocalesForSubproces("de_LU"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertNotPl(pr.stdout); + iteratePropertiesForAproxDe(pr.stdout); + } + + @Test + public void testLocalesDeUtf_unknowButValidDeLocale() throws Exception { + String[] l = getChangeLocalesForSubproces("de_LU.UTF-8"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertDe(pr.stdout); + assertNotPl(pr.stdout); + iteratePropertiesForAproxDe(pr.stdout); + } + + + + @Test + public void testLocalesDe_globalDe() throws Exception { + String[] l = getChangeLocalesForSubproces("deutsch"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertNotPl(pr.stdout); + iteratePropertiesForAproxDe(pr.stdout); + } + + + + + @Test + public void testLocalesInvalid() throws Exception { + String[] l = getChangeLocalesForSubproces("ax_BU"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertNotDe(pr.stdout); + assertNotPl(pr.stdout); + } + + private void assertEnglish(String s) throws IOException { + ResourceBundle props = getPropertiesEn(); + iteratePropertiesFor(props, s, true, "english"); + } + + private void assertNotEnglish(String s) throws IOException { + ResourceBundle props = getPropertiesEn(); + iteratePropertiesFor(props, s, false, "english"); + } + + private void assertCz(String s) throws IOException { + ResourceBundle props = getPropertiesCz(); + iteratePropertiesFor(props, s, true, "czech"); + } + + private void assertPl(String s) throws IOException { + ResourceBundle props = getPropertiesPl(); + iteratePropertiesFor(props, s, true, "polish"); + } + + private void assertDe(String s) throws IOException { + ResourceBundle props = getPropertiesDe(); + iteratePropertiesFor(props, s, true, "de"); + } + + + private void assertNotCz(String s) throws IOException { + ResourceBundle props = getPropertiesCz(); + iteratePropertiesFor(props, s, false, "czech"); + } + + private void assertNotPl(String s) throws IOException { + ResourceBundle props = getPropertiesPl(); + iteratePropertiesFor(props, s, false, "polish"); + } + + private void assertNotDe(String s) throws IOException { + ResourceBundle props = getPropertiesDe(); + iteratePropertiesFor(props, s, false, "de"); + } + + + /** + * This method is iterating all keys defined in this class, geting their value in given + * properties, and then checking if given output have/have not (depends on value of assertTrue) + * this string contained. + * + * @param props + * @param outputToExamine + * @param assertTrue + * @param languageId + */ + private void iteratePropertiesFor(ResourceBundle props, String outputToExamine, boolean assertTrue, String languageId) { + int keysFound = 0; + for (int i = 0; i < keys.length; i++) { + String string = keys[i]; + String value = props.getString(string); + if (value == null) { + continue; + } + keysFound++; + if (assertTrue) { + Assert.assertTrue("Output must contains " + languageId + " text, failed on " + string, outputToExamine.contains(value)); + } else { + Assert.assertFalse("Output must NOT contains " + languageId + " text, failed on " + string, outputToExamine.contains(value)); + + } + } + Assert.assertTrue("At least one key must be found, was not", keysFound > 0); + } + + /** + * This method is iterating all keys defined in this class, geting their value in given + * properties, transforming this to asci-ionly regex and then checking if + * given output match/matchnot (depends on value of assertTrue) this string, + * + * @param outputToBeChecked + * @param props bundle with strings + * @param reg regexter with rules how to handle national characters + * @throws IOException + */ + private void iteratePropertiesForAprox(String outputToBeChecked, ResourceBundle props, Regexer reg) throws IOException { + int keysFound = 0; + for (int i = 0; i < keys.length; i++) { + String string = keys[i]; + String value = props.getString(string); + if (value == null) { + continue; + } + value = reg.regexIt(value); + keysFound++; + { + Assert.assertTrue("Output must match "+reg.getId() +" text, failed on " + string, outputToBeChecked.matches(value)); + } + } + Assert.assertTrue("At least one key must be found, was not", keysFound > 0); + } + + private void iteratePropertiesForAproxCzCs(String stdout) throws IOException { + iteratePropertiesForAprox(stdout, getPropertiesCz(), Regexer.cz); + } + private void iteratePropertiesForAproxDe(String stdout) throws IOException { + iteratePropertiesForAprox(stdout, getPropertiesDe(), Regexer.de); + } + + private void iteratePropertiesForAproxPl(String stdout) throws IOException { + iteratePropertiesForAprox(stdout, getPropertiesPl(), Regexer.pl); + } + + + + private static final class Regexer { + + private static final String[] czEvil = { + "á", + "č", + "ď", + "ě", + "é", + "í", + "ň", + "ó", + "ř", + "š", + "ť", + "ú", + "ů", + "ý", + "ž", + "[", + "]", + "(", + ")"}; + private static final String[] deEvil = { + "ä", + "ö", + "ß", + "ü", + "[", + "]", + "(", + ")"}; + + private static final String[] plEvil = { + "ó", + "ą", + "ę", + "ó", + "ł", + "ć", + "ś", + "ź", + "ż", + "ń", + "[", + "]", + "(", + ")"}; + + private static final Regexer cz = new Regexer(czEvil,"cz"); + private static final Regexer de = new Regexer(deEvil,"de"); + private static final Regexer pl = new Regexer(plEvil,"pl"); + + private final String[] map; + private final String id; + + public Regexer(String[] map, String id) { + this.map = map; + this.id = id; + } + + public String getId() { + return id; + } + + + + + /** + * This method transforms given string to asci-only regex, replacing + * groups of national characters (defined by array variable) by .+ + * + * @param value + * @return + */ + public String regexIt(String value) { + for (int i = 0; i < map.length; i++) { + String string = map[i]; + value = value.replace(string, "."); + value = value.replace(string.toUpperCase(), "."); + } + + value = value.replaceAll("\\.+", ".+"); + value = "(?s).*" + value + ".*"; + return value; + } + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jnlp icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jnlp 2013-05-03 19:08:24.866512378 +0000 @@ -0,0 +1,63 @@ + + + + + AppletTest + IcedTea + + AppletTest + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnlp icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnlp 2013-05-03 19:08:24.866512378 +0000 @@ -0,0 +1,63 @@ + + + + + ParametrizedJarAppletUrl + IcedTea + + ParametrizedJarAppletUrl + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned2.jnlp icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned2.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned2.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned2.jnlp 2013-05-03 19:08:24.868512354 +0000 @@ -0,0 +1,63 @@ + + + + + AppletTest + IcedTea + + AppletTest + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned.jnlp icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned.jnlp 2013-05-03 19:08:24.866512378 +0000 @@ -0,0 +1,63 @@ + + + + + ParametrizedJarAppletUrlSigned + IcedTea + + ParametrizedJarAppletUrlSigned + + + + + + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl1.jnlp icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl1.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl1.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl1.jnlp 2013-05-03 19:08:24.868512355 +0000 @@ -0,0 +1,53 @@ + + + + + ParametrizedJarUrl1 + IcedTea + + ParametrizedJarUrl1 + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl2.jnlp icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl2.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl2.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl2.jnlp 2013-05-03 19:08:24.868512355 +0000 @@ -0,0 +1,53 @@ + + + + + ParametrizedJarUrl2 + IcedTea + + ParametrizedJarUrl2 + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl.html icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl.html --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl.html 2013-05-03 19:08:24.868512355 +0000 @@ -0,0 +1,44 @@ + + +

    + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jnlp icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jnlp 2013-05-03 19:08:24.869512342 +0000 @@ -0,0 +1,53 @@ + + + + + ParametrizedJarUrlSigned1 + IcedTea + + ParametrizedJarUrlSigned1 + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jnlp icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jnlp 2013-05-03 19:08:24.869512342 +0000 @@ -0,0 +1,53 @@ + + + + + ParametrizedJarUrlSigned2 + IcedTea + + ParametrizedJarUrlSigned2 + + + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.html icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.html --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.html 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.html 2013-05-03 19:08:24.869512342 +0000 @@ -0,0 +1,44 @@ + + +

    + + +

    + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java --- icedtea-web-1.3.2/tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java 2013-05-03 19:08:24.870512329 +0000 @@ -0,0 +1,246 @@ +/* SimpleTest1Test.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.ServerLauncher; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import org.junit.Assert; + +import org.junit.Test; + +public class ParametrizedJarUrlTests extends BrowserTest{ + + private final List l = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); + + @Test + @TestInBrowsers(testIn = Browsers.one) + @Bug(id = "PR905") + public void parametrizedAppletTestSignedBrowserTest_hardcodedDifferentCodeBase() throws Exception { + ServerLauncher server2 = ServerAccess.getIndependentInstance(); + String originalResourceName = "ParametrizedJarUrlSigned.html"; + String newResourceName = "ParametrizedJarUrlSigned_COPY2.html"; + createCodeBase(originalResourceName, newResourceName, server2.getUrl("")); + //set codebase to second server + ProcessResult pr = server.executeBrowser(newResourceName); + server2.stop(); + evaluateSignedApplet(pr); + } + + @Test + @TestInBrowsers(testIn = Browsers.one) + @Bug(id = "PR905") + public void parametrizedAppletTestSignedBrowserTest_hardcodedCodeBase() throws Exception { + String originalResourceName = "ParametrizedJarUrlSigned.html"; + String newResourceName = "ParametrizedJarUrlSigned_COPY1.html"; + createCodeBase(originalResourceName, newResourceName, server.getUrl("")); + ProcessResult pr = server.executeBrowser(newResourceName); + evaluateSignedApplet(pr); + } + + private void createCodeBase(String originalResourceName, String newResourceName, URL codebase) throws MalformedURLException, IOException { + String originalContent = ServerAccess.getContentOfStream(new FileInputStream(new File(server.getDir(), originalResourceName))); + String nwContent = originalContent.replaceAll("codebase=\".\"", "codebase=\"" + codebase + "\""); + ServerAccess.saveFile(nwContent, new File(server.getDir(), newResourceName)); + } + + @Test + @TestInBrowsers(testIn = Browsers.one) + @Bug(id = "PR905") + public void parametrizedAppletTestSignedBrowserTest() throws Exception { + ProcessResult pr = server.executeBrowser("/ParametrizedJarUrlSigned.html"); + evaluateSignedApplet(pr); + } + + @Test + @TestInBrowsers(testIn=Browsers.one) + public void parametrizedAppletInBrowserWithParamTest() throws Exception { + ProcessResult pr = server.executeBrowser("/ParametrizedJarUrl.html?giveMeMore?orNot"); + evaluateApplet(pr); + } + + @Test + public void parametrizedAppletJavawsTest() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarAppletUrl2.jnlp"); + evaluateApplet(pr); + } + + @Test + public void parametrizedAppletJavawsTest2() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarAppletUrl2.jnlp?test=123456"); + evaluateApplet(pr); + } + + @Test + public void parametrizedAppletJavawsTest3() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarAppletUrl.jnlp"); + evaluateApplet(pr); + } + + @Test + public void parametrizedAppletJavawsTestSignedTest() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarAppletUrlSigned2.jnlp"); + evaluateSignedApplet(pr); + } + + @Test + public void parametrizedAppletJavawsTestSigned2Test() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarAppletUrlSigned2.jnlp?test=123456"); + evaluateSignedApplet(pr); + } + + @Test + public void parametrizedAppletJavawsTestSignedTest4() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarAppletUrlSigned.jnlp"); + evaluateSignedApplet(pr); + } + + private void evaluateSignedApplet(ProcessResult pr) { + String s3 = "AppletTestSigned was initialised"; + Assert.assertTrue("AppletTestSigned stdout should contain " + s3 + " but didn't", pr.stdout.contains(s3)); + String s0 = "AppletTestSigned was started"; + Assert.assertTrue("AppletTestSigned stdout should contain " + s0 + " but didn't", pr.stdout.contains(s0)); + String s1 = "value1"; + Assert.assertTrue("AppletTestSigned stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); + String s2 = "value2"; + Assert.assertTrue("AppletTestSigned stdout should contain " + s2 + " but didn't", pr.stdout.contains(s2)); +// too strict! +// String s4 = "AppletTestSigned was stopped"; +// Assert.assertFalse("AppletTestSigned stdout shouldn't contains " + s4 + " but did", pr.stdout.contains(s4)); +// String s5 = "AppletTestSigned will be destroyed"; +// Assert.assertFalse("AppletTestSigned stdout shouldn't contains " + s5 + " but did", pr.stdout.contains(s5)); +// String ss = "xception"; +// Assert.assertFalse("AppletTestSigned stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); + String s7 = "AppletTestSigned killing himself after 2000 ms of life"; + Assert.assertTrue("AppletTestSigned stdout should contain " + s7 + " but didn't", pr.stdout.contains(s7)); + } + + + @Test + public void testParametrizedJarUrlSigned1() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarUrlSigned1.jnlp"); + String s = "Good simple javaws exapmle"; + Assert.assertTrue("ParametrizedJarUrlSigned1 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); + String ss = "xception"; + Assert.assertFalse("ParametrizedJarUrlSigned1 stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); + } + + @Test + public void testParametrizedJarUrlSigned2() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarUrlSigned2.jnlp"); + String s = "Good simple javaws exapmle"; + Assert.assertTrue("ParametrizedJarUrlSigned2 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); + String ss = "xception"; + Assert.assertFalse("ParametrizedJarUrlSigned2 stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); + } + + @Test + public void testParametrizedJarUrlSigned3() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarUrlSigned2.jnlp?test=123456"); + String s = "Good simple javaws exapmle"; + Assert.assertTrue("ParametrizedJarUrlSigned2 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); + String ss = "xception"; + Assert.assertFalse("ParametrizedJarUrlSigned2 stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); + } + + @Test + public void testParametrizedJarUrl1() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarUrl1.jnlp"); + String s = "Good simple javaws exapmle"; + Assert.assertTrue("ParametrizedJarUrl1 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); + String ss = "xception"; + Assert.assertFalse("ParametrizedJarUrl1 stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); + } + + @Test + public void testParametrizedJarUrl2() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarUrl2.jnlp"); + String s = "Good simple javaws exapmle"; + Assert.assertTrue("ParametrizedJarUrl2 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); + String ss = "xception"; + Assert.assertFalse("ParametrizedJarUrl2 stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); + } + + @Test + public void testParametrizedJarUrl3() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarUrl2.jnlp?test=123456"); + String s = "Good simple javaws exapmle"; + Assert.assertTrue("ParametrizedJarUrl2 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); + String ss = "xception"; + Assert.assertFalse("ParametrizedJarUrl2 stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); +; + } + + private void evaluateApplet(ProcessResult pr) { + String s3 = "applet was initialised"; + Assert.assertTrue("AppletTest stdout should contain " + s3 + " but didn't", pr.stdout.contains(s3)); + String s0 = "applet was started"; + Assert.assertTrue("AppletTest stdout should contain " + s0 + " but didn't", pr.stdout.contains(s0)); + String s1 = "value1"; + Assert.assertTrue("AppletTest stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); + String s2 = "value2"; + Assert.assertTrue("AppletTest stdout should contain " + s2 + " but didn't", pr.stdout.contains(s2)); +// This is to strict, each browser is killing as it wish +// String s4 = "applet was stopped"; +// Assert.assert("AppletTest stdout shouldn't contains " + s4 + " but did", pr.stdout.contains(s4)); +// String s5 = "applet will be destroyed"; +// Assert.assert("AppletTest stdout shouldn't contains " + s5 + " but did", pr.stdout.contains(s5)); + String ss = "xception"; + Assert.assertFalse("AppletTest stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); + String s7 = "Aplet killing himself after 2000 ms of life"; + Assert.assertTrue("AppletTest stdout should contain " + s7 + " but didn't", pr.stdout.contains(s7)); + } + + @Test + @TestInBrowsers(testIn=Browsers.one) + public void parametrizedAppletInBrowserTest() throws Exception { + ProcessResult pr = server.executeBrowser("/ParametrizedJarUrl.html"); + pr.process.destroy(); + evaluateApplet(pr); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java icedtea-web-1.4/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java --- icedtea-web-1.3.2/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java 2013-05-03 19:08:24.879512215 +0000 @@ -0,0 +1,47 @@ +/* SimpleApplet.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.applet.Applet; + +@SuppressWarnings("serial") +public class SimpleApplet extends Applet { + + @Override + public void start() { + System.out.println("*** APPLET FINISHED ***"); + } +} Binary files /tmp/NuT9CcZAiZ/icedtea-web-1.3.2/tests/reproducers/simple/simpletest1/resources/netxPlugin.png and /tmp/WZlglBfzlP/icedtea-web-1.4/tests/reproducers/simple/simpletest1/resources/netxPlugin.png differ diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/simpletest1/srcs/SimpleTest1.java icedtea-web-1.4/tests/reproducers/simple/simpletest1/srcs/SimpleTest1.java --- icedtea-web-1.3.2/tests/reproducers/simple/simpletest1/srcs/SimpleTest1.java 2013-04-10 11:40:24.039668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/simpletest1/srcs/SimpleTest1.java 2013-05-03 19:08:24.902511927 +0000 @@ -39,5 +39,10 @@ public static void main(String[] args){ System.out.println("Good simple javaws exapmle"); + for (int i = 0; i < args.length; i++) { + String string = args[i]; + System.out.println(string); + + } } } diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java icedtea-web-1.4/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java --- icedtea-web-1.3.2/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java 2013-04-10 11:40:24.039668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java 2013-05-03 19:08:24.902511927 +0000 @@ -35,7 +35,14 @@ exception statement from your version. */ - +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Arrays; +import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; @@ -44,18 +51,63 @@ public class SimpleTest1Test { private static ServerAccess server = new ServerAccess(); + private static final List strict = Arrays.asList(new String[]{"-strict", ServerAccess.VERBOSE_OPTION}); + + private void checkLaunched(ProcessResult pr) { + checkLaunched(pr, false); + } - + private void checkLaunched(ProcessResult pr, boolean negate) { + String s = "Good simple javaws exapmle"; + if (negate) { + Assert.assertFalse("testSimpletest1lunchOk stdout should NOT contains " + s + " bud did", pr.stdout.contains(s)); + } else { + Assert.assertTrue("testSimpletest1lunchOk stdout should contains " + s + " bud didn't", pr.stdout.contains(s)); + } + String ss = "xception"; + if (negate) { + Assert.assertTrue("testSimpletest1lunchOk stderr should contains " + ss + " but didn't", pr.stderr.contains(ss)); + } else { + Assert.assertFalse("testSimpletest1lunchOk stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); + } + Assert.assertFalse(pr.wasTerminated); + Assert.assertEquals((Integer) 0, pr.returnValue); + } @Test public void testSimpletest1lunchOk() throws Exception { - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/simpletest1.jnlp"); - String s="Good simple javaws exapmle"; - Assert.assertTrue("testSimpletest1lunchOk stdout should contains "+s+" bud didn't",pr.stdout.contains(s)); - String ss="xception"; - Assert.assertFalse("testSimpletest1lunchOk stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); - Assert.assertFalse(pr.wasTerminated); - Assert.assertEquals((Integer)0, pr.returnValue); + ProcessResult pr = server.executeJavawsHeadless(null, "/simpletest1.jnlp"); + checkLaunched(pr); + } + + @Test + public void testSimpletest1lunchNotOkJnlpStrict() throws Exception { + ProcessResult pr = server.executeJavawsHeadless(strict, "/simpletest1.jnlp"); + checkLaunched(pr, true); + } + + @Test + public void testSimpletest1lunchOkStrictJnlp() throws Exception { + String originalResourceName = "simpletest1.jnlp"; + String newResourceName = "simpletest1_strict.jnlp"; + createStrictFile(originalResourceName, newResourceName, server.getUrl("")); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + newResourceName); + checkLaunched(pr); } - } + @Test + public void testSimpletest1lunchOkStrictJnlpStrict() throws Exception { + String originalResourceName = "simpletest1.jnlp"; + String newResourceName = "simpletest1_strict.jnlp"; + createStrictFile(originalResourceName, newResourceName, server.getUrl("")); + ProcessResult pr = server.executeJavawsHeadless(strict, "/" + newResourceName); + checkLaunched(pr); + } + + private void createStrictFile(String originalResourceName, String newResourceName, URL codebase) throws MalformedURLException, IOException { + String originalContent = ServerAccess.getContentOfStream(new FileInputStream(new File(server.getDir(), originalResourceName))); + String nwContent1 = originalContent.replaceAll("href=\""+originalResourceName+"\"", "href=\""+newResourceName+"\""); + String nwContent = nwContent1.replaceAll("codebase=\".\"", "codebase=\"" + codebase + "\""); + ServerAccess.saveFile(nwContent, new File(server.getDir(), newResourceName)); + } +} diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/simpletest2/srcs/SimpleTest2.java icedtea-web-1.4/tests/reproducers/simple/simpletest2/srcs/SimpleTest2.java --- icedtea-web-1.3.2/tests/reproducers/simple/simpletest2/srcs/SimpleTest2.java 2013-04-10 11:40:24.039668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/simpletest2/srcs/SimpleTest2.java 2013-05-03 19:08:24.903511914 +0000 @@ -1,3 +1,6 @@ + +import java.applet.Applet; + /* SimpleTest2.java Copyright (C) 2011 Red Hat, Inc. @@ -35,10 +38,31 @@ exception statement from your version. */ -public class SimpleTest2{ +public class SimpleTest2 extends Applet{ + + public static void main(String[] args) { + throw new RuntimeException("Correct exception"); + } + + @Override + public void init() { + System.out.println("applet was initialised"); + } - public static void main(String[] args){ -throw new RuntimeException("Correct exception"); + @Override + public void start() { + System.out.println("applet was started"); + main(null); + } + @Override + public void stop() { + System.out.println("applet was stopped"); } + + @Override + public void destroy() { + System.out.println("applet will be destroyed"); + } + } diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java icedtea-web-1.4/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java 2013-04-10 11:40:24.030668000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java 2013-05-03 19:08:24.881512191 +0000 @@ -109,7 +109,7 @@ try { boolean isJavawsTest = isJnlp(launchFile); pr = isJavawsTest ? server.executeJavawsHeadless(launchFile, null, null) - : server.executeBrowser(launchFile, null, null); + : server.executeBrowser(launchFile); } catch (Exception ex) { ServerAccess.logException(ex); } finally { diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarDisabled.jnlp icedtea-web-1.4/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarDisabled.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarDisabled.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarDisabled.jnlp 2013-05-03 19:08:24.890512077 +0000 @@ -0,0 +1,52 @@ + + + + + + + Test versioned jars + IcedTea + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarEnabled.jnlp icedtea-web-1.4/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarEnabled.jnlp --- icedtea-web-1.3.2/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarEnabled.jnlp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarEnabled.jnlp 2013-05-03 19:08:24.890512077 +0000 @@ -0,0 +1,52 @@ + + + + + + + Test replacing security manager + IcedTea + + + + + + + diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/VersionedJar__V1/srcs/VersionedJar.java icedtea-web-1.4/tests/reproducers/simple/VersionedJar__V1/srcs/VersionedJar.java --- icedtea-web-1.3.2/tests/reproducers/simple/VersionedJar__V1/srcs/VersionedJar.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/VersionedJar__V1/srcs/VersionedJar.java 2013-05-03 19:08:24.891512065 +0000 @@ -0,0 +1,46 @@ +/* Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +import java.applet.*; +import java.awt.*; +import java.lang.reflect.Array; +import java.lang.reflect.Field; + +public class VersionedJar { + static public void main(String[] args) { + System.out.println("Versioned jar was accessed."); + } +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java icedtea-web-1.4/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java --- icedtea-web-1.3.2/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java 2013-05-03 19:08:24.891512065 +0000 @@ -0,0 +1,64 @@ +/* Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + + +import junit.framework.Assert; + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; + +import org.junit.Test; + +public class VersionedJarTest { + + private static final ServerAccess server = new ServerAccess(); + private static final String VERSIONED = "Versioned jar was accessed."; + private static final String FAILURE = "net.sourceforge.jnlp.LaunchException"; + + @Test + public void testDisabledVersionParameter() throws Exception { + ProcessResult pr = server.executeJavawsHeadless("/VersionedJarDisabled.jnlp"); + Assert.assertFalse("Stdout should NOT contain '" + VERSIONED + "', but did.", pr.stdout.contains(VERSIONED)); + Assert.assertTrue("Stderr should contain '" +FAILURE + "', but did not.", pr.stderr.contains(FAILURE)); + } + + @Test + public void testEnabledVersionParameter() throws Exception { + ProcessResult pr = server.executeJavawsHeadless("/VersionedJarEnabled.jnlp"); + Assert.assertTrue("Stdout should contain '" + VERSIONED + "', but did not.", pr.stdout.contains(VERSIONED)); + Assert.assertFalse("Stderr should NOT contain '" +FAILURE + "', but did.", pr.stderr.contains(FAILURE)); + } +} \ No newline at end of file diff -Nru icedtea-web-1.3.2/tests/softkiller/Makefile icedtea-web-1.4/tests/softkiller/Makefile --- icedtea-web-1.3.2/tests/softkiller/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/softkiller/Makefile 2013-05-03 19:08:24.904511901 +0000 @@ -0,0 +1,9 @@ +# we need c99 because of snprintf function! +# (this function does not exist in C89/ANSI C) + +softkiller: softkiller.c + $(CC) -Wall -pedantic -std=c99 -o $@ -lX11 $< + +clean: + rm softkiller + diff -Nru icedtea-web-1.3.2/tests/softkiller/softkiller.c icedtea-web-1.4/tests/softkiller/softkiller.c --- icedtea-web-1.3.2/tests/softkiller/softkiller.c 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/softkiller/softkiller.c 2013-05-03 19:08:24.904511901 +0000 @@ -0,0 +1,443 @@ +/* X Window app killer + * + * Author: Pavel Tisnovsky + * + * Compile: + * gcc -Wall -pedantic -std=c99 -o softkiller softkiller.c -lX11 + * (please note that -std=c99 is needed because we use snprintf + * function which does not exist in C89/ANSI C) + * + * Run: + * ./softkiller PID + */ + + + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Number of long decimal digits + 1 (for ASCIIZ storage) + */ +#define MAX_LONG_DECIMAL_DIGITS 21 + +/* + * Max line length in /proc/stat files + */ +#define MAX_LINE 8192 + +/* + * Max filename length for /proc/... files + */ +#define MAX_FILENAME 32 + +/* + * Return values + */ +#define EXIT_CODE_OK 0 +#define EXIT_CODE_ERROR 1 + +/* + * Different softkilling strategies + */ +#define TRY_TO_CLOSE_WINDOW 1 +#define TRY_TO_KILL_WINDOW 1 + +/* + * Delay between application of different softkilling strategies. + */ +#define SLEEP_AMOUNT 2 + +/* + * Not in c89/c99... + */ +#define file_no(FP) ((FP)->_fileno) + +/* + * Basic information about given process + */ +typedef struct ProcStruct +{ + long uid, pid, ppid; + char cmd[MAX_LINE]; +} ProcStruct; + +ProcStruct *P = NULL; + +int N = 0; + +Display *display; +Window root_window; +Atom atom_pid; + + + +/* + * Read basic process info from the file /proc/${PID}/stat + * where ${PID} is process ID. + */ +int read_process_info(char *file_name_part, ProcStruct *P) +{ + FILE *fin; + char filename[MAX_FILENAME]; + struct stat stat; + + /* try to open file /proc/${PID}/stat for reading */ + snprintf(filename, sizeof(filename), "%s%s", file_name_part, "/stat"); + fin = fopen(filename, "r"); + + if (fin == NULL) + { + return 0; /* process vanished since glob() */ + } + + /* read basic process info */ + if (3 != fscanf(fin, "%ld %s %*c %ld", &(P->pid), P->cmd, &(P->ppid))) + { + fclose(fin); + return 0; /* Problem with file format, AFAIK should not happen */ + } + if (fstat(file_no(fin), &stat)) + { + fclose(fin); + return 0; + } + P->uid = stat.st_uid; + + /* fin can't be NULL here */ + fclose(fin); + return 1; +} + + + +/* + * Read command line parameters for given ${PID} + */ +int read_cmd_line(char *file_name_part, char *cmd) +{ + FILE *fin; + char filename[MAX_FILENAME]; + int c; + int k = 0; + + /* try to open file /proc/${PID}/cmdline for reading */ + snprintf(filename, sizeof(filename), "%s%s", file_name_part, "/cmdline"); + fin = fopen(filename, "r"); + + if (fin == NULL) + { + return 0; /* process vanished since glob() */ + } + + /* replace \0 by spaces */ + while (k < MAX_LINE - 1 && EOF != (c = fgetc(fin))) + { + cmd[k++] = c == '\0' ? ' ' : c; + } + if (k > 0) + { + cmd[k] = '\0'; + } + + /* fin can't be NULL here */ + fclose(fin); + return 1; +} + + + +/* + * Fill in an array pointed by P. + */ +int get_processes(void) +{ + glob_t globbuf; + unsigned int i, j; + + glob("/proc/[0-9]*", GLOB_NOSORT, NULL, &globbuf); + + P = calloc(globbuf.gl_pathc, sizeof(struct ProcStruct)); + if (P == NULL) + { + fprintf(stderr, "Problems with malloc, it should not happen...\n"); + exit(1); + } + + for (i = j = 0; i < globbuf.gl_pathc; i++) + { + char * name_part = globbuf.gl_pathv[globbuf.gl_pathc - i - 1]; + if (read_process_info(name_part, &(P[j])) == 0) + { + continue; + } + if (read_cmd_line(name_part, P[j].cmd) == 0) + { + continue; + } + /* Debug output */ + /* printf("uid=%5ld, pid=%5ld, ppid=%5ld, cmd='%s'\n", P[j].uid, P[j].pid, P[j].ppid, P[j].cmd); */ + j++; + } + globfree(&globbuf); + return j; +} + + + +/* + * Try to open X Display + */ +Display * open_display(void) +{ + Display *display = XOpenDisplay(0); + if (display == NULL) + { + puts("Cannot open display"); + exit(EXIT_CODE_ERROR); + } + return display; +} + + + +/* + * Return the atom identifier for the atom name "_NET_WM_PID" + */ +Atom get_atom_pid(Display *display) +{ + Atom atom_pid = XInternAtom(display, "_NET_WM_PID", True); + if (atom_pid == None) + { + printf("No such atom _NET_WM_PID"); + exit(EXIT_CODE_ERROR); + } + return atom_pid; +} + + + +/* + * Try to focus the window and send Ctrl+W to it. + */ +void close_window(Window window, long processId) +{ + char windowIDstr[MAX_LONG_DECIMAL_DIGITS]; + pid_t pid; + + snprintf(windowIDstr, MAX_LONG_DECIMAL_DIGITS, "%ld", window); + char *args[] = + { + "/usr/bin/xdotool", + "windowfocus", + windowIDstr, + "windowactivate", + windowIDstr, + "key", + "--window", + windowIDstr, + "--clearmodifiers", + "Ctrl+W", + (char *) NULL + }; + if ((pid = fork()) == -1) + { + perror("some fork error"); + } + else if (pid == 0) + { + /* child process */ + printf("Trying to close window ID %ld for process ID %ld\n", (long)window, processId); + execv("/usr/bin/xdotool", args); + } + else + { + /* parent process */ + sleep(SLEEP_AMOUNT); + } +} + + + +/* + * Run xkill to kill window with specified window ID + */ +void kill_window(Window window, long processId) +{ + char windowIDstr[MAX_LONG_DECIMAL_DIGITS]; + pid_t pid; + + /* we need to convert window id (long) into a string to call xkill */ + snprintf(windowIDstr, MAX_LONG_DECIMAL_DIGITS, "%ld", window); + char *args[] = + { + "/usr/bin/xkill", + "-id", + windowIDstr, + (char *) NULL + }; + if ((pid = fork()) == -1) + { + perror("some fork error"); + } + else if (pid == 0) + { + printf("Trying to kill window ID %ld for process ID %ld\n", (long)window, processId); + execv("/usr/bin/xkill", args); + } + else + { + // parent + sleep(SLEEP_AMOUNT); + } +} + + + +/* + * Recursivelly search for a window(s) associated with given process ID + */ +void search_and_destroy(Display *display, Window window, Atom atomPID, long processId) +{ + Atom type; + int format; + unsigned long nItems; + unsigned long bytesAfter; + unsigned char *propertyPID = NULL; + + /* read _NET_WM_PID property, if exists */ + if (Success == XGetWindowProperty(display, window, atomPID, 0, 1, False, XA_CARDINAL, + &type, &format, &nItems, &bytesAfter, &propertyPID)) + { + if (propertyPID != NULL) + { + if (processId == *((unsigned long *)propertyPID)) + { + printf("Found window ID %ld for process ID %ld\n", (long)window, processId); + XFree(propertyPID); +#if TRY_TO_CLOSE_WINDOW == 1 + close_window(window, processId); +#endif +#if TRY_TO_KILL_WINDOW == 1 + kill_window(window, processId); +#endif + } + } + } + + /* recurse into child windows */ + Window rootWindow; + Window parentWindow; + Window *childWindows; + unsigned nChildren; + if (0 != XQueryTree(display, window, &rootWindow, &parentWindow, &childWindows, &nChildren)) + { + unsigned int i; + for(i = 0; i < nChildren; i++) + { + search_and_destroy(display, childWindows[i], atomPID, processId); + } + } +} + + + +/* + * Kill process with given ancestor PID. + */ +void kill_process(int pid) +{ + Atom atom_pid = get_atom_pid(display); + printf("Searching for windows associated with PID %d\n", pid); + search_and_destroy(display, root_window, atom_pid, pid); +} + + + +/* + * Kill all processes with given ppid (ancestor PID) + */ +void kill_processes_with_ppid(int ppid) +{ + int i; + int done = 1; + for (i = 0; i < N; i++) + { + if (ppid == P[i].ppid) + { + int pid = P[i].pid; + printf("uid=%5ld, pid=%5ld, ppid=%5ld, cmd='%s'\n", P[i].uid, P[i].pid, P[i].ppid, P[i].cmd); + kill_processes_with_ppid(pid); + /* at least one child process exists */ + done = 0; + kill_process(pid); + } + } + kill_process(ppid); + /* if none child processes have been found we are at bottom of the process tree */ + if (done) + { + return; + } +} + + + +/* TODO: better check for user input */ +int read_pid(int argc, char **argv) +{ + int pid; + + if (argc != 2) + { + puts("Usage softkiller PID"); + exit(EXIT_CODE_ERROR); + } + + pid = atoi(argv[1]); + + if (sscanf(argv[1], "%d", &pid) != 1) + { + printf("Wrong PID entered: %s\n", argv[1]); + exit(EXIT_CODE_ERROR); + } + + /* basic check (nobody should try to kill PID 0 :) */ + if (pid <= 0) + { + printf("Wrong process ID %d\n", pid); + exit(EXIT_CODE_ERROR); + } + + return pid; +} + + + +/* + * Entry point to this tool. + */ +int main(int argc, char **argv) +{ + int pid = read_pid(argc, argv); + + printf("ancestor PID to kill: %d\n", pid); + + N = get_processes(); + printf("N = %d\n", N); + display = open_display(); + root_window = XDefaultRootWindow(display); + atom_pid = get_atom_pid(display); + + kill_processes_with_ppid(pid); + + puts("*** Done! ***"); + return 0; +} + diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/annotations/KnownToFail.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/annotations/KnownToFail.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/annotations/KnownToFail.java 2013-04-10 11:40:24.044668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/annotations/KnownToFail.java 2013-05-03 19:08:24.914511777 +0000 @@ -41,6 +41,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import net.sourceforge.jnlp.browsertesting.Browsers; /** *

    @@ -52,10 +53,15 @@ * This annotation is meant for adding tests for bugs before the fix is * implemented. *

    + *

    + * The meaning of optional parameter failsIn is either a list of + * browsers where the test fails, or a default value - an empty array {}, + * default value means that the test fails always. + *

    */ @Target({ElementType.METHOD,ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface KnownToFail { - + public Browsers[] failsIn() default {}; } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java 2013-05-03 19:08:24.914511777 +0000 @@ -0,0 +1,52 @@ +/* Bug.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Mark for tests running content on remote servers + */ +@Target({ElementType.TYPE,ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface Remote { + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/AsyncCall.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/AsyncCall.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/AsyncCall.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/AsyncCall.java 2013-05-03 19:08:24.907511862 +0000 @@ -0,0 +1,102 @@ +package net.sourceforge.jnlp; + +import java.util.concurrent.Callable; + +/** + * A call that runs on a separate thread, with an optional timeout. It takes a runnable and allows + * joining. + * + * On join, throws any exceptions that occurred within the call, or a TimeOutException if + * it did not finish. Returns the value from the call. + */ +public class AsyncCall { + static public class TimeOutException extends RuntimeException { + public TimeOutException() { + super("Call did not finish within the allocated time."); + } + } + + private Thread handler; + private Callable callable; + private long timeout; + private T callResult; + + /* Captures exception from async call */ + private Exception asyncException = null; + + /* Create an AsyncCall with a given time-out */ + public AsyncCall(Callable callable, long timeout) { + this.callable = callable; + this.timeout = timeout; + this.handler = new HandlerThread(); + } + + /* Create an AsyncCall with (effectively) no time-out */ + public AsyncCall(Callable call) { + this(call, Long.MAX_VALUE); + } + + /* Chains construction + start for convenience */ + public static AsyncCall startWithTimeOut(Callable callable, long timeout) { + AsyncCall asyncCall = new AsyncCall(callable, timeout); + asyncCall.start(); + return asyncCall; + } + + /* Chains construction + start for convenience */ + public static AsyncCall startWithTimeOut(Callable callable) { + return startWithTimeOut(callable, 1000); // Default timeout of 1 second + } + + public void start() { + this.handler.start(); + } + + // Rethrows exceptions from handler thread, and throws TimeOutException in case of time-out. + public T join() throws Exception { + handler.join(); + if (asyncException != null) { + throw asyncException; + } + return callResult; + } + + /* The handler thread is responsible for timing-out the Callable thread. + * The resulting thread */ + private class HandlerThread extends Thread { + @Override + public void run() { + Thread thread = new Thread() { + @Override + public void run() { + try { + /* Capture result of the call */ + callResult = callable.call(); + } catch (Exception e) { + /* In case of exception, capture for re-throw */ + asyncException = e; + } + handler.interrupt(); // Finish early + } + }; + + thread.start(); + + try { + Thread.sleep(timeout); + } catch (InterruptedException e) { + // Finish early + return; + } + + if (thread.isAlive()) { + asyncException = new TimeOutException(); + } + + // Make sure the thread is finished + while (thread.isAlive()) { + thread.interrupt(); + } + } + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java 2013-05-03 19:08:24.916511751 +0000 @@ -0,0 +1,111 @@ +/* KeyboardActions.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + + +package net.sourceforge.jnlp.awt.awtactions; + +import java.awt.Robot; +import java.awt.event.KeyEvent; + +public class KeyboardActions { + + private static final int defaultDelay = 250; + + /** + * method writeText for simulating typing the + * given String text by a user with delays + * allowed characters in the text: 0-9, a-z, the space + * between the keystrokes + * + * @param robot + * @param text + * @param delayMs + */ + public static void writeText(Robot robot, String text, int delayMs){ + for (int i = 0; i < text.length(); i++){ + char c = text.charAt(i); + typeKey(robot, keyFromChar(c), delayMs); + } + } + + public static void writeText(Robot robot, String text){ + writeText(robot,text, defaultDelay); + } + + /** + * method typeKey for pressing and releasing given key + * with a reasonable delay + * + * @param robot + * @param key + * @param delayMs + */ + + public static void typeKey(Robot robot, int key, int delayMs){ + robot.delay(delayMs); + robot.keyPress(key); + robot.delay(delayMs); + robot.keyRelease(key); + } + + public static void typeKey(Robot robot, int key){ + typeKey(robot, key, defaultDelay); + } + + /** + * method returning the KeyInput event int + * if the character is not from a-b, 0-9, the returned value is + * KeyEvent.VK_SPACE + * + * @param ch + * @return + */ + public static int keyFromChar(char ch){ + int key; + + if( ('0' <= ch) && ('9' >= ch) ){ + key = (int)(ch - '0') + KeyEvent.VK_0; + }else if( ( 'a' <= ch) && ('z' >= ch) ){ + key = (int)(ch - 'a') + KeyEvent.VK_A; + }else{ + key = KeyEvent.VK_SPACE; + } + + return key; + } + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/MouseActions.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/MouseActions.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/MouseActions.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/MouseActions.java 2013-05-03 19:08:24.917511738 +0000 @@ -0,0 +1,228 @@ +/* MouseActions.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + + +package net.sourceforge.jnlp.awt.awtactions; + +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.InputEvent; + +/** + * class MouseActions + * + * static methods for manipulating the mouse via AWT robot + */ +public class MouseActions { + private static final int defaultDelay = 250; + + /** + * method click presses and releases given mouse keys + * with reasonable delay before the event + * + * @param mouseKeyMask + * @param robot + * @param delayMs + */ + public static void click(int mouseKeyMask, Robot robot, int delayMs){ + robot.delay(delayMs); + robot.mousePress(mouseKeyMask); + robot.delay(delayMs); + robot.mouseRelease(mouseKeyMask); + } + + public static void click(int mouseKeyMask, Robot robot){ + robot.delay(defaultDelay); + robot.mousePress(mouseKeyMask); + robot.delay(defaultDelay); + robot.mouseRelease(mouseKeyMask); + } + + /** + * method doubleClick presses and releases given mouse keys + * two times with reasonable delays + * + * @param mouseKeyMask + * @param robot + * @param delayMs + */ + + public static void doubleClick(int mouseKeyMask, Robot robot, int delayMs){ + click(mouseKeyMask, robot, delayMs); + click(mouseKeyMask, robot, delayMs); + } + + public static void doubleClick(int mouseKeyMask, Robot robot){ + click(mouseKeyMask, robot, defaultDelay); + click(mouseKeyMask, robot, defaultDelay); + } + + /** + * method drag presses the right mouse key, + * drags the mouse to a point, and releases the mouse key + * with reasonable delays + * + * @param xTo + * @param yTo + * @param robot + * @param delayMs + */ + public static void drag(int xTo, int yTo, Robot robot, int delayMs){ + robot.delay(delayMs); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(delayMs); + robot.mouseMove(xTo, yTo); + } + + public static void drag(int xTo, int yTo, Robot robot){ + robot.delay(defaultDelay); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(defaultDelay); + robot.mouseMove(xTo, yTo); + } + + /** + * method dragFromRectangle clicks in the middle + * of the given rectangle and drags the mouse from the rectangle + * with reasonable delays + * + * @param rectangle + * @param robot + * @param delayMs + */ + + public static void dragFromRectangle(Rectangle rectangle, Robot robot, int delayMs){ + int x1 = rectangle.x + rectangle.width/2; + int y1 = rectangle.y + rectangle.height/2; + int x2 = x1 + 2*rectangle.width; + int y2 = y1 + 2*rectangle.height; + robot.delay(delayMs); + robot.mouseMove(x1, y1); + drag(x2,y2, robot); + } + + public static void dragFromRectangle(Rectangle rectangle, Robot robot){ + dragFromRectangle(rectangle, robot, defaultDelay); + } + + /** + * method moveInsideRectangle places the mouse in the middle + * of the given rectangle and moves the mouse inside the rectangle + * with reasonable delays + * + * @param rectangle + * @param robot + * @param delayMs + */ + + public static void moveInsideRectangle(Rectangle rectangle, Robot robot, int delayMs){ + int x1 = rectangle.x + rectangle.width/2; + int y1 = rectangle.y + rectangle.height/2; + int x2 = x1 + rectangle.width/4; + int y2 = y1 + rectangle.height/4; + robot.delay(delayMs); + robot.mouseMove(x1, y1); + robot.delay(delayMs); + robot.mouseMove(x2, y2); + } + + public static void moveInsideRectangle(Rectangle rectangle, Robot robot){ + moveInsideRectangle(rectangle, robot, defaultDelay); + } + + /** + * + * @param rectangle + * @param robot + * @param delayMs + */ + public static void moveMouseToMiddle(Rectangle rectangle, Robot robot, int delayMs){ + robot.delay(delayMs); + int x = rectangle.x + (rectangle.width/2); + int y = rectangle.y + (rectangle.height/2); + robot.mouseMove(x,y); + } + + public static void moveMouseToMiddle(Rectangle rectangle, Robot robot){ + moveMouseToMiddle(rectangle, robot, defaultDelay); + } + + /** + * + * @param rectangle + * @param robot + * @param delayMs + */ + public static void moveMouseOutside(Rectangle rectangle, Robot robot, int delayMs){ + robot.delay(delayMs); + int x = rectangle.x + 2*rectangle.width; + int y = rectangle.y + 2*rectangle.height; + robot.mouseMove(x,y); + } + + public static void moveMouseOutside(Rectangle rectangle, Robot robot){ + moveMouseOutside(rectangle, robot, defaultDelay); + } + + + /** + * method clickInside moves the mouse in the middle point + * of a given rectangle and clicks with reasonable delay + + * + * @param rectangle + * @param robot + * @param delayMs + */ + public static void clickInside(int mouseKey, Rectangle rectangle, Robot robot, int delayMs){ + moveMouseToMiddle(rectangle, robot, delayMs); + robot.delay(delayMs); + click(mouseKey, robot, delayMs); + } + + public static void clickInside(int mouseKey, Rectangle rectangle, Robot robot){ + clickInside(mouseKey, rectangle, robot, defaultDelay); + } + + public static void clickInside(Rectangle rectangle, Robot robot, int delayMs){ + clickInside(InputEvent.BUTTON1_MASK, rectangle, robot, delayMs); + } + + public static void clickInside(Rectangle rectangle, Robot robot){ + clickInside(rectangle, robot, defaultDelay); + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/AWTFrameworkException.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/AWTFrameworkException.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/AWTFrameworkException.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/AWTFrameworkException.java 2013-05-03 19:08:24.915511764 +0000 @@ -0,0 +1,66 @@ +/* AWTFrameworkException.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.awt; + +/** + * Class AWTFrameworkException is thrown in the AWTFramework + * whenever the framework encounters not enough data specified + * to perform an action (for example it is impossible to ascertain + * the position of an applet in the screenshot if the width or height + * of the applet is not known. + * + */ + +public class AWTFrameworkException extends Exception { + + public AWTFrameworkException() { + super(); + } + + public AWTFrameworkException(String s) { + super(s); + } + + public AWTFrameworkException(String s, Throwable throwable) { + super(s, throwable); + } + + public AWTFrameworkException(Throwable throwable) { + super(throwable); + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java 2013-05-03 19:08:24.916511751 +0000 @@ -0,0 +1,589 @@ +/* AWTHelper.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.awt; + +import java.awt.AWTException; +import java.awt.Color; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.event.InputEvent; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import net.sourceforge.jnlp.awt.awtactions.KeyboardActions; +import net.sourceforge.jnlp.awt.awtactions.MouseActions; +import net.sourceforge.jnlp.awt.imagesearch.ComponentFinder; +import net.sourceforge.jnlp.awt.imagesearch.ComponentNotFoundException; +import net.sourceforge.jnlp.awt.imagesearch.ImageSeeker; +import net.sourceforge.jnlp.closinglisteners.Rule; +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; + +public abstract class AWTHelper extends RulesFolowingClosingListener implements Runnable{ + + //attributes possibly set by user + private String initStr = null; + private Color appletColor; + private BufferedImage marker; + private Point markerPosition; + private int appletHeight; + private int appletWidth; + private int tryKTimes = DEFAULT_K; + + //other + protected StringBuilder sb = new StringBuilder(); + private boolean actionStarted = false; + private Rectangle actionArea; + private BufferedImage screenshot; + private Robot robot; + private boolean appletFound = false; + private boolean appletColorGiven = false; //impossible to search for color difference if not given + private boolean markerGiven = false; //impossible to find the applet if marker not given + private boolean appletDimensionGiven = false; + private boolean screenshotTaken = false; + private int defaultWaitForApplet = 1000; + + //default number of times the screen is captured and the applet is searched for + //in the screenshot + public static final int DEFAULT_K = 3; + + + //several constructors + /** + * the minimal constructor - use: + * - if we do not want to find the bounds of applet area first + * - searching for buttons and other components is then done in the whole + * screen, confusion with other icons on display is then possible + * - less effective, deprecated (better bound the area first) + */ + @Deprecated + public AWTHelper() { + try { + this.robot = new Robot(); + } catch (AWTException e) { + throw new RuntimeException("AWTHelper could not create its Robot instance.",e); + } + } + + /** + * the minimal constructor with initStr - use: + * - we want to know from stdout that the applet (or sth else) is ready + * - if we do not want to find the bounds of applet area first + * - searching for buttons and other components is then done in the whole + * screen, confusion with other icons on display is then possible + * - less effective, deprecated (better bound the area first) + */ + @Deprecated + public AWTHelper(String initStr){ + this(); + + this.initStr = initStr; + } + + /** + * the constructor with icon and its position in applet of given dimension + * use: + * - we want to find and activate the applet first + * - the search for applet will be done via searching for icon + * of given position(x,y,w,h) inside applet of given width and height + * + * @param icon marker by which the applet will be found + * @param iconPosition relatively to applet (including icon width and height) + * @param appletWidth + * @param appletHeight + */ + + public AWTHelper(BufferedImage icon, Point iconPosition, int appletWidth, int appletHeight){ + this(); + this.marker = icon; + this.markerPosition = iconPosition; + this.markerGiven = true; + + this.appletWidth = appletWidth; + this.appletHeight = appletHeight; + this.appletDimensionGiven = true; + } + + public AWTHelper(String initString, BufferedImage icon, Point iconPosition, int appletWidth, int appletHeight) throws AWTException{ + this(icon, iconPosition, appletWidth, appletHeight); + + this.initStr = initString; + } + + /** + * the constructor with applet width and height only - use: + * - we want to find the applet by finding the default icon + * that is located in the upper left corner of applet + * + * @param appletWidth + * @param appletHeight + */ + public AWTHelper(int appletWidth, int appletHeight){ + this(); + + String test_server_dir_path = System.getProperty("test.server.dir"); + + this.marker = ComponentFinder.defaultIcon; + this.markerPosition = new Point(0,0); + this.markerGiven = true; + + this.appletWidth = appletWidth; + this.appletHeight = appletHeight; + this.appletDimensionGiven = true; + } + + public AWTHelper(String initString, int appletWidth, int appletHeight){ + this(appletWidth, appletHeight); + this.initStr = initString; + } + + /** + * refers to AWTHelper functioning as RulesFolowingClosingListener + * + * @param strs array of strings to be added as contains rules + */ + public void addClosingRulesFromStringArray(String [] strs){ + for(String s : strs){ + this.addContainsRule(s); + } + } + + /** + * override of method charReaded (from RulesFolowingClosingListener) + * + * waiting for the applet, when applet is ready run action thread + * (if initStr==null, do not check and do not call run) + * + * when all the wanted strings are in the stdout, applet can be closed + * + * @param ch + */ + @Override + public void charReaded(char ch) { + sb.append(ch); + //is applet ready to start clicking? + //check and run applet only if initStr is not null + if ((initStr != null) && !actionStarted && appletIsReady(sb.toString())) { + try{ + actionStarted = true; + this.findAndActivateApplet(); + this.run(); + } catch (ComponentNotFoundException e1) { + throw new RuntimeException("AWTHelper problems finding applet.",e1); + } catch (AWTFrameworkException e2){ + throw new RuntimeException("AWTHelper problems with unset attributes.",e2); + } + } + //is all the wanted output in stdout? + super.charReaded(ch); + } + + /** + * method runAWTHelper - we can call run and declared the action as started + * without finding out if initStr is in the output, if this method is + * called + * + */ + public void runAWTHelper(){ + actionStarted = true; + this.run(); + } + + /** + * implementation of AWTHelper should implement the run method + */ + public abstract void run(); + + + /** + * method getInitStrAsRule returns the initStr in the form + * of Contains rule that can be evaluated on a string + * + * @return + */ + public Rule getInitStrAsRule(){ + if( initStr != null ){ + return new ContainsRule(this.initStr); + }else{ + return new Rule(){ + + @Override + public void setRule(Object rule) { + } + + @Override + public boolean evaluate(Object upon) { + return true; + } + + @Override + public String toPassingString() { + return "nothing to check, initStr is null"; + } + + @Override + public String toFailingString() { + return "nothing to check, initStr is null"; + } + + } ; + } + } + + //boolean controls getters + protected boolean appletIsReady(String content) { + return this.getInitStrAsRule().evaluate(content); + } + + public boolean isActionStarted() { + return actionStarted; + } + + public boolean isAppletColorGiven(){ + return appletColorGiven; + } + + public boolean isAppletDimensionGiven(){ + return appletDimensionGiven; + } + + public boolean isMarkerGiven(){ + return markerGiven; + } + + //setters + /** + * method setDefaultWaitForApplet sets the time (in ms) for which the method + * captureScreenAndFindApplet will wait (for the applet to load) before it + * gets the screenshot the default time is 1000ms + * + * @param defaultWaitForApplet + */ + public void setDefaultWaitForApplet(int defaultWaitForApplet) { + this.defaultWaitForApplet = defaultWaitForApplet; + } + + public void setTryKTimes(int tryKTimes) { + this.tryKTimes = tryKTimes; + } + + public void setAppletColor(Color appletColor) { + this.appletColor = appletColor; + this.appletColorGiven = true; + } + + public void setInitStr(String initStr) { + this.initStr = initStr; + } + + public void setMarker(BufferedImage marker, Point markerPosition) { + this.marker = marker; + this.markerPosition = markerPosition; + this.markerGiven = true; + } + + public void setAppletDimension(int width, int height){ + this.appletWidth = width; + this.appletHeight = height; + this.appletDimensionGiven = true; + } + + + //creating screenshots, searching for applet + /** + * method captureScreenAndFindAppletByIcon + * 1. checks that all needed attributes of AWTHelper are given + * (marker, its position and applet width and height) + * 2. captures screen, + * 3. finds the rectangle where applet is and saves it to the attribute + * actionArea + * 4. sets screenCapture indicator to true (after tryKTimes unsuccessfull + * tries an exception "ComponentNotFound" will be raised) + * + * @throws AWTException + * @throws ComponentNotFoundException + * @throws AWTFrameworkException + */ + public void captureScreenAndFindAppletByIcon() throws ComponentNotFoundException, AWTFrameworkException { + if(!appletDimensionGiven || !markerGiven){ + throw new AWTFrameworkException("AWTFramework cannot find applet without dimension or marker!"); + } + captureScreenAndFindAppletByIconTryKTimes(marker, markerPosition, appletWidth, appletHeight, tryKTimes); + } + + /** + ** method captureScreenAndFindAppletByIcon + * 1. captures screen, + * 2. finds the rectangle where applet is and saves it to the attribute + * actionArea + * 3. sets screenCapture indicator to true (after tryKTimes unsuccessfull + * tries an exception "ComponentNotFound" will be raised) + * + * @param icon + * @param iconPosition + * @param width + * @param height + * @param K + * @throws ComponentNotFoundException + */ + public void captureScreenAndFindAppletByIconTryKTimes(BufferedImage icon, Point iconPosition, int width, int height, int K) throws ComponentNotFoundException { + + int count = 0; + appletFound = false; + while ((count < K) && !appletFound) { + robot.delay(defaultWaitForApplet); + try { + screenshot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())); + initialiseOnScreenshot(icon, iconPosition, width, height, screenshot); + } catch (ComponentNotFoundException ex) { + //keeping silent and try more-times + } + count++; + } + + if (ImageSeeker.isRectangleValid(actionArea)) { + appletFound = true; + } else { + throw new ComponentNotFoundException("Object not found in the screenshot!"); + } + + } + + public void initialiseOnScreenshot(BufferedImage icon, Point iconPosition, int width, int height, BufferedImage screenshot) throws ComponentNotFoundException { + Rectangle r = ComponentFinder.findWindowByIcon(icon, iconPosition, width, height, screenshot); + initialiseOnScreenshotAndArea(screenshot, r); + + } + + public void initialiseOnScreenshotAndArea(BufferedImage screenshot, Rectangle actionArea) throws ComponentNotFoundException { + this.screenshot = screenshot; + screenshotTaken = true; + this.actionArea = actionArea; + if (ImageSeeker.isRectangleValid(actionArea)) { + appletFound = true; + } else { + throw new ComponentNotFoundException("set invalid area!"); + } + } + + + /** + * auxiliary method writeAppletScreen for writing Buffered image into png + * + * @param appletScreen + * @param filename + * @throws IOException + */ + private void writeAppletScreen(BufferedImage appletScreen, String filename) throws IOException {// into png file + ImageIO.write(appletScreen, "png", new File(filename+".png")); + } + + + /** + * method findAndActivateApplet finds the applet by icon + * and clicks in the middle of applet area + * + * @throws ComponentNotFoundException (applet not found) + * @throws AWTFrameworkException + */ + public void findAndActivateApplet() throws ComponentNotFoundException, AWTFrameworkException + { + captureScreenAndFindAppletByIcon(); + clickInTheMiddleOfApplet(); + } + + + //methods for clicking and typing + /** + * method clickInTheMiddleOfApplet focuses the applet by clicking in the + * middle of its location rectangle + */ + public void clickInTheMiddleOfApplet() { + MouseActions.clickInside(this.actionArea, this.robot); + } + + /** + * Method clickOnIconExact - click in the middle of a rectangle with + * given pattern (icon) using specified mouse key. + * If the applet has not been found yet, the search includes whole screen. + * + * @param icon + * @param mouseKey + * @throws ComponentNotFoundException + */ + public void clickOnIconExact(BufferedImage icon, int mouseKey) throws ComponentNotFoundException{ + Rectangle areaOfSearch; + if(!appletFound){//searching whole screen, less effective + areaOfSearch = new Rectangle(0, 0, this.screenshot.getWidth(), this.screenshot.getHeight()); + }else{ + areaOfSearch = this.actionArea; + } + Rectangle iconRectangle = ImageSeeker.findExactImage(icon, this.screenshot, areaOfSearch); + + if (ImageSeeker.isRectangleValid(iconRectangle)) { + MouseActions.clickInside(mouseKey, iconRectangle, this.robot); + }else{ + throw new ComponentNotFoundException("Exact icon not found!"); + } + } + + /** + * Method clickOnIconBlurred - click in the middle of a rectangle with + * given pattern (icon) using specified mouse key. + * If the applet has not been found yet, the search includes whole screen. + * + * @param icon + * @param mouseKey + * @param precision tolerated minimal correlation (see ImageSeeker methods) + * @throws ComponentNotFoundException + */ + public void clickOnIconBlurred(BufferedImage icon, int mouseKey, double precision) throws ComponentNotFoundException{ + Rectangle areaOfSearch; + if(!appletFound){//searching whole screen, less effective + areaOfSearch = new Rectangle(0, 0, this.screenshot.getWidth(), this.screenshot.getHeight()); + }else{ + areaOfSearch = this.actionArea; + } + Rectangle iconRectangle = ImageSeeker.findBlurredImage(icon, this.screenshot, precision, areaOfSearch); + + if (ImageSeeker.isRectangleValid(iconRectangle)) { + MouseActions.clickInside(mouseKey, iconRectangle, this.robot); + }else{ + throw new ComponentNotFoundException("Blurred icon not found!"); + } + } + + /** + * Method clickOnColoredRectangle - click in the middle of a rectangle with + * given color (appletColor must be specified as the background) using + * specified mouse key. + * + * @param c + * @param mouseKey + * @throws ComponentNotFoundException + * @throws AWTFrameworkException + * + */ + public void clickOnColoredRectangle(Color c, int mouseKey) throws ComponentNotFoundException, AWTFrameworkException { + Rectangle buttonRectangle = findColoredRectangle(c); + + if (ImageSeeker.isRectangleValid(buttonRectangle)) { + MouseActions.clickInside(mouseKey, buttonRectangle, this.robot); + }else{ + throw new ComponentNotFoundException("Colored rectangle not found!"); + } + } + + public void moveToMiddleOfColoredRectangle(Color c) throws ComponentNotFoundException, AWTFrameworkException { + + Rectangle buttonRectangle = findColoredRectangle(c); + + if (ImageSeeker.isRectangleValid(buttonRectangle)) { + MouseActions.moveMouseToMiddle(buttonRectangle, this.robot); + }else{ + throw new ComponentNotFoundException("Colored rectangle not found!"); + } + } + + public void moveOutsideColoredRectangle(Color c) throws ComponentNotFoundException, AWTFrameworkException { + Rectangle buttonRectangle = findColoredRectangle(c); + + if (ImageSeeker.isRectangleValid(buttonRectangle)) { + MouseActions.moveMouseOutside(buttonRectangle, this.robot); + }else{ + throw new ComponentNotFoundException("Colored rectangle not found!"); + } + } + + public void moveInsideColoredRectangle(Color c) throws ComponentNotFoundException, AWTFrameworkException { + Rectangle buttonRectangle = findColoredRectangle(c); + + if (ImageSeeker.isRectangleValid(buttonRectangle)) { + MouseActions.moveInsideRectangle(buttonRectangle, this.robot); + }else{ + throw new ComponentNotFoundException("Colored rectangle not found!"); + } + } + + public void dragFromColoredRectangle(Color c) throws ComponentNotFoundException, AWTFrameworkException { + Rectangle buttonRectangle = findColoredRectangle(c); + + if (ImageSeeker.isRectangleValid(buttonRectangle)) { + MouseActions.dragFromRectangle(buttonRectangle, this.robot); + }else{ + throw new ComponentNotFoundException("Colored rectangle not found!"); + } + } + + public Rectangle findColoredRectangle(Color c) throws AWTFrameworkException { + if(!appletColorGiven || !appletFound){ + throw new AWTFrameworkException("AWTHelper could not search for colored rectangle, needs appletColor and applet position."); + } + + Rectangle result; + + int gap = 5; + result = ImageSeeker.findColoredAreaGap(this.screenshot, c, appletColor, this.actionArea.y, this.actionArea.y + this.actionArea.height, gap); + + return result; + } + + /** + * method writeText writes string containing small letters and numbers and + * spaces like the keyboard input (using KeyboardActions so delays are + * inserted) + * + * @param text + */ + public void writeText(String text) { + KeyboardActions.writeText(this.robot, text); + } + + /** + * method typeKey writes one key on the keyboard (again using + * KeyboardActions) + * + * @param key + */ + public void typeKey(int key) { + KeyboardActions.typeKey(this.robot, key); + } + } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java 2013-05-03 19:08:24.917511738 +0000 @@ -0,0 +1,134 @@ +/* ComponentFinder.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + + +package net.sourceforge.jnlp.awt.imagesearch; + +import java.awt.Color; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.image.BufferedImage; +import java.io.IOException; +import javax.imageio.ImageIO; + +public class ComponentFinder { + public static final BufferedImage defaultIcon; + + static{ + try { + defaultIcon = ImageIO.read(ComponentFinder.class.getClassLoader().getResource("net/sourceforge/jnlp/awt/imagesearch/marker.png")); + } catch (IOException e) { + throw new RuntimeException("ComponentFinder - problem initializing defaultIcon",e); + } + } + + /** + * method findColoredRectangle determines coordinates of a rectangle colored + * by rectangleColor surrounded by a neighbourhood of surroundingColor + * + * @param rectangleColor + * @param surroundingColor + * @param screenshot + * @return + */ + public static Rectangle findColoredRectangle(Color rectangleColor, Color surroundingColor, BufferedImage screenshot) { + + Rectangle r = ImageSeeker.findColoredAreaGap(screenshot, rectangleColor, surroundingColor, 0, screenshot.getHeight(), 0); + if( ImageSeeker.isRectangleValid(r)){ + return r; + }else{ + return null; + } + } + + /** + * method findColoredRectangle determines coordinates of a rectangle colored + * by rectangleColor surrounded by a neighbourhood of surroundingColor with + * possible gap of several pixels + * + * @param rectangleColor + * @param surroundingColor + * @param screenshot + * @param gap + * @return + */ + public static Rectangle findColoredRectangle(Color rectangleColor, Color surroundingColor, BufferedImage screenshot, int gap) { + + Rectangle r = ImageSeeker.findColoredAreaGap(screenshot, rectangleColor, surroundingColor, 0, screenshot.getHeight(), gap); + if( ImageSeeker.isRectangleValid(r)){ + return r; + }else{ + return null; + } + } + + + /** + * Method findWindowByIcon finds the application area assuming there is a + * given icon in given position on the application window + * the dimension of the window has to be given. + * + * @param icon + * @param iconPosition + * @param appletWidth + * @param appletHeight + * @param screenshot + * @return Rectangle rectangle where the applet resides + */ + public static Rectangle findWindowByIcon(BufferedImage icon, Point iconPosition, int windowWidth, int windowHeight, BufferedImage screenshot) { + Rectangle r = ImageSeeker.findExactImage(icon, screenshot); + if( ImageSeeker.isRectangleValid(r)){ + return windowPositionFromIconPosition(r.getLocation(), iconPosition, windowWidth, windowHeight); + }else{ + return null; + } + } + + public static Rectangle findWindowByIconBlurred(BufferedImage icon, Point iconPosition, int windowWidth, int windowHeight, BufferedImage screenshot, double minCorrelation) { + Rectangle r = ImageSeeker.findBlurredImage(icon, screenshot, minCorrelation); + if( ImageSeeker.isRectangleValid(r)){ + return windowPositionFromIconPosition(r.getLocation(), iconPosition, windowWidth, windowHeight); + }else{ + return null; + } + } + + public static Rectangle windowPositionFromIconPosition(Point iconAbsolute, Point iconRelative, int windowWidth, int windowHeight){ + return new Rectangle( iconAbsolute.x - iconRelative.x, iconAbsolute.y - iconRelative.y, + windowWidth, windowHeight); + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundException.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundException.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundException.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundException.java 2013-05-03 19:08:24.918511725 +0000 @@ -0,0 +1,65 @@ +/* ComponentNotFoundException.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.awt.imagesearch; + +/** + * Class ComponentNotFoundException is thrown in the AWTFramework + * in such cases when a position of a component is needed for further + * action and the component is not found in the screenshot (for example + * a method should click on a button of given colour and the button + * is not found, then the method cannot perform its action and + * throws ComponentNotFoundException). + * + */ +public class ComponentNotFoundException extends Exception { + + public ComponentNotFoundException() { + super(); + } + + public ComponentNotFoundException(String s) { + super(s); + } + + public ComponentNotFoundException(String s, Throwable throwable) { + super(s, throwable); + } + + public ComponentNotFoundException(Throwable throwable) { + super(throwable); + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java 2013-05-03 19:08:24.918511725 +0000 @@ -0,0 +1,387 @@ +/* ImageSeeker.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + + +package net.sourceforge.jnlp.awt.imagesearch; + +import java.awt.Color; +import java.awt.Rectangle; +import java.awt.image.BufferedImage; + + + +public class ImageSeeker +{ + public static Rectangle findExactImage(BufferedImage marker, BufferedImage screen){ + return findExactImage(marker, screen, new Rectangle(0,0,screen.getWidth(), screen.getHeight())); + } + + public static Rectangle findExactImage(BufferedImage marker /*usually small*/, BufferedImage screen, Rectangle actionArea) { + Rectangle result = new Rectangle(0, 0, 0, 0); + boolean found = false; + boolean ok = true; + //to filter out values with alpha + boolean[][] mask = getMask(marker); + //accessing those too often, copying + int[][] markerPixels = getPixels(marker); + int mw = marker.getWidth(); + int mh = marker.getHeight(); + for (int y = actionArea.y; (y < (actionArea.y + actionArea.height - marker.getHeight())) && !found; y++) { + for (int x = actionArea.x; (x < (actionArea.x + actionArea.width - marker.getWidth())) && !found; x++) { + + + for (int my = 0; (my < mh) && ok; my++) { + for (int mx = 0; (mx < mw) && ok; mx++) { + + //ignore masked (having alpha) values + if (!mask[mx][my]) { + continue; + } + if (markerPixels[mx][my] != screen.getRGB(x + mx, y + my)) { + ok = false; + } + } + } + if( ok ){ + found = true; + result.x = x; + result.y = y; + result.height = marker.getHeight(); + result.width = marker.getWidth(); + }else{ + ok = true; + } + } + } + + if(found){ + return result; + }else{ + return null; + } + } + + public static Rectangle findBlurredImage(BufferedImage marker, BufferedImage testImage, double minCorrelation){ + return findBlurredImage(marker, testImage, minCorrelation, new Rectangle(0,0,testImage.getWidth(), testImage.getHeight())); + } + + public static Rectangle findBlurredImage(BufferedImage marker, BufferedImage testImage, double minCorrelation, Rectangle actionArea) + { + int maxX = actionArea.width - marker.getWidth() - 1; + int maxY = actionArea.height - marker.getHeight() - 1; + int markerMaxX = marker.getWidth(); + int markerMaxY = marker.getHeight(); + + // it is much faster to work directly with color components stored as float values + float[][][] testImageArray = createArrayForOneColorComponent(actionArea); + float[][][] markerImageArray = createArrayForOneColorComponent(marker); + + convertImageToFloatArray(testImage, testImageArray, actionArea); + convertImageToFloatArray(marker, markerImageArray); + + int bestX = -1; + int bestY = -1; + double bestCorrelation = -1; + + for (int yoffset = 0; yoffset < maxY; yoffset++ ) + { + for (int xoffset = 0; xoffset < maxX; xoffset++) + { + double correlation = computeCorrelation(markerMaxX, markerMaxY, testImageArray, markerImageArray, yoffset, xoffset); + if (correlation > bestCorrelation) + { + bestCorrelation = correlation; + bestX = xoffset + actionArea.x; + bestY = yoffset + actionArea.y; + } + } + } + if(bestCorrelation > minCorrelation){ + return new Rectangle(bestX, bestY, marker.getWidth(), marker.getHeight()); + }else{ + return null; + } + + } + + /** + * Create three-dimensional array with the same size as tested image + * dimensions (last dimension is used for storing RGB components). + * + * @param testImage tested image + * @return newly created three-dimensional array + */ + private static float[][][] createArrayForOneColorComponent(BufferedImage testImage) + { + return new float[testImage.getHeight()][testImage.getWidth()][3]; + } + + /** + * Create three-dimensional array with the same size as the given area + * dimensions (last dimension is used for storing RGB components). + * + * @param actionArea + * @return newly created three-dimensional array + */ + private static float[][][] createArrayForOneColorComponent(Rectangle actionArea) + { + return new float[actionArea.height][actionArea.width][3]; + } + + /** + * Conversion from BufferedImage into three dimensional float arrays. + * It's much faster to work with float arrays even if it's memory ineficient. + * + * @param testImage tested image + * @param array array to fill + */ + private static void convertImageToFloatArray(BufferedImage testImage, float[][][] array) + { + for (int y = 0; y < testImage.getHeight(); y++) + { + for (int x = 0; x < testImage.getWidth(); x++) + { + int c = testImage.getRGB(x, y); + // filter out alpha channel + c = c & 0xffffff; + array[y][x][0] = ((c >> 16) & 0xff) - 128f; + array[y][x][1] = ((c >> 8) & 0xff) - 128f; + array[y][x][2] = (c & 0xff) - 128f; + } + } + } + + /** + * Conversion from BufferedImage into three dimensional float arrays. + * It's much faster to work with float arrays even if it's memory ineficient. + * This method converts only a given part of the image (actionArea) + * + * @param testImage tested image + * @param array array to fill + * @param actionArea rectangle part of the image to convert + */ + private static void convertImageToFloatArray(BufferedImage testImage, float[][][] array, Rectangle actionArea) + { + for (int y = actionArea.y; y < (actionArea.height + actionArea.y); y++) + { + for (int x = actionArea.x; x < (actionArea.width + actionArea.x); x++) + { + int c = testImage.getRGB(x, y); + // filter out alpha channel + c = c & 0xffffff; + array[y - actionArea.y][x - actionArea.x][0] = ((c >> 16) & 0xff) - 128f; + array[y - actionArea.y][x - actionArea.x][1] = ((c >> 8) & 0xff) - 128f; + array[y - actionArea.y][x - actionArea.x][2] = (c & 0xff) - 128f; + } + } + } + + /** + * Compute correlation for given two images and 2D offset. + * + * @param maxX + * @param maxY + * @param testImageArray + * @param markerImageArray + * @param yoffset + * @param xoffset + * @return + */ + private static double computeCorrelation(int maxX, int maxY, float[][][] testImageArray, + float[][][] markerImageArray, int yoffset, int xoffset) + { + double correlation = 0; + for (int y = 0; y < maxY; y++) + { + for (int x = 0; x < maxX; x++) + { + for (int rgbIndex = 0; rgbIndex < 3; rgbIndex++) + { + float colorComponent1 = markerImageArray[y][x][rgbIndex]; + float colorComponent2 = testImageArray[yoffset + y][xoffset + x][rgbIndex]; + correlation += colorComponent1 * colorComponent2; + } + } + } + return correlation; + } + + public static int findHorizontalRule(BufferedImage screen, + Color ruleColor, Color bgColor, boolean fromTop) { + final int height = screen.getHeight(); + int gap = 0; + + if (!fromTop) { + return findHorizontalEdgeGap(screen, ruleColor, + bgColor, 1, height - 1, gap); + } else { + return findHorizontalEdgeGap(screen, bgColor, + ruleColor, 1, height - 1, gap); + } + } + + public static int findHorizontalEdgeGap(BufferedImage screen, + Color area1Color, Color area2Color, int y1, int y2, int gap) { + final int width = screen.getWidth(); + final int area1RGB = area1Color.getRGB(); + final int area2RGB = area2Color.getRGB(); + int edgePosition = Integer.MIN_VALUE; + int lastFound = Integer.MIN_VALUE; + + for (int y = y1+1; y < y2 - gap; y++) { + int found = 0; + for (int x = 0; x < width; x++) { + int c1 = screen.getRGB(x, y - 1); + int c2 = screen.getRGB(x, y + gap); + if (c1 == area1RGB && c2 == area2RGB) { + found++; + } + } + if (found > lastFound) { + lastFound = found; + edgePosition = y; + } + + } + + return edgePosition; + } + + public static int findVerticalEdgeGap(BufferedImage screen, + Color area1Color, Color area2Color, int y1, int y2, int gap) { + final int width = screen.getWidth(); + final int area1RGB = area1Color.getRGB(); + final int area2RGB = area2Color.getRGB(); + int edgePosition = Integer.MIN_VALUE; + int lastFound = Integer.MIN_VALUE; + + for (int x = 1; x < width - 1 - gap; x++) { + int found = 0; + for (int y = y1; y < y2; y++) { + int c1 = screen.getRGB(x - 1, y); + int c2 = screen.getRGB(x + gap, y); + if (c1 == area1RGB && c2 == area2RGB) { + found++; + } + } + if (found > lastFound) { + lastFound = found; + edgePosition = x; + } + } + + return edgePosition; + } + + /** + * method findColoredAreaGap finds a rectangle of given color surrounded by + * area of the second color with a possible gap at the border + * + * @param screen + * @param searchForColor + * @param surroundWithColor + * @param y1 + * @param y2 + * @param gap + * @return + */ + public static Rectangle findColoredAreaGap(BufferedImage screen, Color searchForColor, Color surroundWithColor, int y1, int y2, int gap) { + + int ymin = findHorizontalEdgeGap(screen, surroundWithColor, searchForColor, y1, y2, gap); + int ymax = findHorizontalEdgeGap(screen, searchForColor, surroundWithColor, y1, y2, gap); + int xmin = findVerticalEdgeGap(screen, surroundWithColor, searchForColor, ymin, ymax, gap); + int xmax = findVerticalEdgeGap(screen, searchForColor, surroundWithColor, ymin, ymax, gap); + + return new Rectangle(xmin, ymin, xmax - xmin, ymax - ymin); + } + + public static boolean isRectangleValid(Rectangle r){ + + if (r == null) return false; + + return (r.width != 0)&&(r.height != 0)&&(r.x != Integer.MIN_VALUE)&&(r.y != Integer.MIN_VALUE); + } + + public static BufferedImage getMaskImage(BufferedImage icon) { + int w = icon.getWidth(); + int h = icon.getHeight(); + boolean[][] b = getMask(icon); + BufferedImage mask = new BufferedImage(w, h, BufferedImage.TYPE_BYTE_BINARY); + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + if (b[x][y]) { + mask.setRGB(x, y, Color.white.getRGB()); + } else { + mask.setRGB(x, y, Color.black.getRGB()); + } + } + } + return mask; + } + + public static boolean[][] getMask(BufferedImage icon) { + int w = icon.getWidth(); + int h = icon.getHeight(); + boolean[][] r = new boolean[w][h]; + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + int i = icon.getRGB(x, y); + int alpha = (i >> 24) & 0xff; + if (alpha == 255) { + r[x][y] = true; + } else { + r[x][y] = false; + } + } + } + return r; + } + + public static int[][] getPixels(BufferedImage icon) { + int w = icon.getWidth(); + int h = icon.getHeight(); + int[][] r = new int[w][h]; + for (int x = 0; x < w; x++) { + for (int y = 0; y < h; y++) { + int i = icon.getRGB(x, y); + //remove mask? not yet... + r[x][y] = i; + } + } + return r; + } +} Binary files /tmp/NuT9CcZAiZ/icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/marker.png and /tmp/WZlglBfzlP/icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/marker.png differ diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browser.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browser.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browser.java 2013-04-10 11:40:24.045668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browser.java 2013-05-03 19:08:24.919511712 +0000 @@ -42,7 +42,7 @@ /** * interface which represents individual browsers */ -public interface Browser { +public interface Browser extends ReactingProcess{ public String getDefaultBin(); public String getDefaultPluginExpectedLocation(); public String getBin(); @@ -52,5 +52,4 @@ public List getComaptibilitySwitches(); public List getDefaultSwitches(); - } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java 2013-04-10 11:40:24.046668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java 2013-05-03 19:08:24.922511673 +0000 @@ -34,22 +34,28 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package net.sourceforge.jnlp.browsertesting.browsers; +import java.util.Arrays; +import java.util.List; import net.sourceforge.jnlp.browsertesting.Browsers; public class Epiphany extends MozillaFamilyLinuxBrowser { + + String[] cs = {}; + public Epiphany(String bin) { super(bin); } @Override + public List getComaptibilitySwitches() { + return Arrays.asList(cs); + } + + @Override public Browsers getID() { return Browsers.epiphany; } - - - } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/FirefoxProfilesOperator.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/FirefoxProfilesOperator.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/FirefoxProfilesOperator.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/FirefoxProfilesOperator.java 2013-05-03 19:08:24.924511649 +0000 @@ -0,0 +1,175 @@ +/* FirefoxProfilesOperator.java +Copyright (C) 2011,2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.browsertesting.browsers.firefox; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.nio.channels.FileChannel; +import net.sourceforge.jnlp.ServerAccess; + +/** + * This class is able to backup and restore firefox profiles. + * + */ +public class FirefoxProfilesOperator { + + private File backupDir; + private File sourceDir; + private boolean backuped = false; + private FilenameFilter firefoxProfilesFilter = new FilenameFilter() { + + @Override + public boolean accept(File dir, String name) { + return name.endsWith(".default") || name.equals("profiles.ini"); + } + }; + + + public void backupProfiles() throws IOException { + if (backuped) { + return; + } + sourceDir = new File(System.getProperty("user.home") + "/.mozilla/firefox/"); + File f = File.createTempFile("backupedFirefox_", "_profiles.default"); + f.delete(); + f.mkdir(); + backupDir = f; + String message = "Backuping firefox profiles from " + sourceDir.getAbsolutePath() + " to " + backupDir.getAbsolutePath(); + ServerAccess.logOutputReprint(message); + copyDirs(sourceDir, backupDir, firefoxProfilesFilter); + backuped = true; + Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { + @Override + public void run() { + try { + restoreProfiles(); + } catch (Exception ex) { + ServerAccess.logException(ex); + } + } + })); + + } + + public void restoreProfiles() throws IOException { + if (!backuped) { + return; + } + try { + removeProfiles(); + } catch (Exception ex) { + ServerAccess.logException(ex); + } + String message = ("Restoring all firefox profiles in " + sourceDir.getAbsolutePath() + " from in " + backupDir.getAbsolutePath()); + ServerAccess.logOutputReprint(message); + copyDirs(backupDir, sourceDir, firefoxProfilesFilter); + + } + + public void removeProfiles() throws IOException { + if (!backuped) { + return; + } + String message = ("Removing all firefox profiles from " + sourceDir.getAbsolutePath() + " backup avaiable in " + backupDir.getAbsolutePath()); + ServerAccess.logOutputReprint(message); + File[] oldProfiles = sourceDir.listFiles(firefoxProfilesFilter); + for (File file : oldProfiles) { + deleteRecursively(file); + + } + + } + + private void copyDirs(File sourceDir, File backupDir, FilenameFilter firefoxProfilesFilter) throws IOException { + File[] profiles = sourceDir.listFiles(firefoxProfilesFilter); + for (File file : profiles) { + copyRecursively(file, backupDir); + } + } + + public static void copyFile(File from, File to) throws IOException { + FileInputStream is = new FileInputStream(from); + FileOutputStream fos = new FileOutputStream(to); + FileChannel f = is.getChannel(); + FileChannel f2 = fos.getChannel(); + try { + f.transferTo(0, f.size(), f2); + } finally { + f2.close(); + f.close(); + } + } + + public static void deleteRecursively(File f) throws IOException { + if (f.isDirectory()) { + for (File c : f.listFiles()) { + deleteRecursively(c); + } + } + boolean d = true; + d = f.delete(); + if (!d) { + throw new IOException("Failed to delete file: " + f); + } + } + + public static void copyRecursively(File srcFileDir, File destDir) throws IOException { + if (srcFileDir.isDirectory()) { + File nwDest = new File(destDir, srcFileDir.getName()); + nwDest.mkdir(); + for (File c : srcFileDir.listFiles()) { + copyRecursively(c, nwDest); + } + } else { + copyFile(srcFileDir, new File(destDir, srcFileDir.getName())); + } + + } + + public static void main(String[] args) throws IOException { + FirefoxProfilesOperator ff = new FirefoxProfilesOperator(); + ff.restoreProfiles(); + ff.backupProfiles(); + ff.restoreProfiles(); + ff.backupProfiles(); + + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java 2013-04-10 11:40:24.046668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java 2013-05-03 19:08:24.922511673 +0000 @@ -34,20 +34,23 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package net.sourceforge.jnlp.browsertesting.browsers; import java.util.Arrays; import java.util.List; +import net.sourceforge.jnlp.ProcessAssasin; +import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; public class Firefox extends MozillaFamilyLinuxBrowser { + private static final FirefoxProfilesOperator firefoxProfilesOperatorSingleton = new FirefoxProfilesOperator(); + public Firefox(String bin) { super(bin); } - - String[] cs={"-new-tab"}; + String[] cs = {"-new-tab"}; @Override public Browsers getID() { @@ -59,8 +62,35 @@ return Arrays.asList(cs); } + @Override + public void beforeProcess(String s) { + try { + firefoxProfilesOperatorSingleton.backupProfiles(); //assuming firefox is not in safemode already + } catch (Exception ex) { + throw new RuntimeException("Firefox profile backup failed", ex); + } + } + + @Override + public void afterProcess(String s) { + } + @Override + public void beforeKill(String s) { + try { + ProcessAssasin.closeWindows(s); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + @Override + public void afterKill(String s) { + try { + firefoxProfilesOperatorSingleton.restoreProfiles(); + } catch (Exception ex) { + throw new RuntimeException("Firefox profile restoration failed", ex); + } - + } } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.java 2013-04-10 11:40:24.047668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.java 2013-05-03 19:08:24.923511661 +0000 @@ -92,6 +92,25 @@ } } + @Override + public void beforeProcess(String s) { + + } + + @Override + public void afterProcess(String s) { + + } + + @Override + public void beforeKill(String s) { + + } + + @Override + public void afterKill(String s) { + + } } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Midory.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Midory.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Midory.java 2013-04-10 11:40:24.047668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Midory.java 2013-05-03 19:08:24.923511661 +0000 @@ -50,6 +50,6 @@ return Browsers.midori; } - + } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/ReactingProcess.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/ReactingProcess.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/ReactingProcess.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/browsertesting/ReactingProcess.java 2013-05-03 19:08:24.921511686 +0000 @@ -0,0 +1,63 @@ +/* ReactingProcess.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp.browsertesting; + + +/** + * interface which represents process which can react to events during its lifetime. + */ +public interface ReactingProcess { + /** + * called before process is launched + */ + public void beforeProcess(String s); + /** + * called after process is finished or killed + */ + public void afterProcess(String s); + /** + * called after before process is timeouted and is going to be killed + */ + public void beforeKill(String s); + /** + * called after process have been killed + */ + public void afterKill(String s); + + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java 2013-05-03 19:08:24.907511862 +0000 @@ -0,0 +1,55 @@ +/* ClosingListener.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp; + +public abstract class ClosingListener implements ContentReaderListener { + + private ThreadedProcess process; + private ProcessAssasin assasin; + + void setProcess(ThreadedProcess p) { + this.process = p; + } + + void setAssasin(ProcessAssasin assasin) { + this.assasin = assasin; + } + + public void terminate() { + assasin.setTimeout(Long.MIN_VALUE); + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java 2013-05-03 19:08:24.925511637 +0000 @@ -0,0 +1,57 @@ +/* CountingClosingListener.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.closinglisteners; + +import net.sourceforge.jnlp.ClosingListener; + +public class AutoAllClosingListener extends ClosingListener { + + + + @Override + public void charReaded(char ch) { + + } + + @Override + public void lineReaded(String s) { + if (s.contains(AutoErrorClosingListener.MAGICAL_ERROR_CLOSING_STRING) || s.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING)){ + terminate(); + } + } + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java 2013-05-03 19:08:24.925511637 +0000 @@ -0,0 +1,46 @@ +/* AutoErrorClosingListener.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.closinglisteners; + +public class AutoErrorClosingListener extends StringBasedClosingListener { + + public static final String MAGICAL_ERROR_CLOSING_STRING = "xception"; + + public AutoErrorClosingListener() { + super(MAGICAL_ERROR_CLOSING_STRING); + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java 2013-05-03 19:08:24.926511625 +0000 @@ -0,0 +1,48 @@ +/* CountingClosingListener.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.closinglisteners; + + +public class AutoOkClosingListener extends StringBasedClosingListener { + + public static final String MAGICAL_OK_CLOSING_STRING = "*** APPLET FINISHED ***"; + + public AutoOkClosingListener() { + super(MAGICAL_OK_CLOSING_STRING); + } + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListener.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListener.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListener.java 2013-05-03 19:08:24.926511625 +0000 @@ -0,0 +1,60 @@ +/* CountingClosingListener.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.closinglisteners; + +import net.sourceforge.jnlp.ClosingListener; + +public abstract class CountingClosingListener extends ClosingListener { + + protected StringBuilder sb = new StringBuilder(); + + @Override + public void charReaded(char ch) { + sb.append(ch); + if (isAlowedToFinish(sb.toString())) { + terminate(); + } + + } + + @Override + public void lineReaded(String s) { + //nothing to do + } + + protected abstract boolean isAlowedToFinish(String content); +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/Rule.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/Rule.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/Rule.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/Rule.java 2013-05-03 19:08:24.926511625 +0000 @@ -0,0 +1,46 @@ +/* Rule.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ +package net.sourceforge.jnlp.closinglisteners; + +public interface Rule { + + public void setRule(S rule); + public boolean evaluate(T upon); + public String toPassingString(); + public String toFailingString(); + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java 2013-05-03 19:08:24.927511613 +0000 @@ -0,0 +1,239 @@ +/* RulesFolowingClosingListener.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.closinglisteners; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class RulesFolowingClosingListener extends CountingClosingListener { + + private List rules = new ArrayList(); + + public static class ContainsRule extends StringRule { + + public ContainsRule(String s) { + super(s); + } + + @Override + public boolean evaluate(String upon) { + return (upon.contains(rule)); + } + + @Override + public String toPassingString() { + return "should contain `" + rule + "`"; + } + + @Override + public String toFailingString() { + return "should NOT contain `" + rule + "`"; + } + } + + public static class NotContainsRule extends StringRule { + + public NotContainsRule(String s) { + super(s); + } + + @Override + public boolean evaluate(String upon) { + return !(upon.contains(rule)); + } + + @Override + public String toPassingString() { + return "should NOT contain `" + rule + "`"; + } + + @Override + public String toFailingString() { + return "should contain `" + rule + "`"; + } + } + + public static class MatchesRule extends StringRule { + + public MatchesRule(String s) { + super(s); + } + + @Override + public boolean evaluate(String upon) { + return (upon.matches(rule)); + } + + @Override + public String toPassingString() { + return "should match `" + rule + "`"; + } + + @Override + public String toFailingString() { + return "should NOT match `" + rule + "`"; + } + } + + public static class NotMatchesRule extends StringRule { + + public NotMatchesRule(String s) { + super(s); + } + + @Override + public boolean evaluate(String upon) { + return !(upon.matches(rule)); + } + + @Override + public String toPassingString() { + return "should NOT match`" + rule + "`"; + } + + @Override + public String toFailingString() { + return "should match`" + rule + "`"; + } + } + + + /** + * + * @param rule + * @return self, to alow chaing add(...).add(..)... + */ + public RulesFolowingClosingListener addMatchingRule(String rule) { + this.rules.add(new MatchesRule(rule)); + return this; + } + + /** + * + * @param rule + * @return self, to alow chaing add(...).add(..)... + */ + public RulesFolowingClosingListener addNotMatchingRule(String rule) { + this.rules.add(new NotMatchesRule(rule)); + return this; + } + + /** + * + * @param rule + * @return self, to alow chaing add(...).add(..)... + */ + public RulesFolowingClosingListener addContainsRule(String rule) { + this.rules.add(new ContainsRule(rule)); + return this; + } + + /** + * + * @param rule + * @return self, to alow chaing add(...).add(..)... + */ + public RulesFolowingClosingListener addNotContainsRule(String rule) { + this.rules.add(new NotContainsRule(rule)); + return this; + } + + public RulesFolowingClosingListener() { + } + + public RulesFolowingClosingListener(List l) { + addRules(l); + } + + public RulesFolowingClosingListener(Rule... l) { + addRules(l); + } + + public List getRules() { + return rules; + } + + public void setRules(List rules) { + if (rules == null) { + throw new NullPointerException("rules cant be null"); + } + this.rules = rules; + } + + /** + * no more rules will be possible to add by doing this + * @param rules + */ + public void setRules(Rule[] rules) { + if (rules == null) { + throw new NullPointerException("rules cant be null"); + } + this.rules = Arrays.asList(rules); + } + + public RulesFolowingClosingListener addRules(List rules) { + if (rules == null) { + throw new NullPointerException("rules cant be null"); + } + this.rules.addAll(rules); + return this; + } + + public RulesFolowingClosingListener addRules(Rule... rules) { + if (rules == null) { + throw new NullPointerException("rules cant be null"); + } + this.rules.addAll(Arrays.asList(rules)); + return this; + } + + @Override + protected boolean isAlowedToFinish(String content) { + if (rules == null || rules.size() < 1) { + throw new IllegalStateException("No rules specified"); + } + for (Rule rule : rules) { + if (!rule.evaluate(content)) { + return false; + } + } + return true; + + + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java 2013-05-03 19:08:24.927511613 +0000 @@ -0,0 +1,67 @@ +/* StringBasedClosingListener.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.closinglisteners; + +import net.sourceforge.jnlp.ClosingListener; + +public class StringBasedClosingListener extends ClosingListener { + + private final String condition; + + public StringBasedClosingListener(String condition) { + this.condition = condition; + } + + @Override + public void charReaded(char ch) { + + } + + @Override + public void lineReaded(String s) { + if (s.contains(condition)){ + terminate(); + } + } + + + public String getCondition() { + return condition; + } + + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java 2013-05-03 19:08:24.927511613 +0000 @@ -0,0 +1,53 @@ +/* StringMatchClosingListener.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.closinglisteners; + +import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; + +public class StringMatchClosingListener extends StringBasedClosingListener { + + public StringMatchClosingListener(String s) { + super(s); + } + + @Override + public void lineReaded(String s) { + if (s.matches(getCondition())) { + terminate(); + } + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringRule.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringRule.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringRule.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringRule.java 2013-05-03 19:08:24.928511601 +0000 @@ -0,0 +1,57 @@ +/* StringRule.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ +package net.sourceforge.jnlp.closinglisteners; + +public abstract class StringRule implements Rule{ + protected String rule; + + public StringRule(String rule) { + setRule(rule); + } + + public StringRule() { + } + + + @Override + public void setRule(String rule){ + this.rule=rule; + } + @Override + public abstract boolean evaluate(T upon); + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java 2013-04-10 11:40:24.041668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java 2013-05-03 19:08:24.908511849 +0000 @@ -34,23 +34,25 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package net.sourceforge.jnlp; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; +import java.util.ArrayList; +import java.util.List; /** - * Class to read content of stdout/stderr of process, and to cooperate with its running/terminated/finished statuses. + * Class to read content of stdout/stderr of process, and to cooperate with its + * running/terminated/finished statuses. */ class ContentReader implements Runnable { StringBuilder sb = new StringBuilder(); private final InputStream is; private boolean done; - ContentReaderListener listener; + final List listeners = new ArrayList(1); public String getContent() { return sb.toString(); @@ -62,15 +64,24 @@ public ContentReader(InputStream is, ContentReaderListener l) throws IOException { this.is = is; - this.listener = l; + if (l != null) { + this.listeners.add(l); + } + } + + public ContentReader(InputStream is, List l) throws IOException { + this.is = is; + if (l != null) { + this.listeners.addAll(l); + } } - public void setListener(ContentReaderListener listener) { - this.listener = listener; + public void addListener(ContentReaderListener listener) { + this.listeners.add(listener); } - public ContentReaderListener getListener() { - return listener; + public List getListener() { + return listeners; } /** @@ -96,8 +107,12 @@ while (true) { int s = br.read(); if (s < 0) { - if (line.length() > 0 && listener != null) { - listener.lineReaded(line.toString()); + if (line.length() > 0 && listeners != null) { + for (ContentReaderListener listener : listeners) { + if (listener != null) { + listener.lineReaded(line.toString()); + } + } } break; } @@ -105,21 +120,31 @@ sb.append(ch); line.append(ch); if (ch == '\n') { - if (listener != null) { - listener.lineReaded(line.toString()); + if (listeners != null) { + for (ContentReaderListener listener : listeners) { + if (listener != null) { + listener.lineReaded(line.toString()); + } + } } line = new StringBuilder(); } - if (listener != null) { - listener.charReaded(ch); + if (listeners != null) { + for (ContentReaderListener listener : listeners) { + if (listener != null) { + listener.charReaded(ch); + } + } } } - //do not want to bother output with terminations - //mostly compaling when assassin kill the process about StreamClosed - //do not want to bother output with terminations - //mostly compaling when assassin kill the process about StreamClosed - } catch (Exception ex) { + } catch (NullPointerException ex) { + ex.printStackTrace(); + } + //do not want to bother output with terminations + //mostly compaling when assassin kill the process about StreamClosed + catch (Exception ex) { // logException(ex); + //ex.printStackTrace(); } finally { try { is.close(); diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java 2013-04-10 11:40:24.042668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java 2013-05-03 19:08:24.909511837 +0000 @@ -45,6 +45,7 @@ import java.io.OutputStreamWriter; import java.io.Writer; import java.lang.reflect.Method; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; @@ -80,10 +81,10 @@ * map of classes, each have map of methods, each have errorlist, outLIst, and allList (allist contains also not std or err messages) * class.testMethod.logs */ - final Map> processLogs = new HashMap>(100); + final Map> processLogs = Collections.synchronizedMap(new HashMap>(1000)); private boolean added = false; - public static LoggingBottleneck getDefaultLoggingBottleneck() { + synchronized public static LoggingBottleneck getDefaultLoggingBottleneck() { if (loggingBottleneck == null) { loggingBottleneck = new LoggingBottleneck(); } @@ -101,11 +102,15 @@ } } - void writeXmlLog() throws FileNotFoundException, IOException { + synchronized void writeXmlLog() throws FileNotFoundException, IOException { writeXmlLog(DEFAULT_LOG_FILE); } - void writeXmlLog(File f) throws FileNotFoundException, IOException { + synchronized void writeXmlLog(File f) throws FileNotFoundException, IOException { + writeXmlLog(f, Collections.unmodifiableMap(processLogs)); + } + + synchronized static void writeXmlLog(File f, Map> processLogs) throws FileNotFoundException, IOException { Writer w = new OutputStreamWriter(new FileOutputStream(f)); Set>> classes = processLogs.entrySet(); w.write("<" + LOGS_ELEMENT + ">"); @@ -117,7 +122,7 @@ String testName = testLog.getKey(); String testLogs = testLog.getValue().toString(); w.write("<" + TESTLOG_ELEMENT + " " + TESTMETHOD_ATTRIBUTE + "=\"" + testName + "\" " + FULLID_ATTRIBUTE + "=\"" + className + "." + testName + "\" >"); - w.write(testLogs); + w.write(clearChars(testLogs)); w.write(""); } w.write(""); @@ -127,7 +132,7 @@ w.close(); } - void addToXmlLog(String message, boolean printToOut, boolean printToErr, StackTraceElement ste) { + synchronized void addToXmlLog(String message, boolean printToOut, boolean printToErr, StackTraceElement ste) { Map classLog = processLogs.get(ste.getClassName()); if (classLog == null) { classLog = new HashMap(50); @@ -157,7 +162,7 @@ methodLog.add(printToErr, printToOut, message); } - public String modifyMethodWithForBrowser(String methodBrowseredName, String className) { + synchronized public String modifyMethodWithForBrowser(String methodBrowseredName, String className) { try { Class clazz = Class.forName(className); /* @@ -180,11 +185,11 @@ return methodBrowseredName; } - public void setLoggedBrowser(String loggedBrowser) { + synchronized public void setLoggedBrowser(String loggedBrowser) { this.loggedBrowser = loggedBrowser; } - public void logIntoPlaintextLog(String message, boolean printToOut, boolean printToErr) { + synchronized public void logIntoPlaintextLog(String message, boolean printToOut, boolean printToErr) { try { if (printToOut) { LoggingBottleneck.getDefaultLoggingBottleneck().stdout(message); @@ -215,4 +220,24 @@ DEFAULT_STDLOGS_WRITER.newLine(); DEFAULT_STDLOGS_WRITER.flush(); } + + synchronized public static String clearChars(String ss) { + StringBuilder s = new StringBuilder(ss); + for (int i = 0; i < s.length(); i++) { + char q = s.charAt(i); + if (q == '\n') { + continue; + } + if (q == '\t') { + continue; + } + int iq = (int) q; + if ((iq <= 31 || iq > 65533)||(iq >= 64976 && iq <= 65007)) { + s.setCharAt(i, 'I'); + s.insert(i + 1, "NVALID_CHAR_" + iq); + i--; + } + } + return s.toString(); + } } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFile.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFile.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFile.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFile.java 2013-05-03 19:08:24.928511601 +0000 @@ -0,0 +1,77 @@ +/* +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.mock; + +import java.net.URL; +import java.util.Locale; +import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.ResourcesDesc; +import net.sourceforge.jnlp.SecurityDesc; + + +public class DummyJNLPFile extends JNLPFile { + + + public static final URL JAR_URL; + public static final URL CODEBASE_URL; + + static { + try { + JAR_URL = new URL("http://icedtea.classpath.org/netx/about.jar"); + CODEBASE_URL = new URL("http://icedtea.classpath.org/netx/"); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + + @Override + public ResourcesDesc getResources() { + return new ResourcesDesc(null, new Locale[0], new String[0], new String[0]); + } + + @Override + public URL getCodeBase() { + return CODEBASE_URL; + } + + @Override + public SecurityDesc getSecurity() { + return new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, null); + } + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java 2013-04-10 11:40:24.042668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java 2013-05-03 19:08:24.910511825 +0000 @@ -39,24 +39,32 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; +import net.sourceforge.jnlp.browsertesting.ReactingProcess; /** - * class which timeout any ThreadedProcess. This killing of 'thread with process' replaced not working process.destroy(). + * class which timeout any ThreadedProcess. This killing of 'thread with + * process' replaced not working process.destroy(). */ -class ProcessAssasin extends Thread { +public class ProcessAssasin extends Thread { long timeout; private final ThreadedProcess p; //false == is disabled:( private boolean canRun = true; private boolean wasTerminated = false; + //signifies that assasin have been summoned + private volatile boolean killing = false; + //signifies that assasin have done its job + private volatile boolean killed = false; /** - * if this is true, then process is not destroyed after timeout, but just left to its own destiny. - * Its stdout/err is no longer recorded, and it is leaking system resources until it dies by itself - * The contorl is returned to main thread with all informations recorded untill now. - * You will be able to listen to std out from listeners still + * if this is true, then process is not destroyed after timeout, but just + * left to its own destiny. Its stdout/err is no longer recorded, and it is + * leaking system resources until it dies by itself The contorl is returned + * to main thread with all informations recorded untill now. You will be + * able to listen to std out from listeners still */ private boolean skipInstedOfDesroy = false; + private ReactingProcess reactingProcess; public ProcessAssasin(ThreadedProcess p, long timeout) { this.p = (p); @@ -98,6 +106,11 @@ return skipInstedOfDesroy; } + void setTimeout(long timeout) { + this.timeout = timeout; + } + + @Override public void run() { long startTime = System.nanoTime() / ServerAccess.NANO_TIME_DELIMITER; @@ -118,7 +131,7 @@ if (p.getP() != null) { try { if (!skipInstedOfDesroy) { - destroyProcess(p); + destroyProcess(); } } catch (Throwable ex) { if (p.deadlyException == null) { @@ -160,12 +173,34 @@ } } - public static void destroyProcess(ThreadedProcess pp) { + public void destroyProcess() { + try { + killing = true; + destroyProcess(p, reactingProcess); + } finally { + killed = true; + } + } + + public boolean haveKilled() { + return killed; + } + + public boolean isKilling() { + return killing; + } + + + + public static void destroyProcess(ThreadedProcess pp, ReactingProcess reactingProcess) { Process p = pp.getP(); try { Field f = p.getClass().getDeclaredField("pid"); f.setAccessible(true); String pid = (f.get(p)).toString(); + if (reactingProcess != null) { + reactingProcess.beforeKill(pid); + }; sigInt(pid); //sigTerm(pid); //sigKill(pid); @@ -173,6 +208,9 @@ ServerAccess.logException(ex); } finally { p.destroy(); + if (reactingProcess != null) { + reactingProcess.afterKill(""); + }; } } @@ -188,7 +226,7 @@ kill(pid, "SIGTERM"); } - public static void kill(String pid,String signal) throws InterruptedException, Exception { + public static void kill(String pid, String signal) throws InterruptedException, Exception { List ll = new ArrayList(4); ll.add("kill"); ll.add("-s"); @@ -198,4 +236,31 @@ //before affected application close Thread.sleep(1000); } + + void setReactingProcess(ReactingProcess reactingProcess) { + this.reactingProcess = reactingProcess; + } + + public static void closeWindow(String pid) throws Exception { + List ll = new ArrayList(2); + ll.add(ServerAccess.getInstance().getDir().getParent() + "/softkiller"); + ll.add(pid); + ServerAccess.executeProcess(ll); //sync, but acctually release + //before affected application "close" + Thread.sleep(100); + + } + + public static void closeWindows(String s) throws Exception { + closeWindows(s, 10); + } + + public static void closeWindows(String s, int count) throws Exception { + //each close closes just one tab... + for (int i = 0; i < count; i++) { + ProcessAssasin.closeWindow(s); + } + } + + } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java 2013-05-03 19:08:24.910511825 +0000 @@ -0,0 +1,271 @@ +/* ProcessWrapper.java +Copyright (C) 2011,2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ + +package net.sourceforge.jnlp; + +import java.io.File; +import java.io.OutputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import net.sourceforge.jnlp.browsertesting.ReactingProcess; +import org.junit.Assert; + + + +/** + * This class wraps execution of ThreadedProcess. + * Add listeners and allows another setters, eg of ReactingProcess + * + */ +public class ProcessWrapper { + + private List args; + private File dir; + private final List stdoutl = new ArrayList(1); + private final List stderrl = new ArrayList(1); + private String[] vars; + private ReactingProcess reactingProcess; + + public ProcessWrapper() { + } + + public ProcessWrapper(String toBeExecuted, List otherargs, URL u){ + Assert.assertNotNull(u); + Assert.assertNotNull(toBeExecuted); + Assert.assertTrue(toBeExecuted.trim().length() > 1); + if (otherargs == null) { + otherargs = new ArrayList(1); + } + List urledArgs = new ArrayList(otherargs); + urledArgs.add(0, toBeExecuted); + urledArgs.add(u.toString()); + this.args = urledArgs; + this.vars=null; + } + + public ProcessWrapper(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception { + this(toBeExecuted, otherargs, u); + this.addStdOutListener(stdoutl); + this.addStdErrListener(stderrl); + this.vars=vars; + + } + + public ProcessWrapper(String toBeExecuted, List otherargs, URL u, List stdoutl, List stderrl, String[] vars) throws Exception { + this(toBeExecuted, otherargs, u); + this.addStdOutListeners(stdoutl); + this.addStdErrListeners(stderrl); + this.vars=vars; + } + + ProcessWrapper(final List args, File dir, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) { + this.args = args; + this.dir = dir; + this.addStdOutListener(stdoutl); + this.addStdErrListener(stderrl); + this.vars = vars; + } + + public ProcessWrapper(final List args, File dir, List stdoutl, List stderrl, String[] vars) { + this.args = args; + this.dir = dir; + this.addStdOutListeners(stdoutl); + this.addStdErrListeners(stderrl); + this.vars = vars; + } + + public final void addStdOutListener(ContentReaderListener l) { + if (l == null) { + return; + } + stdoutl.add(l); + + } + + public final void addStdErrListener(ContentReaderListener l) { + if (l == null) { + return; + } + stderrl.add(l); + + } + + public final void addStdOutListeners(List l) { + if (l == null) { + return; + } + stdoutl.addAll(l); + + } + + public final void addStdErrListeners(List l) { + if (l == null) { + return; + } + stderrl.addAll(l); + + } + + /** + * @return the args + */ + public List getArgs() { + return args; + } + + /** + * @param args the args to set + */ + public void setArgs(List args) { + this.args = args; + } + + /** + * @return the dir + */ + public File getDir() { + return dir; + } + + /** + * @param dir the dir to set + */ + public void setDir(File dir) { + this.dir = dir; + } + + /** + * @return the stdoutl + */ + public List getStdoutListeners() { + return stdoutl; + } + + /** + * @return the stderrl + */ + public List getStderrListeners() { + return stderrl; + } + + /** + * @return the vars + */ + public String[] getVars() { + return vars; + } + + /** + * @param vars the vars to set + */ + public void setVars(String[] vars) { + this.vars = vars; + } + + public ServerAccess.ProcessResult execute() throws Exception { + if (reactingProcess !=null ){ + reactingProcess.beforeProcess(""); + }; + ThreadedProcess t = new ThreadedProcess(args, dir, vars); + if (ServerAccess.PROCESS_LOG) { + String connectionMesaage = createConnectionMessage(t); + ServerAccess.log(connectionMesaage, true, true); + } + ProcessAssasin pa = new ProcessAssasin(t, ServerAccess.PROCESS_TIMEOUT); + t.setAssasin(pa); + pa.setReactingProcess(reactingProcess); + setUpClosingListener(stdoutl, pa, t); + setUpClosingListener(stderrl, pa, t); + pa.start(); + t.start(); + while (t.getP() == null && t.deadlyException == null) { + Thread.sleep(100); + } + if (t.deadlyException != null) { + pa.setCanRun(false); + return new ServerAccess.ProcessResult("", "", null, true, Integer.MIN_VALUE, t.deadlyException); + } + ContentReader crs = new ContentReader(t.getP().getInputStream(), stdoutl); + ContentReader cre = new ContentReader(t.getP().getErrorStream(), stderrl); + + OutputStream out = t.getP().getOutputStream(); + if (out != null) { + out.close(); + } + + new Thread(crs).start(); + new Thread(cre).start(); + while (t.isRunning()) { + Thread.sleep(100); + } + + while (!t.isDestoyed()) { + Thread.sleep(100); + } + pa.setCanRun(false); + // ServerAccess.logOutputReprint(t.getP().exitValue()); when process is killed, this throws exception + + ServerAccess.ProcessResult pr = new ServerAccess.ProcessResult(crs.getContent(), cre.getContent(), t.getP(), pa.wasTerminated(), t.getExitCode(), null); + if (ServerAccess.PROCESS_LOG) { + ServerAccess.log(pr.stdout, true, false); + ServerAccess.log(pr.stderr, false, true); + } + if (reactingProcess != null) { + reactingProcess.afterProcess(""); + }; + return pr; + } + + private static void setUpClosingListener(List listeners, ProcessAssasin pa, ThreadedProcess t) { + for (ContentReaderListener listener : listeners) { + if (listener != null && (listener instanceof ClosingListener)) { + ((ClosingListener) listener).setAssasin(pa); + ((ClosingListener) listener).setProcess(t); + } + } + + } + + private static String createConnectionMessage(ThreadedProcess t) { + return "Connecting " + t.getCommandLine(); + } + + void setReactingProcess(ReactingProcess reactingProcess) { + this.reactingProcess = reactingProcess; + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java 2013-04-10 11:40:24.043668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java 2013-05-03 19:08:24.911511813 +0000 @@ -1,5 +1,5 @@ /* ServerAccess.java -Copyright (C) 2011 Red Hat, Inc. +Copyright (C) 2011, 2012 Red Hat, Inc. This file is part of IcedTea. @@ -58,6 +58,8 @@ import net.sourceforge.jnlp.browsertesting.Browser; import net.sourceforge.jnlp.browsertesting.BrowserFactory; import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import org.junit.Assert; /** @@ -77,6 +79,11 @@ */ public class ServerAccess { + public static enum AutoClose { + + CLOSE_ON_EXCEPTION, CLOSE_ON_CORRECT_END, CLOSE_ON_BOTH + } + public static final long NANO_TIME_DELIMITER=1000000l; /** * java property which value containing path to default (makefile by) directory with deployed resources @@ -131,8 +138,10 @@ System.exit(0); } else { int port = 44321; - if (args.length > 0) { - port=new Integer(args[0]); + if (args.length > 0 && args[0].equalsIgnoreCase("randomport")) { + port = findFreePort(); + } else if (args.length > 0) { + port = new Integer(args[0]); } getIndependentInstance(port); while (true) { @@ -156,7 +165,7 @@ return port; } public static final String HEADLES_OPTION="-headless"; - public static final String VERBOSE_OPTION="-verbose "; + public static final String VERBOSE_OPTION="-verbose"; /** * we would like to have an singleton instance ASAP @@ -545,6 +554,20 @@ public ProcessResult executeJavaws(String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { return executeJavaws(null, resource,stdoutl,stderrl); } + + public net.sourceforge.jnlp.ProcessResult executeBrowser(String string, AutoClose autoClose) throws Exception { + ClosingListener errClosing = null; + ClosingListener outClosing = null; + if (autoClose == AutoClose.CLOSE_ON_BOTH || autoClose == AutoClose.CLOSE_ON_EXCEPTION){ + errClosing=new AutoErrorClosingListener(); + } + if (autoClose == AutoClose.CLOSE_ON_BOTH || autoClose == AutoClose.CLOSE_ON_CORRECT_END){ + outClosing=new AutoOkClosingListener(); + } + return executeBrowser(string, outClosing, errClosing); + } + + public ProcessResult executeBrowser(String resource) throws Exception { return executeBrowser(getBrowserParams(), resource); } @@ -552,6 +575,10 @@ return executeBrowser(getBrowserParams(), resource, stdoutl, stderrl); } + public ProcessResult executeBrowser(String resource, List stdoutl, List stderrl) throws Exception { + return executeBrowser(getBrowserParams(), resource, stdoutl, stderrl); + } + /** * wrapping method to executeProcess (eg: javaws arg arg http://localhost:port/resource) * will execute default javaws (@see JAVAWS_BUILD_BIN) upon default url upon cached server (@see SERVER_NAME @see getPort(), @see getInstance())) @@ -571,28 +598,54 @@ } public ProcessResult executeBrowser(List otherargs, String resource) throws Exception { - return executeProcessUponURL(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource)); + return executeBrowser(otherargs, getUrlUponThisInstance(resource)); + } + + public ProcessResult executeBrowser(List otherargs, URL url) throws Exception { + ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, url); + rpw.setReactingProcess(getCurrentBrowser());//current browser may be null, but it does not metter + return rpw.execute(); + } + + public ProcessResult executeBrowser(List otherargs, String resource, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { + ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource), stdoutl, stderrl, null); + rpw.setReactingProcess(getCurrentBrowser());//current browser may be null, but it does not metter + return rpw.execute(); } - public ProcessResult executeBrowser(List otherargs, String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { - return executeProcessUponURL(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource),stdoutl,stderrl); + + public ProcessResult executeBrowser(List otherargs, String resource, List stdoutl, List stderrl) throws Exception { + ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource), stdoutl, stderrl, null); + rpw.setReactingProcess(getCurrentBrowser());// current browser may be null, but it does not matter + return rpw.execute(); } - public ProcessResult executeBrowser(Browser b,List otherargs, String resource) throws Exception { - return executeProcessUponURL(b.getBin(), otherargs, getUrlUponThisInstance(resource)); + public ProcessResult executeBrowser(Browser b, List otherargs, String resource) throws Exception { + ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource)); + rpw.setReactingProcess(b); + return rpw.execute(); } - public ProcessResult executeBrowser(Browser b,List otherargs, String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { - return executeProcessUponURL(b.getBin(), otherargs, getUrlUponThisInstance(resource),stdoutl,stderrl); + + public ProcessResult executeBrowser(Browser b, List otherargs, String resource, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { + ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource), stdoutl, stderrl, null); + rpw.setReactingProcess(b); + return rpw.execute(); + } + + public ProcessResult executeBrowser(Browser b, List otherargs, String resource, List stdoutl, List stderrl) throws Exception { + ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource), stdoutl, stderrl, null); + rpw.setReactingProcess(b); + return rpw.execute(); } /** - * Ctreate resource on http, on 'localhost' on port on which this cached instance is running + * Create resource on http, on 'localhost' on port on which this cached instance is running * @param resource * @return * @throws MalformedURLException */ public URL getUrlUponThisInstance(String resource) throws MalformedURLException { getInstance(); - return getUrlUponInstance(server,resource); + return getUrlUponInstance(server, resource); } /** @@ -630,23 +683,15 @@ * @throws Exception */ public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u) throws Exception { - return executeProcessUponURL(toBeExecuted, otherargs, u,null,null); + return new ProcessWrapper(toBeExecuted, otherargs, u).execute(); } - public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { - return executeProcessUponURL(toBeExecuted, otherargs, u, stdoutl, stderrl, null); + public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { + return new ProcessWrapper(toBeExecuted, otherargs, u, stdoutl, stderrl, null).execute(); } - public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u,ContentReaderListener stdoutl,ContentReaderListener stderrl,String[] vars) throws Exception { - Assert.assertNotNull(u); - Assert.assertNotNull(toBeExecuted); - Assert.assertTrue(toBeExecuted.trim().length() > 1); - if (otherargs == null) { - otherargs = new ArrayList(1); - } - List urledArgs = new ArrayList(otherargs); - urledArgs.add(0, toBeExecuted); - urledArgs.add(u.toString()); - return executeProcess(urledArgs, stdoutl, stderrl,vars); + + public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception { + return new ProcessWrapper(toBeExecuted, otherargs, u, stdoutl, stderrl, vars).execute(); } public static ProcessResult executeProcess(final List args) throws Exception { @@ -678,10 +723,6 @@ return executeProcess(args, dir, null, null); } - private static String createConnectionMessage(ThreadedProcess t) { - return "Connecting " + t.getCommandLine(); - } - /** * Proceed message s to logging with request to reprint to System.err * @param s @@ -706,7 +747,7 @@ log(s, false, false); } - private static void log(String message, boolean printToOut, boolean printToErr) { + static void log(String message, boolean printToOut, boolean printToErr) { String idded; StackTraceElement ste = getTestMethod(); String fullId = ste.getClassName() + "." + ste.getMethodName(); @@ -751,26 +792,49 @@ private static StackTraceElement getTestMethod(StackTraceElement[] stack) { //0 is always thread - //1 is net.sourceforge.jnlp.ServerAccess + //1 is net.sourceforge.jnlp.* + //we need to get out of all of classes from this package or pick last of it StackTraceElement result = stack[1]; String baseClass = stack[1].getClassName(); int i = 2; for (; i < stack.length; i++) { result = stack[i];//at least moving up - if(stack[i].getClassName().contains("$")){ + if (stack[i].getClassName().contains("$")) { continue; } - if (!baseClass.equals(stack[i].getClassName())) { - break; + //probablky it is necessary to get out of net.sourceforge.jnlp. + //package where are right now all test-extensions + //for now keeping exactly the three clases helping yo acces the log + try { + Class clazz = Class.forName(stack[i].getClassName()); + String path = null; + try { + path = clazz.getProtectionDomain().getCodeSource().getLocation().getPath(); + } catch (NullPointerException ex) { + //silently ignoring and continuing with null path + } + if (path != null && path.contains("/tests.build/")) { + if (!path.contains("/test-extensions/")) { + break; + } + } else { + //running from ide + if (!stack[i].getClassName().startsWith("net.sourceforge.jnlp.")) { + break; + } + } + } catch (ClassNotFoundException ex) { + ///should not happen, searching only for already loaded class + ex.printStackTrace(); } } //if nothing left in stack then we have been in ServerAccess already //so the target method is the highest form it and better to return it //rather then die to ArrayOutOfBounds - if(i >= stack.length){ + if (i >= stack.length) { return result; } - //now we are out of net.sourceforge.jnlp.ServerAccess + //now we are out of test-extensions //method we need (the test) is highest from following class baseClass = stack[i].getClassName(); for (; i < stack.length; i++) { @@ -790,48 +854,8 @@ return executeProcess(args, dir, stdoutl, stderrl,null); } - public static ProcessResult executeProcess(final List args, File dir, ContentReaderListener stdoutl, ContentReaderListener stderrl,String[] vars) throws Exception { - ThreadedProcess t = new ThreadedProcess(args, dir,vars); - if (PROCESS_LOG) { - String connectionMesaage = createConnectionMessage(t); - log(connectionMesaage, true, true); - } - ProcessAssasin pa = new ProcessAssasin(t, PROCESS_TIMEOUT); - pa.start(); - t.start(); - while (t.getP() == null && t.deadlyException == null) { - Thread.sleep(100); - } - if (t.deadlyException != null) { - pa.setCanRun(false); - return new ProcessResult("", "", null, true, Integer.MIN_VALUE, t.deadlyException); - } - ContentReader crs = new ContentReader(t.getP().getInputStream(),stdoutl); - ContentReader cre = new ContentReader(t.getP().getErrorStream(),stderrl); - - OutputStream out = t.getP().getOutputStream(); - if (out != null) { - out.close(); - } - - new Thread(crs).start(); - new Thread(cre).start(); - while (t.isRunning()) { - Thread.sleep(100); - } - - while (!t.isDestoyed()) { - Thread.sleep(100); - } - pa.setCanRun(false); - // ServerAccess.logOutputReprint(t.getP().exitValue()); when process is killed, this throws exception - - ProcessResult pr=new ProcessResult(crs.getContent(), cre.getContent(), t.getP(), pa.wasTerminated(), t.getExitCode(), null); - if (PROCESS_LOG) { - log(pr.stdout, true, false); - log(pr.stderr, false, true); - } - return pr; + public static ProcessResult executeProcess(final List args, File dir, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception { + return new ProcessWrapper(args, dir, stdoutl, stderrl, vars).execute(); } /** diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java 2013-04-10 11:40:24.043668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java 2013-05-03 19:08:24.912511801 +0000 @@ -57,7 +57,18 @@ private final Integer port; private final File dir; private ServerSocket serverSocket; + private boolean supportingHeadRequest = true; + public void setSupportingHeadRequest(boolean supportsHead) { + this.supportingHeadRequest = supportsHead; + } + + public boolean isSupportingHeadRequest() { + return supportingHeadRequest; + } + + + public String getServerName() { return serverName; } @@ -102,10 +113,12 @@ try { serverSocket = new ServerSocket(port); while (running) { - new TinyHttpdImpl(serverSocket.accept(), dir, port); + TinyHttpdImpl server = new TinyHttpdImpl(serverSocket.accept(), dir, port,false); + server.setSupportingHeadRequest(isSupportingHeadRequest()); + server.start(); } } catch (Exception e) { - e.printStackTrace(); + ServerAccess.logException(e); } finally { running = false; } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java 2013-04-10 11:40:24.043668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java 2013-05-03 19:08:24.912511801 +0000 @@ -45,7 +45,7 @@ * wrapper around Runtime.getRuntime().exec(...) which ensures that process is run inside its own, by us controlled, thread. * Process builder caused some unexpected and weird behavior :/ */ -class ThreadedProcess extends Thread { +public class ThreadedProcess extends Thread { Process p = null; List args; @@ -59,6 +59,7 @@ * check DeadLockTestTest.testDeadLockTestTerminated2 */ private boolean destoyed = false; + private ProcessAssasin assasin; public boolean isDestoyed() { return destoyed; @@ -143,6 +144,9 @@ try { exitCode = p.waitFor(); Thread.sleep(500); //this is giving to fast done proecesses's e/o readers time to read all. I would like to know better solution :-/ + while(assasin.isKilling() && !assasin.haveKilled()){ + Thread.sleep(100); + }; } finally { destoyed = true; } @@ -163,4 +167,8 @@ running = false; } } + + void setAssasin(ProcessAssasin pa) { + this.assasin=pa; + } } diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java 2013-04-10 11:40:24.043668000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java 2013-05-03 19:08:24.913511789 +0000 @@ -42,6 +42,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; +import java.net.HttpURLConnection; import java.net.Socket; import java.net.SocketException; import java.net.URLDecoder; @@ -55,25 +56,41 @@ * When resource starts with XslowX prefix, then resouce (without XslowX) * is returned, but its delivery is delayed */ -class TinyHttpdImpl extends Thread { +public class TinyHttpdImpl extends Thread { Socket c; private final File dir; private final int port; private boolean canRun = true; private static final String XSX = "/XslowX"; - + private boolean supportingHeadRequest = true; + public TinyHttpdImpl(Socket s, File f, int port) { + this(s, f, port, true); + } + public TinyHttpdImpl(Socket s, File f, int port, boolean start) { c = s; this.dir = f; this.port = port; - start(); + if (start){ + start(); + } } public void setCanRun(boolean canRun) { this.canRun = canRun; } + public void setSupportingHeadRequest(boolean supportsHead) { + this.supportingHeadRequest = supportsHead; + } + + public boolean isSupportingHeadRequest() { + return supportingHeadRequest; + } + + + public int getPort() { return port; } @@ -89,7 +106,16 @@ if (s.length() < 1) { break; } - if (s.startsWith("GET")) { + + boolean isGetRequest = s.startsWith("GET"); + boolean isHeadRequest = s.startsWith("HEAD"); + + if (isHeadRequest && !isSupportingHeadRequest()){ + o.writeBytes("HTTP/1.0 "+HttpURLConnection.HTTP_NOT_IMPLEMENTED+" Not Implemented\n"); + continue; + } + + if (isGetRequest || isHeadRequest ) { StringTokenizer t = new StringTokenizer(s, " "); t.nextToken(); String op = t.nextToken(); @@ -99,7 +125,7 @@ } ServerAccess.logNoReprint("Getting: " + p); p = URLDecoder.decode(p, "UTF-8"); - p=p.replaceAll("\\?.*", ""); + p = p.replaceAll("\\?.*", ""); p = (".".concat((p.endsWith("/")) ? p.concat("index.html") : p)).replace('/', File.separatorChar); ServerAccess.logNoReprint("Serving: " + p); File pp = new File(dir, p); @@ -116,7 +142,12 @@ } else if (p.toLowerCase().endsWith(".jar")) { content = ct + "application/x-jar\n"; } - o.writeBytes("HTTP/1.0 200 OK\nContent-Length:" + l + "\n" + content + "\n"); + o.writeBytes("HTTP/1.0 "+HttpURLConnection.HTTP_OK+" OK\nContent-Length:" + l + "\n" + content + "\n"); + + if (isHeadRequest) { + continue; // Skip sending body + } + if (op.startsWith(XSX)) { byte[][] bb = splitArray(b, 10); for (int j = 0; j < bb.length; j++) { diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/tools/AsyncJavaws.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/tools/AsyncJavaws.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/tools/AsyncJavaws.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/tools/AsyncJavaws.java 2013-05-03 19:08:24.929511588 +0000 @@ -0,0 +1,88 @@ +/* AsyncJavaws.java + Copyright (C) 2012 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.tools; + +import java.util.List; +import net.sourceforge.jnlp.ContentReaderListener; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import org.junit.Assert; + +/** + * You can see ClipboardContext reproducers as examples + * + */ +public class AsyncJavaws implements Runnable { + + private final boolean headless; + private final String url; + private ProcessResult result; + private ContentReaderListener contentReaderListener; + private ContentReaderListener errorReaderListener; + private final List argList; + private final ServerAccess server; + + public AsyncJavaws(ServerAccess server, String url, List argList, boolean headless, ContentReaderListener contentReaderListener, ContentReaderListener errorReaderListener) { + this.url = url; + this.headless = headless; + this.contentReaderListener = contentReaderListener; + this.errorReaderListener = errorReaderListener; + this.argList = argList; + this.server = server; + Assert.assertNotNull(server); + } + + @Override + public void run() { + try { + if (headless) { + result = server.executeJavawsHeadless(argList, url, contentReaderListener, errorReaderListener, null); + } else { + result = server.executeJavaws(argList, url, contentReaderListener, errorReaderListener); + } + } catch (Exception ex) { + if (result == null) { + result = new ProcessResult("", ex.getMessage(), null, true, 1, ex); + } + throw new RuntimeException(ex); + } + } + + public ProcessResult getResult() { + return result; + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/tools/ClipboardHelpers.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/tools/ClipboardHelpers.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/tools/ClipboardHelpers.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/tools/ClipboardHelpers.java 2013-05-03 19:08:24.929511588 +0000 @@ -0,0 +1,64 @@ +/* ClipboardHelpers.java + Copyright (C) 2012 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +package net.sourceforge.jnlp.tools; + +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.IOException; + +public class ClipboardHelpers { + + public static void putToClipboard(String str) { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Clipboard clipboard = toolkit.getSystemClipboard(); + StringSelection strSel = new StringSelection(str); + clipboard.setContents(strSel, null); + } + + public static String pasteFromClipboard() throws UnsupportedFlavorException, IOException { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Clipboard clipboard = toolkit.getSystemClipboard(); + Transferable clipData = clipboard.getContents(clipboard); + String s = (String) (clipData.getTransferData( + DataFlavor.stringFlavor)); + return s; + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java 2013-05-03 19:08:24.930511575 +0000 @@ -0,0 +1,145 @@ +/* + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +package net.sourceforge.jnlp.tools; + +import java.security.CodeSigner; +import java.security.PrivateKey; +import java.security.Timestamp; +import java.security.cert.CertPath; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Date; + +import sun.security.x509.AlgorithmId; +import sun.security.x509.CertAndKeyGen; +import sun.security.x509.CertificateAlgorithmId; +import sun.security.x509.CertificateIssuerName; +import sun.security.x509.CertificateSerialNumber; +import sun.security.x509.CertificateSubjectName; +import sun.security.x509.CertificateValidity; +import sun.security.x509.CertificateVersion; +import sun.security.x509.X500Name; +import sun.security.x509.X509CertImpl; +import sun.security.x509.X509CertInfo; + +public class CodeSignerCreator { + + /** + * Create an X509 Certificate signed using SHA1withRSA with a 2048 bit key. + * @param dname Domain Name to represent the certificate + * @param notBefore The date by which the certificate starts being valid. Cannot be null. + * @param validity The number of days the certificate is valid after notBefore. + * @return An X509 certificate setup with properties using the specified parameters. + * @throws Exception + */ + public static X509Certificate createCert(String dname, Date notBefore, int validity) + throws Exception { + int keysize = 2048; + String keyAlgName = "RSA"; + String sigAlgName = "SHA1withRSA"; + + if (dname == null) + throw new Exception("Required DN is null. Please specify cert Domain Name via dname"); + if (notBefore == null) + throw new Exception("Required start date is null. Please specify the date at which the cert is valid via notBefore"); + if (validity < 0) + throw new Exception("Required validity is negative. Please specify the number of days for which the cert is valid after the start date."); + + // KeyTool#doGenKeyPair + X500Name x500Name = new X500Name(dname); + + CertAndKeyGen keypair = new CertAndKeyGen(keyAlgName, sigAlgName); + + keypair.generate(keysize); + PrivateKey privKey = keypair.getPrivateKey(); + + X509Certificate oldCert = keypair.getSelfCertificate(x500Name, + notBefore, validity * 24L * 60L * 60L); + + // KeyTool#doSelfCert + byte[] encoded = oldCert.getEncoded(); + X509CertImpl certImpl = new X509CertImpl(encoded); + X509CertInfo certInfo = (X509CertInfo) certImpl.get(X509CertImpl.NAME + + "." + X509CertImpl.INFO); + + Date notAfter = new Date(notBefore.getTime() + validity*1000L*24L*60L*60L); + + CertificateValidity interval = new CertificateValidity(notBefore, + notAfter); + + certInfo.set(X509CertInfo.VALIDITY, interval); + certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber( + new java.util.Random().nextInt() & 0x7fffffff)); + certInfo.set(X509CertInfo.SUBJECT + "." + CertificateSubjectName.DN_NAME, x500Name); + certInfo.set(X509CertInfo.ISSUER + "." + CertificateIssuerName.DN_NAME, x500Name); + + // The inner and outer signature algorithms have to match. + // The way we achieve that is really ugly, but there seems to be no + // other solution: We first sign the cert, then retrieve the + // outer sigalg and use it to set the inner sigalg + X509CertImpl newCert = new X509CertImpl(certInfo); + newCert.sign(privKey, sigAlgName); + AlgorithmId sigAlgid = (AlgorithmId)newCert.get(X509CertImpl.SIG_ALG); + certInfo.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, sigAlgid); + + certInfo.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3)); + + // FIXME Figure out extensions +// CertificateExtensions ext = createV3Extensions( +// null, +// (CertificateExtensions)certInfo.get(X509CertInfo.EXTENSIONS), +// v3ext, +// oldCert.getPublicKey(), +// null); +// certInfo.set(X509CertInfo.EXTENSIONS, ext); + + newCert = new X509CertImpl(certInfo); + newCert.sign(privKey, sigAlgName); + + return newCert; + } + + /** + * Create a new code signer with the specified information. + * @param domainName Domain Name to represent the certificate + * @param notBefore The date by which the certificate starts being valid. Cannot be null. + * @param validity The number of days the certificate is valid after notBefore. + * @return A code signer with the properties passed through its parameters. + */ + public static CodeSigner getOneCodeSigner(String domainName, Date notBefore, int validity) + throws Exception { + X509Certificate jarEntryCert = createCert(domainName, notBefore, validity); + + ArrayList certs = new ArrayList(1); + certs.add(jarEntryCert); + + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + CertPath certPath = cf.generateCertPath(certs); + Timestamp certTimestamp = new Timestamp(jarEntryCert.getNotBefore(), certPath); + return new CodeSigner(certPath, certTimestamp); + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/tools/WaitingForStringProcess.java icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/tools/WaitingForStringProcess.java --- icedtea-web-1.3.2/tests/test-extensions/net/sourceforge/jnlp/tools/WaitingForStringProcess.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/net/sourceforge/jnlp/tools/WaitingForStringProcess.java 2013-05-03 19:08:24.930511575 +0000 @@ -0,0 +1,91 @@ +package net.sourceforge.jnlp.tools; + + +import java.util.List; +import net.sourceforge.jnlp.ContentReaderListener; +import net.sourceforge.jnlp.ServerAccess; +import org.junit.Assert; + +/** + * You can see ClipboardContext reproducers as examples + * + */ + +public class WaitingForStringProcess implements ContentReaderListener, Runnable { + private final boolean headless; + private final String url; + private StringBuilder output = new StringBuilder(); + private StringBuilder err = new StringBuilder(); + private AsyncJavaws aj; + ContentReaderListener errListener = new ContentReaderListener() { + @Override + public void charReaded(char ch) { + err.append(ch); + } + + @Override + public void lineReaded(String s) { + } + }; + private final String waitingFor; + private boolean canRun = true; + private final ServerAccess server; + private final List otherArgs; + + public WaitingForStringProcess(ServerAccess server, String url, List otherArgs, boolean headless, String waitingFor) { + this.url = url; + this.headless = headless; + this.waitingFor = waitingFor; + Assert.assertNotNull(waitingFor); + Assert.assertNotNull(url); + this.server = server; + this.otherArgs = otherArgs; + Assert.assertNotNull(server); + } + + @Override + public void charReaded(char ch) { + output.append(ch); + } + + @Override + public void lineReaded(String s) { + if (s.contains(waitingFor)) { + canRun = false; + } + } + + @Override + public void run() { + aj = new AsyncJavaws(server, url, otherArgs, headless, this, errListener); + ServerAccess.logOutputReprint("Starting thread with " + url + " and waiting for result or string " + waitingFor); + new Thread(aj).start(); + while (canRun && aj.getResult() == null) { + try { + Thread.sleep(100); + } catch (InterruptedException ex) { + ServerAccess.logErrorReprint("iteration interrupted"); + throw new RuntimeException(ex); + } + } + if (aj.getResult() != null) { + ServerAccess.logOutputReprint("Waiting done. Result have been delivered"); + } + if (!canRun) { + ServerAccess.logOutputReprint("Waiting done. String " + waitingFor + " delivered"); + } + } + + public String getErr() { + return err.toString(); + } + + public String getOutput() { + return output.toString(); + } + + public AsyncJavaws getAj() { + return aj; + } + +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/sun/applet/mock/PluginPipeMock.java icedtea-web-1.4/tests/test-extensions/sun/applet/mock/PluginPipeMock.java --- icedtea-web-1.3.2/tests/test-extensions/sun/applet/mock/PluginPipeMock.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/sun/applet/mock/PluginPipeMock.java 2013-05-03 19:08:24.931511562 +0000 @@ -0,0 +1,121 @@ +package sun.applet.mock; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.StringReader; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; + +/** + * Helper for getting an input & output stream for use with PluginStreamHandler. + * Provides a convenient way of reading the Java requests and sending mocked + * plugin responses. + * + * The handling of these requests should be done on a different thread from the + * tested method, as icedtea-web will block waiting for a reply after sending a + * request. + */ +public class PluginPipeMock { + private ResponseInputPipeMock responseInputStream = new ResponseInputPipeMock(); + private RequestOutputPipeMock requestOutputStream = new RequestOutputPipeMock(); + + /* + * A queue of mocked responses that are sent as replies to icedtea-web + * Java-side requests. + */ + private BlockingQueue mockedResponseQueue = new LinkedBlockingQueue(); + + /* + * A queue of actual (ie, not mocked) requests that come from methods + * under test. + */ + private BlockingQueue requestQueue = new LinkedBlockingQueue(); + + public InputStream getResponseInputStream() { + return responseInputStream; + } + + public OutputStream getRequestOutputStream() { + return requestOutputStream; + } + + public String getNextRequest() { + try { + return requestQueue.take(); + } catch (InterruptedException e) { + // Nothing to do + return null; + } + } + + public void sendResponse(String response) { + try { + mockedResponseQueue.put(response); + } catch (InterruptedException e) { + // Nothing to do + } + } + + /** + * Queues mocked responses and sends them as replies to icedtea-web. A + * synchronized message queue is read from. Blocks until it gets the next + * message. + */ + private class ResponseInputPipeMock extends InputStream { + private StringReader reader = null; + + @Override + public int read() throws IOException { + try { + while (true) { + if (reader == null) { + reader = new StringReader(mockedResponseQueue.take() + '\n'); + } + int chr = reader.read(); + if (chr == -1) { + reader = null; + continue; + } + return chr; + } + } catch (InterruptedException e) { + // Nothing to do + return -1; + } + } + + /* Necessary for correct behaviour with BufferedReader! */ + @Override + public int read(byte b[], int off, int len) throws IOException { + if (len == 0) { + return 0; + } + b[off] = (byte) read(); + return 1; + } + } + + /** + * Outputs requests from icedtea-web as a stream of lines. A synchronized + * message queue is written to. + */ + private class RequestOutputPipeMock extends OutputStream { + private StringBuilder lineBuffer = new StringBuilder(); + + @Override + public synchronized void write(int b) throws IOException { + try { + char chr = (char) b; + if (chr == '\0') { + requestQueue.put(lineBuffer.toString()); + lineBuffer.setLength(0); + } else { + lineBuffer.append((char) b); + } + } catch (InterruptedException e) { + // Nothing to do + } + } + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions/sun/applet/PluginPipeMockUtil.java icedtea-web-1.4/tests/test-extensions/sun/applet/PluginPipeMockUtil.java --- icedtea-web-1.3.2/tests/test-extensions/sun/applet/PluginPipeMockUtil.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions/sun/applet/PluginPipeMockUtil.java 2013-05-03 19:08:24.931511562 +0000 @@ -0,0 +1,131 @@ +/* Copyright (C) 2013 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +/* Must be in sun.applet to access PluginAppletSecurityContext's constructor and PluginObjectStore */ +package sun.applet; + +import java.util.IdentityHashMap; + +import sun.applet.mock.PluginPipeMock; + +/* + * Convenience class for PluginPipeMock. + * Provides convenient methods for installing a custom pipe mock and cleaning it up. + * + * Provides PipeMessageHandler interface and accompany convenience methods which can + * be used to define mocked pipes in a simple manner. + * */ +public class PluginPipeMockUtil { + + /************************************************************************** + * Basic setup & teardown * + **************************************************************************/ + + /* Maps PluginPipeMock instances to a ThreadGroup, allowing us to stop all the + * message handling threads that we started when setting up the mock pipes. */ + static private IdentityHashMap pipeToThreadGroup = new IdentityHashMap(); + + /* By providing custom implementations of the input stream & output stream used by PluginStreamHandler, + * we are able to mock the C++-side of the plugin. We do this by sending the messages the Java-side expects + * to receive. Additionally, we are able to test that the Java-side sends the correct requests. + * See PluginPipeMock for more details. + */ + static private PluginPipeMock installPipeMock() { + AppletSecurityContextManager.addContext(0, new PluginAppletSecurityContext(0, false /* no security manager */)); + + PluginPipeMock pipeMock = new PluginPipeMock(); + + PluginStreamHandler streamHandler = new PluginStreamHandler(pipeMock.getResponseInputStream(), pipeMock.getRequestOutputStream()); + PluginAppletViewer.setStreamhandler(streamHandler); + PluginAppletViewer.setPluginCallRequestFactory(new PluginCallRequestFactory()); + + streamHandler.startProcessing(); + + return pipeMock; + } + + + /* Set up the mocked plugin pipe environment. See installPipeMock for details. */ + static public PluginPipeMock setupMockedMessageHandling() throws Exception { + ThreadGroup pipeThreadGroup = new ThreadGroup("PluginAppletViewerTestThreadGroup") { + public void uncaughtException(Thread t, Throwable e) { + // Silent death for plugin message handler threads + } + }; + + final PluginPipeMock[] pipeMock = {null}; + // Do set-up in a thread so we can pass along our thread-group, used for clean-up. + Thread initThread = new Thread(pipeThreadGroup, "InstallPipeMockThread") { + @Override + public void run() { + pipeMock[0] = installPipeMock(); + } + }; + + initThread.start(); + initThread.join(); + + pipeToThreadGroup.put(pipeMock[0], pipeThreadGroup); + return pipeMock[0]; + } + + /* Kill any message handling threads started when setting up the mocked pipes */ + @SuppressWarnings("deprecation") + static public void cleanUpMockedMessageHandling(PluginPipeMock pipeMock) throws Exception { + ThreadGroup pipeThreadGroup = pipeToThreadGroup.get(pipeMock); + if (pipeThreadGroup != null) { + pipeThreadGroup.stop(); + } + pipeToThreadGroup.remove(pipeMock); + } + + /************************************************************************** + * Object store utilities * + **************************************************************************/ + /* + * Helpers for manipulating the object mapping using to refer to objects in + * the plugin + */ + public static Object getPluginStoreObject(int id) { + return PluginObjectStore.getInstance().getObject(id); + } + + /* Stores the object if it is not yet stored */ + public static int getPluginStoreId(Object obj) { + PluginObjectStore.getInstance().reference(obj); + return PluginObjectStore.getInstance().getIdentifier(obj); + } +} diff -Nru icedtea-web-1.3.2/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java icedtea-web-1.4/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java --- icedtea-web-1.3.2/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java 2013-05-03 19:08:24.906511875 +0000 @@ -0,0 +1,56 @@ +/* ComponentFinderTest.java +Copyright (C) 2013 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + */ +package net.sourceforge.jnlp.awt.imagesearch; + +import java.awt.image.BufferedImage; +import org.junit.Assert; +import org.junit.Test; + +/** + * + * This class is a part of AWTFramework, contains component finding + * by searching for icons. + * + */ +public class ComponentFinderTest { + + @Test + public void initialiseDefaultIcon() { + BufferedImage icon = ComponentFinder.defaultIcon; + Assert.assertNotNull("The default icon marker.png was not initialized.", icon); + } +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/COPYING icedtea-web-1.4/tests/UnitTest++/COPYING --- icedtea-web-1.3.2/tests/UnitTest++/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/COPYING 2013-05-03 19:08:24.520516725 +0000 @@ -0,0 +1,20 @@ +Copyright (c) 2006 Noel Llopis and Charles Nicholson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -Nru icedtea-web-1.3.2/tests/UnitTest++/Makefile icedtea-web-1.4/tests/UnitTest++/Makefile --- icedtea-web-1.3.2/tests/UnitTest++/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/Makefile 2013-05-03 19:08:24.521516713 +0000 @@ -0,0 +1,96 @@ +CXX = g++ +CXXFLAGS ?= -g -Wall -W -ansi # -pedantic +LDFLAGS ?= +SED = sed +MV = mv +RM = rm + +.SUFFIXES: .o .cpp + +lib = libUnitTest++.a +test = TestUnitTest++ + +src = src/AssertException.cpp \ + src/Test.cpp \ + src/Checks.cpp \ + src/TestRunner.cpp \ + src/TestResults.cpp \ + src/TestReporter.cpp \ + src/TestReporterStdout.cpp \ + src/ReportAssert.cpp \ + src/TestList.cpp \ + src/TimeConstraint.cpp \ + src/TestDetails.cpp \ + src/MemoryOutStream.cpp \ + src/DeferredTestReporter.cpp \ + src/DeferredTestResult.cpp \ + src/XmlTestReporter.cpp \ + src/CurrentTest.cpp + +ifeq ($(MSYSTEM), MINGW32) + src += src/Win32/TimeHelpers.cpp +else + src += src/Posix/SignalTranslator.cpp \ + src/Posix/TimeHelpers.cpp +endif + +test_src = src/tests/Main.cpp \ + src/tests/TestAssertHandler.cpp \ + src/tests/TestChecks.cpp \ + src/tests/TestUnitTest++.cpp \ + src/tests/TestTest.cpp \ + src/tests/TestTestResults.cpp \ + src/tests/TestTestRunner.cpp \ + src/tests/TestCheckMacros.cpp \ + src/tests/TestTestList.cpp \ + src/tests/TestTestMacros.cpp \ + src/tests/TestTimeConstraint.cpp \ + src/tests/TestTimeConstraintMacro.cpp \ + src/tests/TestMemoryOutStream.cpp \ + src/tests/TestDeferredTestReporter.cpp \ + src/tests/TestXmlTestReporter.cpp \ + src/tests/TestCurrentTest.cpp + +objects = $(patsubst %.cpp, %.o, $(src)) +test_objects = $(patsubst %.cpp, %.o, $(test_src)) +dependencies = $(subst .o,.d,$(objects)) +test_dependencies = $(subst .o,.d,$(test_objects)) + +define make-depend + $(CXX) $(CXXFLAGS) -M $1 | \ + $(SED) -e 's,\($(notdir $2)\) *:,$(dir $2)\1: ,' > $3.tmp + $(SED) -e 's/#.*//' \ + -e 's/^[^:]*: *//' \ + -e 's/ *\\$$//' \ + -e '/^$$/ d' \ + -e 's/$$/ :/' $3.tmp >> $3.tmp + $(MV) $3.tmp $3 +endef + + +all: $(lib) + + +$(lib): $(objects) + @echo Creating $(lib) library... + @ar cr $(lib) $(objects) + +$(test): $(lib) $(test_objects) + @echo Linking $(test)... + @$(CXX) $(LDFLAGS) -o $(test) $(test_objects) $(lib) + @echo Running unit tests... + @./$(test) + +clean: + -@$(RM) $(objects) $(test_objects) $(dependencies) $(test_dependencies) $(test) $(lib) 2> /dev/null + +%.o : %.cpp + @echo $< + @$(call make-depend,$<,$@,$(subst .o,.d,$@)) + @$(CXX) $(CXXFLAGS) -c $< -o $(patsubst %.cpp, %.o, $<) + + +ifneq "$(MAKECMDGOALS)" "clean" +-include $(dependencies) +-include $(test_dependencies) +endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/README icedtea-web-1.4/tests/UnitTest++/README --- icedtea-web-1.3.2/tests/UnitTest++/README 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/README 2013-05-03 19:08:24.522516701 +0000 @@ -0,0 +1,68 @@ +UnitTest++ README +Version: v1.4 +Last update: 2008-10-30 + +UnitTest++ is free software. You may copy, distribute, and modify it under +the terms of the License contained in the file COPYING distributed +with this package. This license is the same as the MIT/X Consortium +license. + +See src/tests/TestUnitTest++.cpp for usage. + +Authors: +Noel Llopis (llopis@convexhull.com) +Charles Nicholson (charles.nicholson@gmail.com) + +Contributors: +Jim Tilander +Kim Grasman +Jonathan Jansson +Dirck Blaskey +Rory Driscoll +Dan Lind +Matt Kimmel -- Submitted with permission from Blue Fang Games +Anthony Moralez +Jeff Dixon +Randy Coulman +Lieven van der Heide + +Release notes: +-------------- +Version 1.4 (2008-10-30) +- CHECK macros work at arbitrary stack depth from inside TESTs. +- Remove obsolete TEST_UTILITY macros +- Predicated test execution (via TestRunner::RunTestsIf) +- Better exception handling for fixture ctors/dtors. +- VC6/7/8/9 support + +Version 1.3 (2007-4-22) +- Removed dynamic memory allocations (other than streams) +- MinGW support +- Consistent (native) line endings +- Minor bug fixing + +Version 1.2 (2006-10-29) +- First pass at documentation. +- More detailed error crash catching in fixtures. +- Standard streams used for printing objects under check. This should allow the + use of standard class types such as std::string or other custom classes with + stream operators to ostream. +- Standard streams can be optionally compiled off by defining UNITTEST_USE_CUSTOM_STREAMS + in Config.h +- Added named test suites +- Added CHECK_ARRAY2D_CLOSE +- Posix library name is libUnitTest++.a now +- Floating point numbers are postfixed with f in the failure reports + +Version 1.1 (2006-04-18) +- CHECK macros do not have side effects even if one of the parameters changes state +- Removed CHECK_ARRAY_EQUAL (too similar to CHECK_ARRAY_CLOSE) +- Added local and global time constraints +- Removed dependencies on strstream +- Improved Posix signal to exception translator +- Failing tests are added to Visual Studio's error list +- Fixed Visual Studio projects to work with spaces in directories + +Version 1.0 (2006-03-15) +- Initial release + diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/AssertException.cpp icedtea-web-1.4/tests/UnitTest++/src/AssertException.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/AssertException.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/AssertException.cpp 2013-05-03 19:08:24.532516577 +0000 @@ -0,0 +1,34 @@ +#include "AssertException.h" +#include + +namespace UnitTest { + +AssertException::AssertException(char const* description, char const* filename, int lineNumber) + : m_lineNumber(lineNumber) +{ + using namespace std; + + strcpy(m_description, description); + strcpy(m_filename, filename); +} + +AssertException::~AssertException() throw() +{ +} + +char const* AssertException::what() const throw() +{ + return m_description; +} + +char const* AssertException::Filename() const +{ + return m_filename; +} + +int AssertException::LineNumber() const +{ + return m_lineNumber; +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/AssertException.h icedtea-web-1.4/tests/UnitTest++/src/AssertException.h --- icedtea-web-1.3.2/tests/UnitTest++/src/AssertException.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/AssertException.h 2013-05-03 19:08:24.532516578 +0000 @@ -0,0 +1,28 @@ +#ifndef UNITTEST_ASSERTEXCEPTION_H +#define UNITTEST_ASSERTEXCEPTION_H + +#include + + +namespace UnitTest { + +class AssertException : public std::exception +{ +public: + AssertException(char const* description, char const* filename, int lineNumber); + virtual ~AssertException() throw(); + + virtual char const* what() const throw(); + + char const* Filename() const; + int LineNumber() const; + +private: + char m_description[512]; + char m_filename[256]; + int m_lineNumber; +}; + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/CheckMacros.h icedtea-web-1.4/tests/UnitTest++/src/CheckMacros.h --- icedtea-web-1.3.2/tests/UnitTest++/src/CheckMacros.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/CheckMacros.h 2013-05-03 19:08:24.533516565 +0000 @@ -0,0 +1,122 @@ +#ifndef UNITTEST_CHECKMACROS_H +#define UNITTEST_CHECKMACROS_H + +#include "Checks.h" +#include "AssertException.h" +#include "MemoryOutStream.h" +#include "TestDetails.h" +#include "CurrentTest.h" + +#ifdef CHECK + #error UnitTest++ redefines CHECK +#endif + +#ifdef CHECK_EQUAL + #error UnitTest++ redefines CHECK_EQUAL +#endif + +#ifdef CHECK_CLOSE + #error UnitTest++ redefines CHECK_CLOSE +#endif + +#ifdef CHECK_ARRAY_EQUAL + #error UnitTest++ redefines CHECK_ARRAY_EQUAL +#endif + +#ifdef CHECK_ARRAY_CLOSE + #error UnitTest++ redefines CHECK_ARRAY_CLOSE +#endif + +#ifdef CHECK_ARRAY2D_CLOSE + #error UnitTest++ redefines CHECK_ARRAY2D_CLOSE +#endif + +#define CHECK(value) \ + do \ + { \ + try { \ + if (!UnitTest::Check(value)) \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), #value); \ + } \ + catch (...) { \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ + "Unhandled exception in CHECK(" #value ")"); \ + } \ + } while (0) + +#define CHECK_EQUAL(expected, actual) \ + do \ + { \ + try { \ + UnitTest::CheckEqual(*UnitTest::CurrentTest::Results(), expected, actual, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ + } \ + catch (...) { \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ + "Unhandled exception in CHECK_EQUAL(" #expected ", " #actual ")"); \ + } \ + } while (0) + +#define CHECK_CLOSE(expected, actual, tolerance) \ + do \ + { \ + try { \ + UnitTest::CheckClose(*UnitTest::CurrentTest::Results(), expected, actual, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ + } \ + catch (...) { \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ + "Unhandled exception in CHECK_CLOSE(" #expected ", " #actual ")"); \ + } \ + } while (0) + +#define CHECK_ARRAY_EQUAL(expected, actual, count) \ + do \ + { \ + try { \ + UnitTest::CheckArrayEqual(*UnitTest::CurrentTest::Results(), expected, actual, count, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ + } \ + catch (...) { \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ + "Unhandled exception in CHECK_ARRAY_EQUAL(" #expected ", " #actual ")"); \ + } \ + } while (0) + +#define CHECK_ARRAY_CLOSE(expected, actual, count, tolerance) \ + do \ + { \ + try { \ + UnitTest::CheckArrayClose(*UnitTest::CurrentTest::Results(), expected, actual, count, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ + } \ + catch (...) { \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ + "Unhandled exception in CHECK_ARRAY_CLOSE(" #expected ", " #actual ")"); \ + } \ + } while (0) + +#define CHECK_ARRAY2D_CLOSE(expected, actual, rows, columns, tolerance) \ + do \ + { \ + try { \ + UnitTest::CheckArray2DClose(*UnitTest::CurrentTest::Results(), expected, actual, rows, columns, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ + } \ + catch (...) { \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ + "Unhandled exception in CHECK_ARRAY_CLOSE(" #expected ", " #actual ")"); \ + } \ + } while (0) + + +#define CHECK_THROW(expression, ExpectedExceptionType) \ + do \ + { \ + bool caught_ = false; \ + try { expression; } \ + catch (ExpectedExceptionType const&) { caught_ = true; } \ + catch (...) {} \ + if (!caught_) \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), "Expected exception: \"" #ExpectedExceptionType "\" not thrown"); \ + } while(0) + +#define CHECK_ASSERT(expression) \ + CHECK_THROW(expression, UnitTest::AssertException); + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/Checks.cpp icedtea-web-1.4/tests/UnitTest++/src/Checks.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/Checks.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/Checks.cpp 2013-05-03 19:08:24.534516552 +0000 @@ -0,0 +1,50 @@ +#include "Checks.h" +#include + +namespace UnitTest { + +namespace { + +void CheckStringsEqual(TestResults& results, char const* expected, char const* actual, + TestDetails const& details) +{ + using namespace std; + + if (strcmp(expected, actual)) + { + UnitTest::MemoryOutStream stream; + stream << "Expected " << expected << " but was " << actual; + + results.OnTestFailure(details, stream.GetText()); + } +} + +} + + +void CheckEqual(TestResults& results, char const* expected, char const* actual, + TestDetails const& details) +{ + CheckStringsEqual(results, expected, actual, details); +} + +void CheckEqual(TestResults& results, char* expected, char* actual, + TestDetails const& details) +{ + CheckStringsEqual(results, expected, actual, details); +} + +void CheckEqual(TestResults& results, char* expected, char const* actual, + TestDetails const& details) +{ + CheckStringsEqual(results, expected, actual, details); +} + +void CheckEqual(TestResults& results, char const* expected, char* actual, + TestDetails const& details) +{ + CheckStringsEqual(results, expected, actual, details); +} + + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/Checks.h icedtea-web-1.4/tests/UnitTest++/src/Checks.h --- icedtea-web-1.3.2/tests/UnitTest++/src/Checks.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/Checks.h 2013-05-03 19:08:24.535516539 +0000 @@ -0,0 +1,158 @@ +#ifndef UNITTEST_CHECKS_H +#define UNITTEST_CHECKS_H + +#include "Config.h" +#include "TestResults.h" +#include "MemoryOutStream.h" + +namespace UnitTest { + + +template< typename Value > +bool Check(Value const value) +{ + return !!value; // doing double negative to avoid silly VS warnings +} + + +template< typename Expected, typename Actual > +void CheckEqual(TestResults& results, Expected const& expected, Actual const& actual, TestDetails const& details) +{ + if (!(expected == actual)) + { + UnitTest::MemoryOutStream stream; + stream << "Expected " << expected << " but was " << actual; + + results.OnTestFailure(details, stream.GetText()); + } +} + +void CheckEqual(TestResults& results, char const* expected, char const* actual, TestDetails const& details); + +void CheckEqual(TestResults& results, char* expected, char* actual, TestDetails const& details); + +void CheckEqual(TestResults& results, char* expected, char const* actual, TestDetails const& details); + +void CheckEqual(TestResults& results, char const* expected, char* actual, TestDetails const& details); + +template< typename Expected, typename Actual, typename Tolerance > +bool AreClose(Expected const& expected, Actual const& actual, Tolerance const& tolerance) +{ + return (actual >= (expected - tolerance)) && (actual <= (expected + tolerance)); +} + +template< typename Expected, typename Actual, typename Tolerance > +void CheckClose(TestResults& results, Expected const& expected, Actual const& actual, Tolerance const& tolerance, + TestDetails const& details) +{ + if (!AreClose(expected, actual, tolerance)) + { + UnitTest::MemoryOutStream stream; + stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual; + + results.OnTestFailure(details, stream.GetText()); + } +} + + +template< typename Expected, typename Actual > +void CheckArrayEqual(TestResults& results, Expected const& expected, Actual const& actual, + int const count, TestDetails const& details) +{ + bool equal = true; + for (int i = 0; i < count; ++i) + equal &= (expected[i] == actual[i]); + + if (!equal) + { + UnitTest::MemoryOutStream stream; + + stream << "Expected [ "; + + for (int expectedIndex = 0; expectedIndex < count; ++expectedIndex) + stream << expected[expectedIndex] << " "; + + stream << "] but was [ "; + + for (int actualIndex = 0; actualIndex < count; ++actualIndex) + stream << actual[actualIndex] << " "; + + stream << "]"; + + results.OnTestFailure(details, stream.GetText()); + } +} + +template< typename Expected, typename Actual, typename Tolerance > +bool ArrayAreClose(Expected const& expected, Actual const& actual, int const count, Tolerance const& tolerance) +{ + bool equal = true; + for (int i = 0; i < count; ++i) + equal &= AreClose(expected[i], actual[i], tolerance); + return equal; +} + +template< typename Expected, typename Actual, typename Tolerance > +void CheckArrayClose(TestResults& results, Expected const& expected, Actual const& actual, + int const count, Tolerance const& tolerance, TestDetails const& details) +{ + bool equal = ArrayAreClose(expected, actual, count, tolerance); + + if (!equal) + { + UnitTest::MemoryOutStream stream; + + stream << "Expected [ "; + for (int expectedIndex = 0; expectedIndex < count; ++expectedIndex) + stream << expected[expectedIndex] << " "; + stream << "] +/- " << tolerance << " but was [ "; + + for (int actualIndex = 0; actualIndex < count; ++actualIndex) + stream << actual[actualIndex] << " "; + stream << "]"; + + results.OnTestFailure(details, stream.GetText()); + } +} + +template< typename Expected, typename Actual, typename Tolerance > +void CheckArray2DClose(TestResults& results, Expected const& expected, Actual const& actual, + int const rows, int const columns, Tolerance const& tolerance, TestDetails const& details) +{ + bool equal = true; + for (int i = 0; i < rows; ++i) + equal &= ArrayAreClose(expected[i], actual[i], columns, tolerance); + + if (!equal) + { + UnitTest::MemoryOutStream stream; + + stream << "Expected [ "; + + for (int expectedRow = 0; expectedRow < rows; ++expectedRow) + { + stream << "[ "; + for (int expectedColumn = 0; expectedColumn < columns; ++expectedColumn) + stream << expected[expectedRow][expectedColumn] << " "; + stream << "] "; + } + + stream << "] +/- " << tolerance << " but was [ "; + + for (int actualRow = 0; actualRow < rows; ++actualRow) + { + stream << "[ "; + for (int actualColumn = 0; actualColumn < columns; ++actualColumn) + stream << actual[actualRow][actualColumn] << " "; + stream << "] "; + } + + stream << "]"; + + results.OnTestFailure(details, stream.GetText()); + } +} + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/Config.h icedtea-web-1.4/tests/UnitTest++/src/Config.h --- icedtea-web-1.3.2/tests/UnitTest++/src/Config.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/Config.h 2013-05-03 19:08:24.536516526 +0000 @@ -0,0 +1,31 @@ +#ifndef UNITTEST_CONFIG_H +#define UNITTEST_CONFIG_H + +// Standard defines documented here: http://predef.sourceforge.net + +#if defined(_MSC_VER) + #pragma warning(disable:4127) // conditional expression is constant + #pragma warning(disable:4702) // unreachable code + #pragma warning(disable:4722) // destructor never returns, potential memory leak + + #if (_MSC_VER == 1200) // VC6 + #pragma warning(disable:4786) + #pragma warning(disable:4290) + #endif +#endif + +#if defined(unix) || defined(__unix__) || defined(__unix) || defined(linux) || \ + defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) + #define UNITTEST_POSIX +#endif + +#if defined(__MINGW32__) + #define UNITTEST_MINGW +#endif + +// by default, MemoryOutStream is implemented in terms of std::ostringstream, which can be expensive. +// uncomment this line to use the custom MemoryOutStream (no deps on std::ostringstream). + +//#define UNITTEST_USE_CUSTOM_STREAMS + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/CurrentTest.cpp icedtea-web-1.4/tests/UnitTest++/src/CurrentTest.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/CurrentTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/CurrentTest.cpp 2013-05-03 19:08:24.537516513 +0000 @@ -0,0 +1,18 @@ +#include "CurrentTest.h" +#include + +namespace UnitTest { + +TestResults*& CurrentTest::Results() +{ + static TestResults* testResults = NULL; + return testResults; +} + +const TestDetails*& CurrentTest::Details() +{ + static const TestDetails* testDetails = NULL; + return testDetails; +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/CurrentTest.h icedtea-web-1.4/tests/UnitTest++/src/CurrentTest.h --- icedtea-web-1.3.2/tests/UnitTest++/src/CurrentTest.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/CurrentTest.h 2013-05-03 19:08:24.537516513 +0000 @@ -0,0 +1,17 @@ +#ifndef UNITTEST_CURRENTTESTRESULTS_H +#define UNITTEST_CURRENTTESTRESULTS_H + +namespace UnitTest { + +class TestResults; +class TestDetails; + +namespace CurrentTest +{ + TestResults*& Results(); + const TestDetails*& Details(); +} + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/DeferredTestReporter.cpp icedtea-web-1.4/tests/UnitTest++/src/DeferredTestReporter.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/DeferredTestReporter.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/DeferredTestReporter.cpp 2013-05-03 19:08:24.538516500 +0000 @@ -0,0 +1,29 @@ +#include "DeferredTestReporter.h" +#include "TestDetails.h" +#include "Config.h" + +using namespace UnitTest; + +void DeferredTestReporter::ReportTestStart(TestDetails const& details) +{ + m_results.push_back(DeferredTestResult(details.suiteName, details.testName)); +} + +void DeferredTestReporter::ReportFailure(TestDetails const& details, char const* failure) +{ + DeferredTestResult& r = m_results.back(); + r.failed = true; + r.failures.push_back(DeferredTestResult::Failure(details.lineNumber, failure)); + r.failureFile = details.filename; +} + +void DeferredTestReporter::ReportTestFinish(TestDetails const&, float secondsElapsed) +{ + DeferredTestResult& r = m_results.back(); + r.timeElapsed = secondsElapsed; +} + +DeferredTestReporter::DeferredTestResultList& DeferredTestReporter::GetResults() +{ + return m_results; +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/DeferredTestReporter.h icedtea-web-1.4/tests/UnitTest++/src/DeferredTestReporter.h --- icedtea-web-1.3.2/tests/UnitTest++/src/DeferredTestReporter.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/DeferredTestReporter.h 2013-05-03 19:08:24.538516500 +0000 @@ -0,0 +1,28 @@ +#ifndef UNITTEST_DEFERREDTESTREPORTER_H +#define UNITTEST_DEFERREDTESTREPORTER_H + +#include "TestReporter.h" +#include "DeferredTestResult.h" + +#include + +namespace UnitTest +{ + +class DeferredTestReporter : public TestReporter +{ +public: + virtual void ReportTestStart(TestDetails const& details); + virtual void ReportFailure(TestDetails const& details, char const* failure); + virtual void ReportTestFinish(TestDetails const& details, float secondsElapsed); + + typedef std::vector< DeferredTestResult > DeferredTestResultList; + DeferredTestResultList& GetResults(); + +private: + DeferredTestResultList m_results; +}; + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/DeferredTestResult.cpp icedtea-web-1.4/tests/UnitTest++/src/DeferredTestResult.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/DeferredTestResult.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/DeferredTestResult.cpp 2013-05-03 19:08:24.538516500 +0000 @@ -0,0 +1,25 @@ +#include "DeferredTestResult.h" +#include "Config.h" + +namespace UnitTest +{ + +DeferredTestResult::DeferredTestResult() + : suiteName("") + , testName("") + , failureFile("") + , timeElapsed(0.0f) + , failed(false) +{ +} + +DeferredTestResult::DeferredTestResult(char const* suite, char const* test) + : suiteName(suite) + , testName(test) + , failureFile("") + , timeElapsed(0.0f) + , failed(false) +{ +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/DeferredTestResult.h icedtea-web-1.4/tests/UnitTest++/src/DeferredTestResult.h --- icedtea-web-1.3.2/tests/UnitTest++/src/DeferredTestResult.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/DeferredTestResult.h 2013-05-03 19:08:24.539516487 +0000 @@ -0,0 +1,29 @@ +#ifndef UNITTEST_DEFERREDTESTRESULT_H +#define UNITTEST_DEFERREDTESTRESULT_H + +#include +#include + +namespace UnitTest +{ + +struct DeferredTestResult +{ + DeferredTestResult(); + DeferredTestResult(char const* suite, char const* test); + + std::string suiteName; + std::string testName; + std::string failureFile; + + typedef std::pair< int, std::string > Failure; + typedef std::vector< Failure > FailureVec; + FailureVec failures; + + float timeElapsed; + bool failed; +}; + +} + +#endif //UNITTEST_DEFERREDTESTRESULT_H diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/ExecuteTest.h icedtea-web-1.4/tests/UnitTest++/src/ExecuteTest.h --- icedtea-web-1.3.2/tests/UnitTest++/src/ExecuteTest.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/ExecuteTest.h 2013-05-03 19:08:24.539516487 +0000 @@ -0,0 +1,46 @@ +#ifndef UNITTEST_EXECUTE_TEST_H +#define UNITTEST_EXECUTE_TEST_H + +#include "TestDetails.h" +#include "MemoryOutStream.h" +#include "AssertException.h" +#include "CurrentTest.h" + +#ifdef UNITTEST_POSIX + #include "Posix/SignalTranslator.h" +#endif + +namespace UnitTest { + +template< typename T > +void ExecuteTest(T& testObject, TestDetails const& details) +{ + CurrentTest::Details() = &details; + + try + { +#ifdef UNITTEST_POSIX + UNITTEST_THROW_SIGNALS +#endif + testObject.RunImpl(); + } + catch (AssertException const& e) + { + CurrentTest::Results()->OnTestFailure( + TestDetails(details.testName, details.suiteName, e.Filename(), e.LineNumber()), e.what()); + } + catch (std::exception const& e) + { + MemoryOutStream stream; + stream << "Unhandled exception: " << e.what(); + CurrentTest::Results()->OnTestFailure(details, stream.GetText()); + } + catch (...) + { + CurrentTest::Results()->OnTestFailure(details, "Unhandled exception: Crash!"); + } +} + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/MemoryOutStream.cpp icedtea-web-1.4/tests/UnitTest++/src/MemoryOutStream.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/MemoryOutStream.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/MemoryOutStream.cpp 2013-05-03 19:08:24.539516487 +0000 @@ -0,0 +1,149 @@ +#include "MemoryOutStream.h" + +#ifndef UNITTEST_USE_CUSTOM_STREAMS + + +namespace UnitTest { + +char const* MemoryOutStream::GetText() const +{ + m_text = this->str(); + return m_text.c_str(); +} + + +} + + +#else + + +#include +#include + +namespace UnitTest { + +namespace { + +template +void FormatToStream(MemoryOutStream& stream, char const* format, ValueType const& value) +{ + using namespace std; + + char txt[32]; + sprintf(txt, format, value); + stream << txt; +} + +int RoundUpToMultipleOfPow2Number (int n, int pow2Number) +{ + return (n + (pow2Number - 1)) & ~(pow2Number - 1); +} + +} + + +MemoryOutStream::MemoryOutStream(int const size) + : m_capacity (0) + , m_buffer (0) + +{ + GrowBuffer(size); +} + +MemoryOutStream::~MemoryOutStream() +{ + delete [] m_buffer; +} + +char const* MemoryOutStream::GetText() const +{ + return m_buffer; +} + +MemoryOutStream& MemoryOutStream::operator << (char const* txt) +{ + using namespace std; + + int const bytesLeft = m_capacity - (int)strlen(m_buffer); + int const bytesRequired = (int)strlen(txt) + 1; + + if (bytesRequired > bytesLeft) + { + int const requiredCapacity = bytesRequired + m_capacity - bytesLeft; + GrowBuffer(requiredCapacity); + } + + strcat(m_buffer, txt); + return *this; +} + +MemoryOutStream& MemoryOutStream::operator << (int const n) +{ + FormatToStream(*this, "%i", n); + return *this; +} + +MemoryOutStream& MemoryOutStream::operator << (long const n) +{ + FormatToStream(*this, "%li", n); + return *this; +} + +MemoryOutStream& MemoryOutStream::operator << (unsigned long const n) +{ + FormatToStream(*this, "%lu", n); + return *this; +} + +MemoryOutStream& MemoryOutStream::operator << (float const f) +{ + FormatToStream(*this, "%ff", f); + return *this; +} + +MemoryOutStream& MemoryOutStream::operator << (void const* p) +{ + FormatToStream(*this, "%p", p); + return *this; +} + +MemoryOutStream& MemoryOutStream::operator << (unsigned int const s) +{ + FormatToStream(*this, "%u", s); + return *this; +} + +MemoryOutStream& MemoryOutStream::operator <<(double const d) +{ + FormatToStream(*this, "%f", d); + return *this; +} + +int MemoryOutStream::GetCapacity() const +{ + return m_capacity; +} + + +void MemoryOutStream::GrowBuffer(int const desiredCapacity) +{ + int const newCapacity = RoundUpToMultipleOfPow2Number(desiredCapacity, GROW_CHUNK_SIZE); + + using namespace std; + + char* buffer = new char[newCapacity]; + if (m_buffer) + strcpy(buffer, m_buffer); + else + strcpy(buffer, ""); + + delete [] m_buffer; + m_buffer = buffer; + m_capacity = newCapacity; +} + +} + + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/MemoryOutStream.h icedtea-web-1.4/tests/UnitTest++/src/MemoryOutStream.h --- icedtea-web-1.3.2/tests/UnitTest++/src/MemoryOutStream.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/MemoryOutStream.h 2013-05-03 19:08:24.539516487 +0000 @@ -0,0 +1,67 @@ +#ifndef UNITTEST_MEMORYOUTSTREAM_H +#define UNITTEST_MEMORYOUTSTREAM_H + +#include "Config.h" + +#ifndef UNITTEST_USE_CUSTOM_STREAMS + +#include + +namespace UnitTest +{ + +class MemoryOutStream : public std::ostringstream +{ +public: + MemoryOutStream() {} + char const* GetText() const; + +private: + MemoryOutStream(MemoryOutStream const&); + void operator =(MemoryOutStream const&); + + mutable std::string m_text; +}; + +} + +#else + +#include + +namespace UnitTest +{ + +class MemoryOutStream +{ +public: + explicit MemoryOutStream(int const size = 256); + ~MemoryOutStream(); + + char const* GetText() const; + + MemoryOutStream& operator << (char const* txt); + MemoryOutStream& operator << (int n); + MemoryOutStream& operator << (long n); + MemoryOutStream& operator << (unsigned long n); + MemoryOutStream& operator << (float f); + MemoryOutStream& operator << (double d); + MemoryOutStream& operator << (void const* p); + MemoryOutStream& operator << (unsigned int s); + + enum { GROW_CHUNK_SIZE = 32 }; + int GetCapacity() const; + +private: + void operator= (MemoryOutStream const&); + void GrowBuffer(int capacity); + + int m_capacity; + char* m_buffer; +}; + +} + +#endif + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/Posix/SignalTranslator.cpp icedtea-web-1.4/tests/UnitTest++/src/Posix/SignalTranslator.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/Posix/SignalTranslator.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/Posix/SignalTranslator.cpp 2013-05-03 19:08:24.540516475 +0000 @@ -0,0 +1,46 @@ +#include "SignalTranslator.h" + +namespace UnitTest { + +sigjmp_buf* SignalTranslator::s_jumpTarget = 0; + +namespace { + +void SignalHandler(int sig) +{ + siglongjmp(*SignalTranslator::s_jumpTarget, sig ); +} + +} + + +SignalTranslator::SignalTranslator() +{ + m_oldJumpTarget = s_jumpTarget; + s_jumpTarget = &m_currentJumpTarget; + + struct sigaction action; + action.sa_flags = 0; + action.sa_handler = SignalHandler; + sigemptyset( &action.sa_mask ); + + sigaction( SIGSEGV, &action, &m_old_SIGSEGV_action ); + sigaction( SIGFPE , &action, &m_old_SIGFPE_action ); + sigaction( SIGTRAP, &action, &m_old_SIGTRAP_action ); + sigaction( SIGBUS , &action, &m_old_SIGBUS_action ); + sigaction( SIGILL , &action, &m_old_SIGBUS_action ); +} + +SignalTranslator::~SignalTranslator() +{ + sigaction( SIGILL , &m_old_SIGBUS_action , 0 ); + sigaction( SIGBUS , &m_old_SIGBUS_action , 0 ); + sigaction( SIGTRAP, &m_old_SIGTRAP_action, 0 ); + sigaction( SIGFPE , &m_old_SIGFPE_action , 0 ); + sigaction( SIGSEGV, &m_old_SIGSEGV_action, 0 ); + + s_jumpTarget = m_oldJumpTarget; +} + + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/Posix/SignalTranslator.h icedtea-web-1.4/tests/UnitTest++/src/Posix/SignalTranslator.h --- icedtea-web-1.3.2/tests/UnitTest++/src/Posix/SignalTranslator.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/Posix/SignalTranslator.h 2013-05-03 19:08:24.540516475 +0000 @@ -0,0 +1,42 @@ +#ifndef UNITTEST_SIGNALTRANSLATOR_H +#define UNITTEST_SIGNALTRANSLATOR_H + +#include +#include + +namespace UnitTest { + +class SignalTranslator +{ +public: + SignalTranslator(); + ~SignalTranslator(); + + static sigjmp_buf* s_jumpTarget; + +private: + sigjmp_buf m_currentJumpTarget; + sigjmp_buf* m_oldJumpTarget; + + struct sigaction m_old_SIGFPE_action; + struct sigaction m_old_SIGTRAP_action; + struct sigaction m_old_SIGSEGV_action; + struct sigaction m_old_SIGBUS_action; + struct sigaction m_old_SIGABRT_action; + struct sigaction m_old_SIGALRM_action; +}; + +#if !defined (__GNUC__) + #define UNITTEST_EXTENSION +#else + #define UNITTEST_EXTENSION __extension__ +#endif + +#define UNITTEST_THROW_SIGNALS \ + UnitTest::SignalTranslator sig; \ + if (UNITTEST_EXTENSION sigsetjmp(*UnitTest::SignalTranslator::s_jumpTarget, 1) != 0) \ + throw ("Unhandled system exception"); + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/Posix/TimeHelpers.cpp icedtea-web-1.4/tests/UnitTest++/src/Posix/TimeHelpers.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/Posix/TimeHelpers.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/Posix/TimeHelpers.cpp 2013-05-03 19:08:24.541516463 +0000 @@ -0,0 +1,33 @@ +#include "TimeHelpers.h" +#include + +namespace UnitTest { + +Timer::Timer() +{ + m_startTime.tv_sec = 0; + m_startTime.tv_usec = 0; +} + +void Timer::Start() +{ + gettimeofday(&m_startTime, 0); +} + + +int Timer::GetTimeInMs() const +{ + struct timeval currentTime; + gettimeofday(¤tTime, 0); + int const dsecs = currentTime.tv_sec - m_startTime.tv_sec; + int const dus = currentTime.tv_usec - m_startTime.tv_usec; + return dsecs*1000 + dus/1000; +} + + +void TimeHelpers::SleepMs (int ms) +{ + usleep(ms * 1000); +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/Posix/TimeHelpers.h icedtea-web-1.4/tests/UnitTest++/src/Posix/TimeHelpers.h --- icedtea-web-1.3.2/tests/UnitTest++/src/Posix/TimeHelpers.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/Posix/TimeHelpers.h 2013-05-03 19:08:24.541516463 +0000 @@ -0,0 +1,28 @@ +#ifndef UNITTEST_TIMEHELPERS_H +#define UNITTEST_TIMEHELPERS_H + +#include + +namespace UnitTest { + +class Timer +{ +public: + Timer(); + void Start(); + int GetTimeInMs() const; + +private: + struct timeval m_startTime; +}; + + +namespace TimeHelpers +{ +void SleepMs (int ms); +} + + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/ReportAssert.cpp icedtea-web-1.4/tests/UnitTest++/src/ReportAssert.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/ReportAssert.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/ReportAssert.cpp 2013-05-03 19:08:24.541516463 +0000 @@ -0,0 +1,10 @@ +#include "AssertException.h" + +namespace UnitTest { + +void ReportAssert(char const* description, char const* filename, int lineNumber) +{ + throw AssertException(description, filename, lineNumber); +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/ReportAssert.h icedtea-web-1.4/tests/UnitTest++/src/ReportAssert.h --- icedtea-web-1.3.2/tests/UnitTest++/src/ReportAssert.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/ReportAssert.h 2013-05-03 19:08:24.541516463 +0000 @@ -0,0 +1,10 @@ +#ifndef UNITTEST_ASSERT_H +#define UNITTEST_ASSERT_H + +namespace UnitTest { + +void ReportAssert(char const* description, char const* filename, int lineNumber); + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/Test.cpp icedtea-web-1.4/tests/UnitTest++/src/Test.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/Test.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/Test.cpp 2013-05-03 19:08:24.542516451 +0000 @@ -0,0 +1,41 @@ +#include "Config.h" +#include "Test.h" +#include "TestList.h" +#include "TestResults.h" +#include "AssertException.h" +#include "MemoryOutStream.h" +#include "ExecuteTest.h" + +#ifdef UNITTEST_POSIX + #include "Posix/SignalTranslator.h" +#endif + +namespace UnitTest { + +TestList& Test::GetTestList() +{ + static TestList s_list; + return s_list; +} + +Test::Test(char const* testName, char const* suiteName, char const* filename, int lineNumber) + : m_details(testName, suiteName, filename, lineNumber) + , next(0) + , m_timeConstraintExempt(false) +{ +} + +Test::~Test() +{ +} + +void Test::Run() +{ + ExecuteTest(*this, m_details); +} + +void Test::RunImpl() const +{ +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestDetails.cpp icedtea-web-1.4/tests/UnitTest++/src/TestDetails.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/TestDetails.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestDetails.cpp 2013-05-03 19:08:24.542516451 +0000 @@ -0,0 +1,22 @@ +#include "TestDetails.h" + +namespace UnitTest { + +TestDetails::TestDetails(char const* testName_, char const* suiteName_, char const* filename_, int lineNumber_) + : suiteName(suiteName_) + , testName(testName_) + , filename(filename_) + , lineNumber(lineNumber_) +{ +} + +TestDetails::TestDetails(const TestDetails& details, int lineNumber_) + : suiteName(details.suiteName) + , testName(details.testName) + , filename(details.filename) + , lineNumber(lineNumber_) +{ +} + + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestDetails.h icedtea-web-1.4/tests/UnitTest++/src/TestDetails.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TestDetails.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestDetails.h 2013-05-03 19:08:24.543516439 +0000 @@ -0,0 +1,24 @@ +#ifndef UNITTEST_TESTDETAILS_H +#define UNITTEST_TESTDETAILS_H + +namespace UnitTest { + +class TestDetails +{ +public: + TestDetails(char const* testName, char const* suiteName, char const* filename, int lineNumber); + TestDetails(const TestDetails& details, int lineNumber); + + char const* const suiteName; + char const* const testName; + char const* const filename; + int const lineNumber; + + TestDetails(TestDetails const&); // Why is it public? --> http://gcc.gnu.org/bugs.html#cxx_rvalbind +private: + TestDetails& operator=(TestDetails const&); +}; + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/Test.h icedtea-web-1.4/tests/UnitTest++/src/Test.h --- icedtea-web-1.3.2/tests/UnitTest++/src/Test.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/Test.h 2013-05-03 19:08:24.542516451 +0000 @@ -0,0 +1,34 @@ +#ifndef UNITTEST_TEST_H +#define UNITTEST_TEST_H + +#include "TestDetails.h" + +namespace UnitTest { + +class TestResults; +class TestList; + +class Test +{ +public: + explicit Test(char const* testName, char const* suiteName = "DefaultSuite", char const* filename = "", int lineNumber = 0); + virtual ~Test(); + void Run(); + + TestDetails const m_details; + Test* next; + mutable bool m_timeConstraintExempt; + + static TestList& GetTestList(); + + virtual void RunImpl() const; + +private: + Test(Test const&); + Test& operator =(Test const&); +}; + + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestList.cpp icedtea-web-1.4/tests/UnitTest++/src/TestList.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/TestList.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestList.cpp 2013-05-03 19:08:24.543516439 +0000 @@ -0,0 +1,39 @@ +#include "TestList.h" +#include "Test.h" + +#include + +namespace UnitTest { + +TestList::TestList() + : m_head(0) + , m_tail(0) +{ +} + +void TestList::Add(Test* test) +{ + if (m_tail == 0) + { + assert(m_head == 0); + m_head = test; + m_tail = test; + } + else + { + m_tail->next = test; + m_tail = test; + } +} + +Test* TestList::GetHead() const +{ + return m_head; +} + +ListAdder::ListAdder(TestList& list, Test* test) +{ + list.Add(test); +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestList.h icedtea-web-1.4/tests/UnitTest++/src/TestList.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TestList.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestList.h 2013-05-03 19:08:24.543516439 +0000 @@ -0,0 +1,32 @@ +#ifndef UNITTEST_TESTLIST_H +#define UNITTEST_TESTLIST_H + + +namespace UnitTest { + +class Test; + +class TestList +{ +public: + TestList(); + void Add (Test* test); + + Test* GetHead() const; + +private: + Test* m_head; + Test* m_tail; +}; + + +class ListAdder +{ +public: + ListAdder(TestList& list, Test* test); +}; + +} + + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestMacros.h icedtea-web-1.4/tests/UnitTest++/src/TestMacros.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TestMacros.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestMacros.h 2013-05-03 19:08:24.544516427 +0000 @@ -0,0 +1,113 @@ +#ifndef UNITTEST_TESTMACROS_H +#define UNITTEST_TESTMACROS_H + +#include "Config.h" +#include "ExecuteTest.h" +#include "AssertException.h" +#include "TestDetails.h" +#include "MemoryOutStream.h" + +#ifndef UNITTEST_POSIX + #define UNITTEST_THROW_SIGNALS +#else + #include "Posix/SignalTranslator.h" +#endif + +#ifdef TEST + #error UnitTest++ redefines TEST +#endif + +#ifdef TEST_EX + #error UnitTest++ redefines TEST_EX +#endif + +#ifdef TEST_FIXTURE_EX + #error UnitTest++ redefines TEST_FIXTURE_EX +#endif + +#define SUITE(Name) \ + namespace Suite##Name { \ + namespace UnitTestSuite { \ + inline char const* GetSuiteName () { \ + return #Name ; \ + } \ + } \ + } \ + namespace Suite##Name + +#define TEST_EX(Name, List) \ + class Test##Name : public UnitTest::Test \ + { \ + public: \ + Test##Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \ + private: \ + virtual void RunImpl() const; \ + } test##Name##Instance; \ + \ + UnitTest::ListAdder adder##Name (List, &test##Name##Instance); \ + \ + void Test##Name::RunImpl() const + + +#define TEST(Name) TEST_EX(Name, UnitTest::Test::GetTestList()) + + +#define TEST_FIXTURE_EX(Fixture, Name, List) \ + class Fixture##Name##Helper : public Fixture \ + { \ + public: \ + explicit Fixture##Name##Helper(UnitTest::TestDetails const& details) : m_details(details) {} \ + void RunImpl(); \ + UnitTest::TestDetails const& m_details; \ + private: \ + Fixture##Name##Helper(Fixture##Name##Helper const&); \ + Fixture##Name##Helper& operator =(Fixture##Name##Helper const&); \ + }; \ + \ + class Test##Fixture##Name : public UnitTest::Test \ + { \ + public: \ + Test##Fixture##Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \ + private: \ + virtual void RunImpl() const; \ + } test##Fixture##Name##Instance; \ + \ + UnitTest::ListAdder adder##Fixture##Name (List, &test##Fixture##Name##Instance); \ + \ + void Test##Fixture##Name::RunImpl() const \ + { \ + bool ctorOk = false; \ + try { \ + Fixture##Name##Helper fixtureHelper(m_details); \ + ctorOk = true; \ + UnitTest::ExecuteTest(fixtureHelper, m_details); \ + } \ + catch (UnitTest::AssertException const& e) \ + { \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(m_details.testName, m_details.suiteName, e.Filename(), e.LineNumber()), e.what()); \ + } \ + catch (std::exception const& e) \ + { \ + UnitTest::MemoryOutStream stream; \ + stream << "Unhandled exception: " << e.what(); \ + UnitTest::CurrentTest::Results()->OnTestFailure(m_details, stream.GetText()); \ + } \ + catch (...) { \ + if (ctorOk) \ + { \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \ + "Unhandled exception while destroying fixture " #Fixture); \ + } \ + else \ + { \ + UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \ + "Unhandled exception while constructing fixture " #Fixture); \ + } \ + } \ + } \ + void Fixture##Name##Helper::RunImpl() + +#define TEST_FIXTURE(Fixture,Name) TEST_FIXTURE_EX(Fixture, Name, UnitTest::Test::GetTestList()) + + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestReporter.cpp icedtea-web-1.4/tests/UnitTest++/src/TestReporter.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/TestReporter.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestReporter.cpp 2013-05-03 19:08:24.544516427 +0000 @@ -0,0 +1,10 @@ +#include "TestReporter.h" + +namespace UnitTest { + + +TestReporter::~TestReporter() +{ +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestReporter.h icedtea-web-1.4/tests/UnitTest++/src/TestReporter.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TestReporter.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestReporter.h 2013-05-03 19:08:24.544516427 +0000 @@ -0,0 +1,20 @@ +#ifndef UNITTEST_TESTREPORTER_H +#define UNITTEST_TESTREPORTER_H + +namespace UnitTest { + +class TestDetails; + +class TestReporter +{ +public: + virtual ~TestReporter(); + + virtual void ReportTestStart(TestDetails const& test) = 0; + virtual void ReportFailure(TestDetails const& test, char const* failure) = 0; + virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed) = 0; + virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed) = 0; +}; + +} +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestReporterStdout.cpp icedtea-web-1.4/tests/UnitTest++/src/TestReporterStdout.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/TestReporterStdout.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestReporterStdout.cpp 2013-05-03 19:08:24.544516427 +0000 @@ -0,0 +1,41 @@ +#include "TestReporterStdout.h" +#include + +#include "TestDetails.h" + +namespace UnitTest { + +void TestReporterStdout::ReportFailure(TestDetails const& details, char const* failure) +{ +#if defined(__APPLE__) || defined(__GNUG__) + char const* const errorFormat = "%s:%d: error: Failure in %s: %s\n"; +#else + char const* const errorFormat = "%s(%d): error: Failure in %s: %s\n"; +#endif + + using namespace std; + printf(errorFormat, details.filename, details.lineNumber, details.testName, failure); +} + +void TestReporterStdout::ReportTestStart(TestDetails const& /*test*/) +{ +} + +void TestReporterStdout::ReportTestFinish(TestDetails const& /*test*/, float) +{ +} + +void TestReporterStdout::ReportSummary(int const totalTestCount, int const failedTestCount, + int const failureCount, float secondsElapsed) +{ + using namespace std; + + if (failureCount > 0) + printf("FAILURE: %d out of %d tests failed (%d failures).\n", failedTestCount, totalTestCount, failureCount); + else + printf("Success: %d tests passed.\n", totalTestCount); + + printf("Test time: %.2f seconds.\n", secondsElapsed); +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestReporterStdout.h icedtea-web-1.4/tests/UnitTest++/src/TestReporterStdout.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TestReporterStdout.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestReporterStdout.h 2013-05-03 19:08:24.545516414 +0000 @@ -0,0 +1,19 @@ +#ifndef UNITTEST_TESTREPORTERSTDOUT_H +#define UNITTEST_TESTREPORTERSTDOUT_H + +#include "TestReporter.h" + +namespace UnitTest { + +class TestReporterStdout : public TestReporter +{ +private: + virtual void ReportTestStart(TestDetails const& test); + virtual void ReportFailure(TestDetails const& test, char const* failure); + virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed); + virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); +}; + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestResults.cpp icedtea-web-1.4/tests/UnitTest++/src/TestResults.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/TestResults.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestResults.cpp 2013-05-03 19:08:24.545516414 +0000 @@ -0,0 +1,60 @@ +#include "TestResults.h" +#include "TestReporter.h" + +#include "TestDetails.h" + +namespace UnitTest { + +TestResults::TestResults(TestReporter* testReporter) + : m_testReporter(testReporter) + , m_totalTestCount(0) + , m_failedTestCount(0) + , m_failureCount(0) + , m_currentTestFailed(false) +{ +} + +void TestResults::OnTestStart(TestDetails const& test) +{ + ++m_totalTestCount; + m_currentTestFailed = false; + if (m_testReporter) + m_testReporter->ReportTestStart(test); +} + +void TestResults::OnTestFailure(TestDetails const& test, char const* failure) +{ + ++m_failureCount; + if (!m_currentTestFailed) + { + ++m_failedTestCount; + m_currentTestFailed = true; + } + + if (m_testReporter) + m_testReporter->ReportFailure(test, failure); +} + +void TestResults::OnTestFinish(TestDetails const& test, float secondsElapsed) +{ + if (m_testReporter) + m_testReporter->ReportTestFinish(test, secondsElapsed); +} + +int TestResults::GetTotalTestCount() const +{ + return m_totalTestCount; +} + +int TestResults::GetFailedTestCount() const +{ + return m_failedTestCount; +} + +int TestResults::GetFailureCount() const +{ + return m_failureCount; +} + + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestResults.h icedtea-web-1.4/tests/UnitTest++/src/TestResults.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TestResults.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestResults.h 2013-05-03 19:08:24.545516414 +0000 @@ -0,0 +1,36 @@ +#ifndef UNITTEST_TESTRESULTS_H +#define UNITTEST_TESTRESULTS_H + +namespace UnitTest { + +class TestReporter; +class TestDetails; + +class TestResults +{ +public: + explicit TestResults(TestReporter* reporter = 0); + + void OnTestStart(TestDetails const& test); + void OnTestFailure(TestDetails const& test, char const* failure); + void OnTestFinish(TestDetails const& test, float secondsElapsed); + + int GetTotalTestCount() const; + int GetFailedTestCount() const; + int GetFailureCount() const; + +private: + TestReporter* m_testReporter; + int m_totalTestCount; + int m_failedTestCount; + int m_failureCount; + + bool m_currentTestFailed; + + TestResults(TestResults const&); + TestResults& operator =(TestResults const&); +}; + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestRunner.cpp icedtea-web-1.4/tests/UnitTest++/src/TestRunner.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/TestRunner.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestRunner.cpp 2013-05-03 19:08:24.546516401 +0000 @@ -0,0 +1,76 @@ +#include "TestRunner.h" +#include "TestResults.h" +#include "TestReporter.h" +#include "TestReporterStdout.h" +#include "TimeHelpers.h" +#include "MemoryOutStream.h" + +#include + + +namespace UnitTest { + +int RunAllTests() +{ + TestReporterStdout reporter; + TestRunner runner(reporter); + return runner.RunTestsIf(Test::GetTestList(), NULL, True(), 0); +} + + +TestRunner::TestRunner(TestReporter& reporter) + : m_reporter(&reporter) + , m_result(new TestResults(&reporter)) + , m_timer(new Timer) +{ + m_timer->Start(); +} + +TestRunner::~TestRunner() +{ + delete m_result; + delete m_timer; +} + +int TestRunner::Finish() const +{ + float const secondsElapsed = m_timer->GetTimeInMs() / 1000.0f; + m_reporter->ReportSummary(m_result->GetTotalTestCount(), + m_result->GetFailedTestCount(), + m_result->GetFailureCount(), + secondsElapsed); + + return m_result->GetFailureCount(); +} + +bool TestRunner::IsTestInSuite(const Test* const curTest, char const* suiteName) const +{ + using namespace std; + return (suiteName == NULL) || !strcmp(curTest->m_details.suiteName, suiteName); +} + +void TestRunner::RunTest(TestResults* const result, Test* const curTest, int const maxTestTimeInMs) const +{ + CurrentTest::Results() = result; + + Timer testTimer; + testTimer.Start(); + + result->OnTestStart(curTest->m_details); + + curTest->Run(); + + int const testTimeInMs = testTimer.GetTimeInMs(); + if (maxTestTimeInMs > 0 && testTimeInMs > maxTestTimeInMs && !curTest->m_timeConstraintExempt) + { + MemoryOutStream stream; + stream << "Global time constraint failed. Expected under " << maxTestTimeInMs << + "ms but took " << testTimeInMs << "ms."; + + result->OnTestFailure(curTest->m_details, stream.GetText()); + } + + result->OnTestFinish(curTest->m_details, testTimeInMs/1000.0f); +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestRunner.h icedtea-web-1.4/tests/UnitTest++/src/TestRunner.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TestRunner.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestRunner.h 2013-05-03 19:08:24.546516401 +0000 @@ -0,0 +1,61 @@ +#ifndef UNITTEST_TESTRUNNER_H +#define UNITTEST_TESTRUNNER_H + +#include "Test.h" +#include "TestList.h" +#include "CurrentTest.h" + +namespace UnitTest { + +class TestReporter; +class TestResults; +class Timer; + +int RunAllTests(); + +struct True +{ + bool operator()(const Test* const) const + { + return true; + } +}; + +class TestRunner +{ +public: + explicit TestRunner(TestReporter& reporter); + ~TestRunner(); + + template + int RunTestsIf(TestList const& list, char const* suiteName, + const Predicate& predicate, int maxTestTimeInMs) const + { + Test* curTest = list.GetHead(); + + while (curTest != 0) + { + if (IsTestInSuite(curTest,suiteName) && predicate(curTest)) + { + RunTest(m_result, curTest, maxTestTimeInMs); + } + + curTest = curTest->next; + } + + return Finish(); + } + +private: + TestReporter* m_reporter; + TestResults* m_result; + Timer* m_timer; + + int Finish() const; + bool IsTestInSuite(const Test* const curTest, char const* suiteName) const; + void RunTest(TestResults* const result, Test* const curTest, int const maxTestTimeInMs) const; +}; + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TestSuite.h icedtea-web-1.4/tests/UnitTest++/src/TestSuite.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TestSuite.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TestSuite.h 2013-05-03 19:08:24.546516401 +0000 @@ -0,0 +1,14 @@ +#ifndef UNITTEST_TESTSUITE_H +#define UNITTEST_TESTSUITE_H + +namespace UnitTestSuite { + + inline char const* GetSuiteName () + { + return "DefaultSuite"; + } + +} + +#endif + diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TimeConstraint.cpp icedtea-web-1.4/tests/UnitTest++/src/TimeConstraint.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/TimeConstraint.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TimeConstraint.cpp 2013-05-03 19:08:24.547516388 +0000 @@ -0,0 +1,29 @@ +#include "TimeConstraint.h" +#include "TestResults.h" +#include "MemoryOutStream.h" +#include "CurrentTest.h" + +namespace UnitTest { + + +TimeConstraint::TimeConstraint(int ms, TestDetails const& details) + : m_details(details) + , m_maxMs(ms) +{ + m_timer.Start(); +} + +TimeConstraint::~TimeConstraint() +{ + int const totalTimeInMs = m_timer.GetTimeInMs(); + if (totalTimeInMs > m_maxMs) + { + MemoryOutStream stream; + stream << "Time constraint failed. Expected to run test under " << m_maxMs << + "ms but took " << totalTimeInMs << "ms."; + + UnitTest::CurrentTest::Results()->OnTestFailure(m_details, stream.GetText()); + } +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TimeConstraint.h icedtea-web-1.4/tests/UnitTest++/src/TimeConstraint.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TimeConstraint.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TimeConstraint.h 2013-05-03 19:08:24.547516388 +0000 @@ -0,0 +1,33 @@ +#ifndef UNITTEST_TIMECONSTRAINT_H +#define UNITTEST_TIMECONSTRAINT_H + +#include "TimeHelpers.h" + +namespace UnitTest { + +class TestResults; +class TestDetails; + +class TimeConstraint +{ +public: + TimeConstraint(int ms, TestDetails const& details); + ~TimeConstraint(); + +private: + void operator=(TimeConstraint const&); + TimeConstraint(TimeConstraint const&); + + Timer m_timer; + TestDetails const& m_details; + int const m_maxMs; +}; + +#define UNITTEST_TIME_CONSTRAINT(ms) \ + UnitTest::TimeConstraint unitTest__timeConstraint__(ms, UnitTest::TestDetails(m_details, __LINE__)) + +#define UNITTEST_TIME_CONSTRAINT_EXEMPT() do { m_timeConstraintExempt = true; } while (0) + +} + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/TimeHelpers.h icedtea-web-1.4/tests/UnitTest++/src/TimeHelpers.h --- icedtea-web-1.3.2/tests/UnitTest++/src/TimeHelpers.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/TimeHelpers.h 2013-05-03 19:08:24.547516388 +0000 @@ -0,0 +1,7 @@ +#include "Config.h" + +#if defined UNITTEST_POSIX + #include "Posix/TimeHelpers.h" +#else + #include "Win32/TimeHelpers.h" +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/UnitTest++.h icedtea-web-1.4/tests/UnitTest++/src/UnitTest++.h --- icedtea-web-1.3.2/tests/UnitTest++/src/UnitTest++.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/UnitTest++.h 2013-05-03 19:08:24.548516375 +0000 @@ -0,0 +1,18 @@ +#ifndef UNITTESTCPP_H +#define UNITTESTCPP_H + +//lint -esym(1509,*Fixture) + +#include "Config.h" +#include "Test.h" +#include "TestList.h" +#include "TestSuite.h" +#include "TestResults.h" + +#include "TestMacros.h" + +#include "CheckMacros.h" +#include "TestRunner.h" +#include "TimeConstraint.h" + +#endif diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/XmlTestReporter.cpp icedtea-web-1.4/tests/UnitTest++/src/XmlTestReporter.cpp --- icedtea-web-1.3.2/tests/UnitTest++/src/XmlTestReporter.cpp 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/XmlTestReporter.cpp 2013-05-03 19:08:24.548516375 +0000 @@ -0,0 +1,127 @@ +#include "XmlTestReporter.h" +#include "Config.h" + +#include +#include +#include + +using std::string; +using std::ostringstream; +using std::ostream; + +namespace { + +void ReplaceChar(string& str, char c, string const& replacement) +{ + for (size_t pos = str.find(c); pos != string::npos; pos = str.find(c, pos + 1)) + str.replace(pos, 1, replacement); +} + +string XmlEscape(string const& value) +{ + string escaped = value; + + ReplaceChar(escaped, '&', "&"); + ReplaceChar(escaped, '<', "<"); + ReplaceChar(escaped, '>', ">"); + ReplaceChar(escaped, '\'', "'"); + ReplaceChar(escaped, '\"', """); + + return escaped; +} + +string BuildFailureMessage(string const& file, int line, string const& message) +{ + ostringstream failureMessage; + failureMessage << file << "(" << line << ") : " << message; + return failureMessage.str(); +} + +} + +namespace UnitTest { + +XmlTestReporter::XmlTestReporter(ostream& ostream) + : m_ostream(ostream) +{ +} + +void XmlTestReporter::ReportSummary(int totalTestCount, int failedTestCount, + int failureCount, float secondsElapsed) +{ + AddXmlElement(m_ostream, NULL); + + BeginResults(m_ostream, totalTestCount, failedTestCount, failureCount, secondsElapsed); + + DeferredTestResultList const& results = GetResults(); + for (DeferredTestResultList::const_iterator i = results.begin(); i != results.end(); ++i) + { + BeginTest(m_ostream, *i); + + if (i->failed) + AddFailure(m_ostream, *i); + + EndTest(m_ostream, *i); + } + + EndResults(m_ostream); +} + +void XmlTestReporter::AddXmlElement(ostream& os, char const* encoding) +{ + os << ""; +} + +void XmlTestReporter::BeginResults(std::ostream& os, int totalTestCount, int failedTestCount, + int failureCount, float secondsElapsed) +{ + os << ""; +} + +void XmlTestReporter::EndResults(std::ostream& os) +{ + os << ""; +} + +void XmlTestReporter::BeginTest(std::ostream& os, DeferredTestResult const& result) +{ + os << ""; + else + os << "/>"; +} + +void XmlTestReporter::AddFailure(std::ostream& os, DeferredTestResult const& result) +{ + os << ">"; // close element + + for (DeferredTestResult::FailureVec::const_iterator it = result.failures.begin(); + it != result.failures.end(); + ++it) + { + string const escapedMessage = XmlEscape(it->second); + string const message = BuildFailureMessage(result.failureFile, it->first, escapedMessage); + + os << ""; + } +} + +} diff -Nru icedtea-web-1.3.2/tests/UnitTest++/src/XmlTestReporter.h icedtea-web-1.4/tests/UnitTest++/src/XmlTestReporter.h --- icedtea-web-1.3.2/tests/UnitTest++/src/XmlTestReporter.h 1970-01-01 00:00:00.000000000 +0000 +++ icedtea-web-1.4/tests/UnitTest++/src/XmlTestReporter.h 2013-05-03 19:08:24.548516375 +0000 @@ -0,0 +1,34 @@ +#ifndef UNITTEST_XMLTESTREPORTER_H +#define UNITTEST_XMLTESTREPORTER_H + +#include "DeferredTestReporter.h" + +#include + +namespace UnitTest +{ + +class XmlTestReporter : public DeferredTestReporter +{ +public: + explicit XmlTestReporter(std::ostream& ostream); + + virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); + +private: + XmlTestReporter(XmlTestReporter const&); + XmlTestReporter& operator=(XmlTestReporter const&); + + void AddXmlElement(std::ostream& os, char const* encoding); + void BeginResults(std::ostream& os, int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); + void EndResults(std::ostream& os); + void BeginTest(std::ostream& os, DeferredTestResult const& result); + void AddFailure(std::ostream& os, DeferredTestResult const& result); + void EndTest(std::ostream& os, DeferredTestResult const& result); + + std::ostream& m_ostream; +}; + +} + +#endif