From bugzilla-daemon at icedtea.classpath.org Sun Jan 3 10:16:57 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Sun, 03 Jan 2016 10:16:57 +0000
Subject: [Bug 2732] Raise javadoc memory limits for CACAO on ppc64 again! (v2)
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2732
--- Comment #3 from James Le Cuirot ---
I've been told by a Gentoo developer that these hardcoded limits are no good
when you have -g in your CFLAGS. Perhaps something more dynamic is needed.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From ptisnovs at icedtea.classpath.org Mon Jan 4 10:01:29 2016
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Mon, 04 Jan 2016 10:01:29 +0000
Subject: /hg/gfx-test: Updated comments in the class HtmlStructureWriter.
Message-ID:
changeset 61cadaf2583d in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=61cadaf2583d
author: Pavel Tisnovsky
date: Mon Jan 04 11:04:54 2016 +0100
Updated comments in the class HtmlStructureWriter.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/ImageDiffer/ResultWriters/HtmlStructureWriter.java | 50 ++++++++-
2 files changed, 47 insertions(+), 8 deletions(-)
diffs (190 lines):
diff -r fd109a931f89 -r 61cadaf2583d ChangeLog
--- a/ChangeLog Fri Nov 13 13:26:05 2015 +0100
+++ b/ChangeLog Mon Jan 04 11:04:54 2016 +0100
@@ -1,3 +1,8 @@
+2016-01-04 Pavel Tisnovsky
+
+ * src/org/gfxtest/ImageDiffer/ResultWriters/HtmlStructureWriter.java:
+ Updated comments in the class HtmlStructureWriter.
+
2015-11-13 Pavel Tisnovsky
* src/org/gfxtest/testsuites/BitBltUsingBgColor.java:
diff -r fd109a931f89 -r 61cadaf2583d src/org/gfxtest/ImageDiffer/ResultWriters/HtmlStructureWriter.java
--- a/src/org/gfxtest/ImageDiffer/ResultWriters/HtmlStructureWriter.java Fri Nov 13 13:26:05 2015 +0100
+++ b/src/org/gfxtest/ImageDiffer/ResultWriters/HtmlStructureWriter.java Mon Jan 04 11:04:54 2016 +0100
@@ -1,7 +1,7 @@
/*
Java gfx-test framework
- Copyright (C) 2010, 2011, 2012 Red Hat
+ Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Red Hat
This file is part of IcedTea.
@@ -62,8 +62,10 @@
import org.gfxtest.ImageDiffer.Configuration;
import org.gfxtest.framework.Log;
+
+
/**
- *
+ * Helper class for writting result(s) into an HTML page.
*
* @author Pavel Tisnovsky
*/
@@ -74,19 +76,31 @@
*/
private static final String DEFAULT_ENCODING = "UTF-8";
+ /**
+ * Directory that contains HTML templates.
+ */
private static final String TEMPLATE_DIR = "templates";
+ /**
+ * Initialization of the logger used during HTML generation.
+ */
static Log log = new Log(HtmlStructureWriter.class.getName(), true);
+ /**
+ * Create directory where the results should be placed.
+ */
public static void createAndFillResultDirectory(Configuration configuration, BufferedImage[] sourceImages,
ComparisonResult comparisonResult, String dirName) throws IOException
{
File newDir = new File(configuration.getOutputDirectory(), dirName);
log.logProcess("creating directory %s", newDir.getAbsolutePath());
+ // create directory to store results (this directory might exists)
if (!newDir.mkdir())
{
log.logError("error creating directory %s", newDir.getAbsolutePath());
}
+ // write images according to computed diff
+ // but only when at least one diff have been found
if (!comparisonResult.isEqualsImages())
{
log.logProcess("writing source and diff images to directory %s", dirName);
@@ -102,11 +116,16 @@
createHtmlFile(newDir, comparisonResult);
}
+ /**
+ * Create HTML file containing result(s).
+ */
private static void createHtmlFile(File newDir, ComparisonResult cr) throws IOException
{
+ // get the appropriate template
String templateName = cr.isEqualsImages() ? "template_same_images.html" : "template_different_images.html";
BufferedWriter writer = null;
BufferedReader template = null;
+ // read the template and write the resulting HTML by using this template
try
{
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(newDir, "result.html")), DEFAULT_ENCODING));
@@ -119,21 +138,26 @@
}
catch (UnsupportedEncodingException e)
{
+ // print stack trace in case of exception
e.printStackTrace();
throw e;
}
catch (FileNotFoundException e)
{
+ // print stack trace in case of exception
e.printStackTrace();
throw e;
}
catch (IOException e)
{
+ // print stack trace in case of exception
e.printStackTrace();
throw e;
}
+ // try to close template & the resulting HTML file
finally
{
+ // close the template
if (template != null)
{
try
@@ -145,6 +169,7 @@
e.printStackTrace();
}
}
+ // close the HTML file with results
if (writer != null)
{
try
@@ -159,12 +184,17 @@
}
}
+ /**
+ * Replace placeholder name with the appropriate value.
+ */
private static String replacePlaceholders(ComparisonResult cr, File newDir, String line)
{
StringBuffer out = new StringBuffer();
+ // placeholder is written as ${IDENTIFIER}
Pattern pattern = Pattern.compile("\\$\\{(.*?)\\}", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(line);
+ // each placeholder is processed in one iteration
while (matcher.find())
{
matcher.appendReplacement(out, getPlaceholderValue(cr, matcher.group(1)));
@@ -173,41 +203,45 @@
return out.toString() + "\n";
}
+ /**
+ * Try to read the value of getter with the same name as placeholder.
+ */
private static String getPlaceholderValue(ComparisonResult cr, String group)
{
Method method;
try
{
- // call appropriate getter
+ // try to call appropriate getter
method = cr.getClass().getDeclaredMethod("get" + group, (Class>[]) null);
return "" + method.invoke(cr, (Object[]) null);
}
catch (IllegalAccessException e)
{
- // print ST in case of exception
+ // print stack trace in case of exception
e.printStackTrace();
}
catch (SecurityException e)
{
- // print ST in case of exception
+ // print stack trace in case of exception
e.printStackTrace();
}
catch (NoSuchMethodException e)
{
- // print ST in case of exception
+ // print stack trace in case of exception
e.printStackTrace();
}
catch (IllegalArgumentException e)
{
- // print ST in case of exception
+ // print stack trace in case of exception
e.printStackTrace();
}
catch (InvocationTargetException e)
{
- // print ST in case of exception
+ // print stack trace in case of exception
e.printStackTrace();
}
return group;
}
}
+
From bugzilla-daemon at icedtea.classpath.org Mon Jan 4 13:17:13 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Mon, 04 Jan 2016 13:17:13 +0000
Subject: [Bug 2591] IcedTea-Web request resources twice for meta informations
and causes ClientAbortException on tomcat in conjunction with
JnlpDownloadServlet
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2591
--- Comment #4 from JiriVanek ---
Thank you for update. Your modification have sense.
I will send it to public review now.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From jvanek at redhat.com Mon Jan 4 15:55:02 2016
From: jvanek at redhat.com (Jiri Vanek)
Date: Mon, 4 Jan 2016 16:55:02 +0100
Subject: [rfc][icedtea-web] fix for multiple in-sequence opened connection
Message-ID: <568A95D6.3010609@redhat.com>
There is the patch for
and so fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2591
According to reporter, it fixed the issue.
According to myself, i did not found any regeressions.
Well, the patch is not nicest, and as addition, I have no idea how to properly test it in unittest.
And as top of worst, I eould like to backport it to 1.6 soon...
Thoughts?
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1489.patch
Type: text/x-patch
Size: 8931 bytes
Desc: not available
URL:
From jvanek at redhat.com Mon Jan 4 16:19:48 2016
From: jvanek at redhat.com (Jiri Vanek)
Date: Mon, 4 Jan 2016 17:19:48 +0100
Subject: [rfc][icedtea-web] fix for " html-gen.sh: Don't try to call hg if .hg
directory isn't present"
Message-ID: <568A9BA4.7000209@redhat.com>
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2779
The fix came with the bug report. I had tested an checked.
I added following hunk to it:
+if [ ! -e html-gen ]; then
+ echo "No html-gen directory, exiting. See Makefile.am for usage"
+ exit 1
+fi
+
I will push this tomorrow to both head and 1.6
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: html-gen.sh.patch
Type: text/x-patch
Size: 2386 bytes
Desc: not available
URL:
From aazores at redhat.com Mon Jan 4 16:35:33 2016
From: aazores at redhat.com (Andrew Azores)
Date: Mon, 4 Jan 2016 11:35:33 -0500
Subject: [rfc][icedtea-web] fix for multiple in-sequence opened connection
In-Reply-To: <568A95D6.3010609@redhat.com>
References: <568A95D6.3010609@redhat.com>
Message-ID: <568A9F55.4020301@redhat.com>
On 04/01/16 10:55 AM, Jiri Vanek wrote:
> There is the patch for
> and so fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2591
>
> According to reporter, it fixed the issue.
> According to myself, i did not found any regeressions.
>
> Well, the patch is not nicest, and as addition, I have no idea how to
> properly test it in unittest.
>
> And as top of worst, I eould like to backport it to 1.6 soon...
>
> Thoughts?
>
>
> J.
>
Just a few thoughts here. The intent of the patch seems fine but I'm not
sure at a quick glance if this is the best approach.
> +
> + @Override
> + public String toString() {
> + return URL.toExternalForm() + "; " + result + "; " + (lastModified==null?"null":lastModified.toString()) + "; " + length==null?"null":length.toString() + "; ";
> + }
> +
> +
> +
> +
Can the extra blank lines at the bottom be removed? And can the toString
be moved to the end of the class? The formatting just seems strange. The
toString body is also a little hard to read, it could probably do with
some internal whitespaces and some linebreaks at the '+'.
> - private static class CodeWithRedirect {
> + static class CodeWithRedirect {
>
> int result = HttpURLConnection.HTTP_OK;
> URL URL;
> +
> + Long lastModified;
> + Long length;
>
"CodeWithRedirect" doesn't seem like a fitting name anymore. It's more
than that now with the extra fields added. Is adding these fields to
this class the best way to go? They don't really seem related - they
feel shoehorned in to me. Maybe there should be some "URLResponse" class
which has lastModified, length, and codeWithRedirect fields? Just an
idea, though. I'm not entirely sure that that's the best abstraction.
--
Thanks,
Andrew Azores
From aazores at redhat.com Mon Jan 4 16:40:42 2016
From: aazores at redhat.com (Andrew Azores)
Date: Mon, 4 Jan 2016 11:40:42 -0500
Subject: [rfc][icedtea-web] fix for " html-gen.sh: Don't try to call hg if
.hg directory isn't present"
In-Reply-To: <568A9BA4.7000209@redhat.com>
References: <568A9BA4.7000209@redhat.com>
Message-ID: <568AA08A.5040202@redhat.com>
On 04/01/16 11:19 AM, Jiri Vanek wrote:
> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2779
>
> The fix came with the bug report. I had tested an checked.
> I added following hunk to it:
> +if [ ! -e html-gen ]; then
> + echo "No html-gen directory, exiting. See Makefile.am for usage"
> + exit 1
> +fi
> +
>
> I will push this tomorrow to both head and 1.6
>
>
> J.
Looks good to me.
--
Thanks,
Andrew Azores
From bugzilla-daemon at icedtea.classpath.org Mon Jan 4 20:58:28 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Mon, 04 Jan 2016 20:58:28 +0000
Subject: [Bug 2781] New: CACAO - typeinfo.cpp: typeinfo_merge_nonarrays:
Assertion `dest && result && x.any && y.any' failed
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2781
Bug ID: 2781
Summary: CACAO - typeinfo.cpp: typeinfo_merge_nonarrays:
Assertion `dest && result && x.any && y.any' failed
Product: IcedTea
Version: 2.6.3
Hardware: ppc
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: CACAO
Assignee: stefan at complang.tuwien.ac.at
Reporter: chewi at gentoo.org
CC: unassigned at icedtea.classpath.org, xerxes at zafena.se
When running the junit 4.11 and hsqldb 1.8.1.3 unit tests, the java process
aborts with the following.
java: typeinfo.cpp:1449: typecheck_result typeinfo_merge_nonarrays(typeinfo_t*,
classref_or_classinfo*, classref_or_classinfo, classref_or_classinfo,
typeinfo_mergedlist_t*, typeinfo_mergedlist_t*): Assertion `dest && result &&
x.any && y.any' failed.
Aborted
I have seen this with icedtea 2.6.3 + CACAO on ppc and ppc64. I haven't tried
any other architectures. icedtea 2.5.6 works fine, which makes sense as a much
more recent CACAO version was used in the former. Unfortunately this makes
tracking the precise cause difficult.
I was hoping to reproduce it with standalone CACAO but it runs the hsqldb tests
fine and produces a single seemingly unrelated test error (not an abort) on the
junit tests regardless of the version.
I believe this to be quite a serious issue so I will report it upstream.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugzilla-daemon at icedtea.classpath.org Mon Jan 4 21:57:20 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Mon, 04 Jan 2016 21:57:20 +0000
Subject: [Bug 2781] CACAO - typeinfo.cpp: typeinfo_merge_nonarrays: Assertion
`dest && result && x.any && y.any' failed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2781
--- Comment #1 from Stefan Ring ---
You don't need to go to CACAO upstream. We can handle it here. It would be good
to find out the root cause of this. CACAO has not changed much recently. I'll
check if I can reproduce the issue.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugzilla-daemon at icedtea.classpath.org Mon Jan 4 22:46:18 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Mon, 04 Jan 2016 22:46:18 +0000
Subject: [Bug 2781] CACAO - typeinfo.cpp: typeinfo_merge_nonarrays: Assertion
`dest && result && x.any && y.any' failed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2781
--- Comment #2 from James Le Cuirot ---
I've now reproduced it on amd64 for good measure.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugzilla-daemon at icedtea.classpath.org Mon Jan 4 23:37:40 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Mon, 04 Jan 2016 23:37:40 +0000
Subject: [Bug 2781] CACAO - typeinfo.cpp: typeinfo_merge_nonarrays: Assertion
`dest && result && x.any && y.any' failed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2781
--- Comment #3 from Stefan Ring ---
I can reproduce it as well, on amd64.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From jvanek at icedtea.classpath.org Tue Jan 5 09:27:33 2016
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Tue, 05 Jan 2016 09:27:33 +0000
Subject: /hg/release/icedtea-web-1.6: html-gen.sh: now don't generate mer...
Message-ID:
changeset f589afe6e008 in /hg/release/icedtea-web-1.6
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.6?cmd=changeset;node=f589afe6e008
author: Jiri Vanek
date: Tue Jan 05 10:27:13 2016 +0100
html-gen.sh: now don't generate mercurial changesets' links if .hg is missing
diffstat:
ChangeLog | 5 +++++
NEWS | 1 +
html-gen.sh | 26 ++++++++++++++++++++------
3 files changed, 26 insertions(+), 6 deletions(-)
diffs (78 lines):
diff -r ee907deeda19 -r f589afe6e008 ChangeLog
--- a/ChangeLog Thu Dec 31 13:29:17 2015 +0100
+++ b/ChangeLog Tue Jan 05 10:27:13 2016 +0100
@@ -1,3 +1,8 @@
+2016-01-05 Jiri Vanek
+
+ * NEWS: mentioned PR2779
+ * html-gen.sh: now don't generate mercurial changesets' links if .hg is missing
+
2015-12-23 Jiri Vanek
Small properties parser in C (plugin) now unescapes \= \\ \: \t \n and \r correctly
diff -r ee907deeda19 -r f589afe6e008 NEWS
--- a/NEWS Thu Dec 31 13:29:17 2015 +0100
+++ b/NEWS Tue Jan 05 10:27:13 2016 +0100
@@ -10,6 +10,7 @@
New in release 1.6.2 (YYYY-MM-DD):
* all connection restrictions now consider also port
+* PR2779: html-gen.sh: Don't try to call hg if .hg directory isn't present
* NetX
- main-class attribute trimmed by default
- in strict mode, main-class attribute checked for invalid characters
diff -r ee907deeda19 -r f589afe6e008 html-gen.sh
--- a/html-gen.sh Thu Dec 31 13:29:17 2015 +0100
+++ b/html-gen.sh Tue Jan 05 10:27:13 2016 +0100
@@ -67,13 +67,23 @@
if [ -z "$CHANGESETS" ] || [ "$CHANGESETS" -lt 0 ]; then CHANGESETS=10; fi
NEWS_ITEMS=2
-REPO_URL="$(hg paths default | sed -r 's/.*icedtea.classpath.org\/(.*)/\1/')"
+
+if [ -d .hg ]; then
+ REPO_URL="$(hg paths default | sed -r 's/.*icedtea.classpath.org\/(.*)/\1/')"
+else
+ unset REPO_URL
+fi
start_time="$(date +%s.%N)"
+if [ ! -e html-gen ]; then
+ echo "No html-gen directory, exiting. See Makefile.am for usage"
+ exit 1
+fi
+
cd html-gen
-print_debug "Generating HTML content for javaws -about for $REPO_URL. $CHANGESETS changesets, $NEWS_ITEMS news items"
+print_debug "Generating HTML content for javaws -about${REPO_URL:+ for }$REPO_URL. $CHANGESETS changesets, $NEWS_ITEMS news items"
print_debug "Starting sed substitutions"
for FILE in NEWS AUTHORS COPYING ChangeLog
do
@@ -99,7 +109,9 @@
sed -i '5i
' AUTHORS.html
echo "" >> AUTHORS.html
-REVS=(`hg log -l"$CHANGESETS" | grep 'changeset:' | cut -d: -f3 | tr '\n' ' '`)
+if [ -n "${REPO_URL}" ]; then
+ REVS=(`hg log -l"$CHANGESETS" | grep 'changeset:' | cut -d: -f3 | tr '\n' ' '`)
+fi
print_debug "Done. Starting formatting (bolding, mailto and hyperlink creation)"
@@ -132,9 +144,11 @@
if [[ "$LINE" =~ $date_regex* ]] # Matches line starting with eg 2013-07-01
then
html_space="\ \ "
- REV="${REVS["$COUNTER"]}"
- # Turn the date into a hyperlink for the revision this changelog entry describes
- LINE=$(echo "$LINE" | sed -r "s|($date_regex)($html_space.*$html_space.*)|\1\2|")
+ if [ -n "${REPO_URL}" ]; then
+ REV="${REVS["$COUNTER"]}"
+ # Turn the date into a hyperlink for the revision this changelog entry describes
+ LINE=$(echo "$LINE" | sed -r "s|($date_regex)($html_space.*$html_space.*)|\1\2|")
+ fi
COUNTER="$(( COUNTER + 1 ))"
fi
if [ "$COUNTER" -gt "$CHANGESETS" ] # Cut to ten changesets
From jvanek at icedtea.classpath.org Tue Jan 5 09:32:08 2016
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Tue, 05 Jan 2016 09:32:08 +0000
Subject: /hg/icedtea-web: html-gen.sh: now don't generate mercurial chang...
Message-ID:
changeset d2b2e45c958a in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=d2b2e45c958a
author: Jiri Vanek
date: Tue Jan 05 10:30:19 2016 +0100
html-gen.sh: now don't generate mercurial changesets' links if .hg is missing
diffstat:
ChangeLog | 5 +++++
NEWS | 1 +
html-gen.sh | 26 ++++++++++++++++++++------
3 files changed, 26 insertions(+), 6 deletions(-)
diffs (78 lines):
diff -r f1a97bf85276 -r d2b2e45c958a ChangeLog
--- a/ChangeLog Thu Dec 31 13:26:39 2015 +0100
+++ b/ChangeLog Tue Jan 05 10:30:19 2016 +0100
@@ -1,3 +1,8 @@
+2016-01-05 Jiri Vanek
+
+ * NEWS: mentioned PR2779
+ * html-gen.sh: now don't generate mercurial changesets' links if .hg is missing
+
2015-12-23 Jiri Vanek
Added base logic and design for rememberable dialogues editor.
diff -r f1a97bf85276 -r d2b2e45c958a NEWS
--- a/NEWS Thu Dec 31 13:26:39 2015 +0100
+++ b/NEWS Tue Jan 05 10:30:19 2016 +0100
@@ -13,6 +13,7 @@
* Enabled Entry-Point attribute check
* permissions sandbox and signed app and unsigned app with permissions all-permissions now run in sandbox instead of not at all.
* fixed DownloadService
+* PR2779: html-gen.sh: Don't try to call hg if .hg directory isn't present
* comments in deployment.properties now should persists load/save
* fixed bug in caching of files with query
* fixed issues with recreating of existing shortcut
diff -r f1a97bf85276 -r d2b2e45c958a html-gen.sh
--- a/html-gen.sh Thu Dec 31 13:26:39 2015 +0100
+++ b/html-gen.sh Tue Jan 05 10:30:19 2016 +0100
@@ -67,13 +67,23 @@
if [ -z "$CHANGESETS" ] || [ "$CHANGESETS" -lt 0 ]; then CHANGESETS=10; fi
NEWS_ITEMS=2
-REPO_URL="$(hg paths default | sed -r 's/.*icedtea.classpath.org\/(.*)/\1/')"
+
+if [ -d .hg ]; then
+ REPO_URL="$(hg paths default | sed -r 's/.*icedtea.classpath.org\/(.*)/\1/')"
+else
+ unset REPO_URL
+fi
start_time="$(date +%s.%N)"
+if [ ! -e html-gen ]; then
+ echo "No html-gen directory, exiting. See Makefile.am for usage"
+ exit 1
+fi
+
cd html-gen
-print_debug "Generating HTML content for javaws -about for $REPO_URL. $CHANGESETS changesets, $NEWS_ITEMS news items"
+print_debug "Generating HTML content for javaws -about${REPO_URL:+ for }$REPO_URL. $CHANGESETS changesets, $NEWS_ITEMS news items"
print_debug "Starting sed substitutions"
for FILE in NEWS AUTHORS COPYING ChangeLog
do
@@ -99,7 +109,9 @@
sed -i '5i
' AUTHORS.html
echo "" >> AUTHORS.html
-REVS=(`hg log -l"$CHANGESETS" | grep 'changeset:' | cut -d: -f3 | tr '\n' ' '`)
+if [ -n "${REPO_URL}" ]; then
+ REVS=(`hg log -l"$CHANGESETS" | grep 'changeset:' | cut -d: -f3 | tr '\n' ' '`)
+fi
print_debug "Done. Starting formatting (bolding, mailto and hyperlink creation)"
@@ -132,9 +144,11 @@
if [[ "$LINE" =~ $date_regex* ]] # Matches line starting with eg 2013-07-01
then
html_space="\ \ "
- REV="${REVS["$COUNTER"]}"
- # Turn the date into a hyperlink for the revision this changelog entry describes
- LINE=$(echo "$LINE" | sed -r "s|($date_regex)($html_space.*$html_space.*)|\1\2|")
+ if [ -n "${REPO_URL}" ]; then
+ REV="${REVS["$COUNTER"]}"
+ # Turn the date into a hyperlink for the revision this changelog entry describes
+ LINE=$(echo "$LINE" | sed -r "s|($date_regex)($html_space.*$html_space.*)|\1\2|")
+ fi
COUNTER="$(( COUNTER + 1 ))"
fi
if [ "$COUNTER" -gt "$CHANGESETS" ] # Cut to ten changesets
From bugzilla-daemon at icedtea.classpath.org Tue Jan 5 11:54:17 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Tue, 05 Jan 2016 11:54:17 +0000
Subject: [Bug 2690] Can't run BOM into JNLP file.
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2690
JiriVanek changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--- Comment #1 from JiriVanek ---
Hello, this happens also when tagsoup is run with ITW?
If you are nto sure, Do you have verbose output of that run?
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From jvanek at redhat.com Tue Jan 5 16:47:20 2016
From: jvanek at redhat.com (Jiri Vanek)
Date: Tue, 5 Jan 2016 17:47:20 +0100
Subject: [rfc][icedtea-web] fix for multiple in-sequence opened connection
In-Reply-To: <568A9F55.4020301@redhat.com>
References: <568A95D6.3010609@redhat.com> <568A9F55.4020301@redhat.com>
Message-ID: <568BF398.8070505@redhat.com>
On 01/04/2016 05:35 PM, Andrew Azores wrote:
I filled all what yu did not liked - yteh main concenr - bottoms "CodeWithRedirect" issue - I just
renamed the class... I do nto wont ot make more wrappers hierarchy.
However. I could not sleep to dont have those tesetd.
So I created sucessfully tests :)
1) I created test to test rdirect
- thsoe are passing both on patched and unpathced version
2) I created tests which is counting resourcess accesses in our internal server
- and yes, without patch there are always 2 gets. Wit, only 1.
I will push the tests as separate changeset, as I wont to see them failing in my "grab changeset and
test" machine.
THANX!
J.
ps: sorry for formating issues in patch.I need ru run from work and I'm hoping to use your timezone
tobe able to push + test the tests tomorow morning (and so the aptch itself after meeting over
night):)
> On 04/01/16 10:55 AM, Jiri Vanek wrote:
>> There is the patch for
>> and so fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2591
>>
>> According to reporter, it fixed the issue.
>> According to myself, i did not found any regeressions.
>>
>> Well, the patch is not nicest, and as addition, I have no idea how to
>> properly test it in unittest.
>>
>> And as top of worst, I eould like to backport it to 1.6 soon...
>>
>> Thoughts?
>>
>>
>> J.
>>
>
> Just a few thoughts here. The intent of the patch seems fine but I'm not sure at a quick glance if
> this is the best approach.
>
>
>> +
>> + @Override
>> + public String toString() {
>> + return URL.toExternalForm() + "; " + result + "; " +
>> (lastModified==null?"null":lastModified.toString()) + "; " + length==null?"null":length.toString()
>> + "; ";
>> + }
>> +
>> +
>> +
>> +
>
> Can the extra blank lines at the bottom be removed? And can the toString be moved to the end of the
> class? The formatting just seems strange. The toString body is also a little hard to read, it could
> probably do with some internal whitespaces and some linebreaks at the '+'.
>
>> - private static class CodeWithRedirect {
>> + static class CodeWithRedirect {
>>
>> int result = HttpURLConnection.HTTP_OK;
>> URL URL;
>> +
>> + Long lastModified;
>> + Long length;
>>
>
> "CodeWithRedirect" doesn't seem like a fitting name anymore. It's more than that now with the extra
> fields added. Is adding these fields to this class the best way to go? They don't really seem
> related - they feel shoehorned in to me. Maybe there should be some "URLResponse" class which has
> lastModified, length, and codeWithRedirect fields? Just an idea, though. I'm not entirely sure that
> that's the best abstraction.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multipleConnectioinsWithTest.patch
Type: text/x-patch
Size: 60131 bytes
Desc: not available
URL:
From aazores at redhat.com Tue Jan 5 17:10:04 2016
From: aazores at redhat.com (Andrew Azores)
Date: Tue, 5 Jan 2016 12:10:04 -0500
Subject: [rfc][icedtea-web] fix for multiple in-sequence opened connection
In-Reply-To: <568BF398.8070505@redhat.com>
References: <568A95D6.3010609@redhat.com> <568A9F55.4020301@redhat.com>
<568BF398.8070505@redhat.com>
Message-ID: <568BF8EC.1010708@redhat.com>
On 05/01/16 11:47 AM, Jiri Vanek wrote:
> On 01/04/2016 05:35 PM, Andrew Azores wrote:
>
> I filled all what yu did not liked - yteh main concenr - bottoms
> "CodeWithRedirect" issue - I just renamed the class... I do nto wont ot
> make more wrappers hierarchy.
>
>
> However. I could not sleep to dont have those tesetd.
>
> So I created sucessfully tests :)
>
> 1) I created test to test rdirect
> - thsoe are passing both on patched and unpathced version
> 2) I created tests which is counting resourcess accesses in our internal
> server
> - and yes, without patch there are always 2 gets. Wit, only 1.
>
> I will push the tests as separate changeset, as I wont to see them
> failing in my "grab changeset and test" machine.
>
>
> THANX!
> J.
>
> ps: sorry for formating issues in patch.I need ru run from work and I'm
> hoping to use your timezone tobe able to push + test the tests tomorow
> morning (and so the aptch itself after meeting over night):)
Okay. I think this looks fine to push. If you have time to fix the
formatting then please do first.
--
Thanks,
Andrew Azores
From bugzilla-daemon at icedtea.classpath.org Tue Jan 5 22:33:10 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Tue, 05 Jan 2016 22:33:10 +0000
Subject: [Bug 2781] CACAO - typeinfo.cpp: typeinfo_merge_nonarrays: Assertion
`dest && result && x.any && y.any' failed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2781
--- Comment #4 from Stefan Ring ---
I bisected it to this changeset:
https://bitbucket.org/cacaovm/cacao-staging/commits/1e9787c3484ea9506c385cfe4cfd57998fb728d2
Something must have gone wrong in the refactoring.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugzilla-daemon at icedtea.classpath.org Tue Jan 5 23:07:13 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Tue, 05 Jan 2016 23:07:13 +0000
Subject: [Bug 2781] CACAO - typeinfo.cpp: typeinfo_merge_nonarrays: Assertion
`dest && result && x.any && y.any' failed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2781
--- Comment #5 from James Le Cuirot ---
Thanks, that must have taken a while!
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugzilla-daemon at icedtea.classpath.org Tue Jan 5 23:35:32 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Tue, 05 Jan 2016 23:35:32 +0000
Subject: [Bug 2781] CACAO - typeinfo.cpp: typeinfo_merge_nonarrays: Assertion
`dest && result && x.any && y.any' failed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2781
--- Comment #6 from Stefan Ring ---
The bisection was not that bad. Sifting through this huge changeset is ;). I've
now stared at it for an hour and found two bugs, but fixing them has still not
repaired it :(.
I'll go to bed now and split the patch up when I get to work on this next time.
It cannot be that hard.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From andrew at icedtea.classpath.org Wed Jan 6 04:57:43 2016
From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 04:57:43 +0000
Subject: /hg/icedtea7: PR2652: CACAO fails as a build VM for icedtea
Message-ID:
changeset d44ea9fb2df8 in /hg/icedtea7
details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=d44ea9fb2df8
author: Andrew John Hughes
date: Tue Jan 05 21:16:49 2016 +0000
PR2652: CACAO fails as a build VM for icedtea
2015-10-15 Stefan Ring
PR2652: CACAO fails as a build VM for icedtea
* Makefile.am:
(ICEDTEA_PATCHES): Add CACAO patch for PR2652.
* README: Fix CACAO URL.
* patches/cacao/pr2652-classloader.patch:
Set classLoader field in java.lang.Class as expected by JDK.
diffstat:
ChangeLog | 9 ++++
Makefile.am | 3 +-
README | 2 +-
patches/cacao/pr2652-classloader.patch | 74 ++++++++++++++++++++++++++++++++++
4 files changed, 86 insertions(+), 2 deletions(-)
diffs (119 lines):
diff -r bffa3455fa17 -r d44ea9fb2df8 ChangeLog
--- a/ChangeLog Mon Nov 23 02:54:31 2015 +0000
+++ b/ChangeLog Tue Jan 05 21:16:49 2016 +0000
@@ -1,3 +1,12 @@
+2015-10-15 Stefan Ring
+
+ PR2652: CACAO fails as a build VM for icedtea
+ * Makefile.am:
+ (ICEDTEA_PATCHES): Add CACAO patch for PR2652.
+ * README: Fix CACAO URL.
+ * patches/cacao/pr2652-classloader.patch:
+ Set classLoader field in java.lang.Class as expected by JDK.
+
2015-11-20 Andrew John Hughes
* Makefile.am,
diff -r bffa3455fa17 -r d44ea9fb2df8 Makefile.am
--- a/Makefile.am Mon Nov 23 02:54:31 2015 +0000
+++ b/Makefile.am Tue Jan 05 21:16:49 2016 +0000
@@ -382,7 +382,8 @@
patches/cacao/launcher.patch \
patches/cacao/memory.patch \
patches/cacao/pr2032.patch \
- patches/cacao/pr2520-tempdir.patch
+ patches/cacao/pr2520-tempdir.patch \
+ patches/cacao/pr2652-classloader.patch
else
if USING_CACAO
ICEDTEA_PATCHES += \
diff -r bffa3455fa17 -r d44ea9fb2df8 README
--- a/README Mon Nov 23 02:54:31 2015 +0000
+++ b/README Tue Jan 05 21:16:49 2016 +0000
@@ -69,7 +69,7 @@
CACAO as VM
===========
-The CACAO virtual machine (http://cacaovm.org) can be used as an
+The CACAO virtual machine (http://cacaojvm.org) can be used as an
alternative to the HotSpot virtual machine. One advantage of this is
that it already provides a JIT for many platforms to which HotSpot has
not yet been ported, including ppc, arm and mips. To use CACAO as the
diff -r bffa3455fa17 -r d44ea9fb2df8 patches/cacao/pr2652-classloader.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/cacao/pr2652-classloader.patch Tue Jan 05 21:16:49 2016 +0000
@@ -0,0 +1,74 @@
+Set classLoader field in java.lang.Class as expected by JDK
+
+--- cacao/cacao/src/vm/class.cpp
++++ cacao/cacao/src/vm/class.cpp
+@@ -314,6 +314,9 @@
+
+ c = classcache_store(cl, c, true);
+
++ java_lang_Class jlc(LLNI_classinfo_wrap(c));
++ jlc.set_classLoader(cl);
++
+ return c;
+ }
+
+--- cacao/cacao/src/vm/javaobjects.cpp
++++ cacao/cacao/src/vm/javaobjects.cpp
+@@ -270,11 +270,19 @@
+ { 0, 0 }
+ };
+
++off_t java_lang_Class::offset_classLoader;
++
++static DynOffsetEntry dyn_entries_java_lang_Class[] = {
++ { &java_lang_Class::set_classLoader_offset, "classLoader" },
++ { 0, 0 }
++};
++
+ #endif
+
+ void jobjects_register_dyn_offsets()
+ {
+ register_dyn_entry_table(class_java_lang_Thread, dyn_entries_java_lang_Thread);
++ register_dyn_entry_table(class_java_lang_Class, dyn_entries_java_lang_Class);
+ }
+
+ #endif // ENABLE_JAVASE
+--- cacao/cacao/src/vm/javaobjects.hpp
++++ cacao/cacao/src/vm/javaobjects.hpp
+@@ -1847,6 +1847,35 @@
+
+
+ /**
++ * OpenJDK java/lang/Class
++ *
++ * Object layout:
++ *
++ * 0. object header
++ * ? java.lang.ClassLoader classLoader
++ */
++class java_lang_Class : public java_lang_Object, private FieldAccess {
++private:
++ // Static offsets of the object's instance fields.
++ static off_t offset_classLoader;
++
++public:
++ java_lang_Class(java_handle_t* h) : java_lang_Object(h) {}
++
++ // Setters.
++ void set_classLoader(java_handle_t* value);
++
++ // Offset initializers
++ static void set_classLoader_offset(int32_t off) { offset_classLoader = off; }
++};
++
++inline void java_lang_Class::set_classLoader(java_handle_t* value)
++{
++ assert(offset_classLoader);
++ set(_handle, offset_classLoader, value);
++}
++
++/**
+ * OpenJDK java/lang/ClassLoader
+ *
+ * Object layout:
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 04:58:27 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 04:58:27 +0000
Subject: [Bug 2652] icedtea/cacao 2.6 fails as a build VM for icedtea
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2652
--- Comment #4 from hg commits ---
details:
http://icedtea.classpath.org//hg/icedtea7?cmd=changeset;node=d44ea9fb2df8
author: Andrew John Hughes
date: Tue Jan 05 21:16:49 2016 +0000
PR2652: CACAO fails as a build VM for icedtea
2015-10-15 Stefan Ring
PR2652: CACAO fails as a build VM for icedtea
* Makefile.am:
(ICEDTEA_PATCHES): Add CACAO patch for PR2652.
* README: Fix CACAO URL.
* patches/cacao/pr2652-classloader.patch:
Set classLoader field in java.lang.Class as expected by JDK.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 04:59:17 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 04:59:17 +0000
Subject: [Bug 2652] icedtea/cacao 2.6 fails as a build VM for icedtea
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2652
Andrew John Hughes 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:
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 05:00:42 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 05:00:42 +0000
Subject: [Bug 2652] icedtea/cacao 2.6 fails as a build VM for icedtea
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2652
--- Comment #5 from Andrew John Hughes ---
http://icedtea.classpath.org/hg/release/icedtea7-2.6/rev/fe0d3806c5ad
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From andrew at icedtea.classpath.org Wed Jan 6 05:23:45 2016
From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 05:23:45 +0000
Subject: /hg/icedtea7: PR2684: AArch64 port not selected on architectures...
Message-ID:
changeset ac0e7ec6e958 in /hg/icedtea7
details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=ac0e7ec6e958
author: Andrew John Hughes
date: Wed Jan 06 05:23:06 2016 +0000
PR2684: AArch64 port not selected on architectures where host_cpu != aarch64
2016-01-06 Andrew John Hughes
PR2684: AArch64 port not selected on architectures
where host_cpu != aarch64
* acinclude.m4:
(IT_HAS_NATIVE_HOTSPOT_PORT): Depend on
IT_SET_ARCH_SETTINGS and use values of
INSTALL_ARCH_DIR to determine port availability
rather than host_cpu.
diffstat:
ChangeLog | 10 ++++++++++
acinclude.m4 | 13 +++++++------
2 files changed, 17 insertions(+), 6 deletions(-)
diffs (44 lines):
diff -r d44ea9fb2df8 -r ac0e7ec6e958 ChangeLog
--- a/ChangeLog Tue Jan 05 21:16:49 2016 +0000
+++ b/ChangeLog Wed Jan 06 05:23:06 2016 +0000
@@ -1,3 +1,13 @@
+2016-01-06 Andrew John Hughes
+
+ PR2684: AArch64 port not selected on architectures
+ where host_cpu != aarch64
+ * acinclude.m4:
+ (IT_HAS_NATIVE_HOTSPOT_PORT): Depend on
+ IT_SET_ARCH_SETTINGS and use values of
+ INSTALL_ARCH_DIR to determine port availability
+ rather than host_cpu.
+
2015-10-15 Stefan Ring
PR2652: CACAO fails as a build VM for icedtea
diff -r d44ea9fb2df8 -r ac0e7ec6e958 acinclude.m4
--- a/acinclude.m4 Tue Jan 05 21:16:49 2016 +0000
+++ b/acinclude.m4 Wed Jan 06 05:23:06 2016 +0000
@@ -2832,16 +2832,17 @@
AC_DEFUN_ONCE([IT_HAS_NATIVE_HOTSPOT_PORT],
[
+ AC_REQUIRE([IT_SET_ARCH_SETTINGS])
AC_MSG_CHECKING([if a native HotSpot port is available for this architecture])
has_native_hotspot_port=yes;
- case "${host_cpu}" in
+ case "${INSTALL_ARCH_DIR}" in
aarch64) ;;
- arm64) ;;
- i?86) ;;
+ amd64) ;;
+ i386) ;;
+ ppc64) ;;
+ ppc64le) ;;
sparc) ;;
- x86_64) ;;
- powerpc64) ;;
- powerpc64le) ;;
+ sparcv9) ;;
*) has_native_hotspot_port=no;
esac
AC_MSG_RESULT([$has_native_hotspot_port])
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 05:24:22 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 05:24:22 +0000
Subject: [Bug 2684] [IcedTea7] AArch64 port not selected on architectures
where host_cpu != aarch64
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2684
--- Comment #2 from hg commits ---
details:
http://icedtea.classpath.org//hg/icedtea7?cmd=changeset;node=ac0e7ec6e958
author: Andrew John Hughes
date: Wed Jan 06 05:23:06 2016 +0000
PR2684: AArch64 port not selected on architectures where host_cpu !=
aarch64
2016-01-06 Andrew John Hughes
PR2684: AArch64 port not selected on architectures
where host_cpu != aarch64
* acinclude.m4:
(IT_HAS_NATIVE_HOTSPOT_PORT): Depend on
IT_SET_ARCH_SETTINGS and use values of
INSTALL_ARCH_DIR to determine port availability
rather than host_cpu.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 05:37:00 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 05:37:00 +0000
Subject: [Bug 2684] [IcedTea7] AArch64 port not selected on architectures
where host_cpu != aarch64
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2684
Andrew John Hughes 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:
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 07:16:42 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 07:16:42 +0000
Subject: [Bug 1603] Dell Console Redirection Client fails to log in
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1603
JiriVanek changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |jvanek at redhat.com
Resolution|--- |FIXED
--- Comment #1 from JiriVanek ---
dell console is known to be fixing with 1.6
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From jvanek at icedtea.classpath.org Wed Jan 6 08:53:53 2016
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 08:53:53 +0000
Subject: /hg/release/icedtea-web-1.6: Added redirection tests
Message-ID:
changeset f48d4c62c2e3 in /hg/release/icedtea-web-1.6
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.6?cmd=changeset;node=f48d4c62c2e3
author: Jiri Vanek
date: Wed Jan 06 09:53:38 2016 +0100
Added redirection tests
diffstat:
ChangeLog | 13 +
tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java | 109 +++
tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java | 76 +-
tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java | 290 ++++++++++
tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java | 92 ++-
tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java | 225 ++++--
6 files changed, 656 insertions(+), 149 deletions(-)
diffs (truncated from 967 to 500 lines):
diff -r f589afe6e008 -r f48d4c62c2e3 ChangeLog
--- a/ChangeLog Tue Jan 05 10:27:13 2016 +0100
+++ b/ChangeLog Wed Jan 06 09:53:38 2016 +0100
@@ -1,3 +1,16 @@
+2016-01-06 Jiri Vanek
+
+ Added redirection tests
+ * tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java: Enhanced so
+ it can redirect requests to another instance. Enhanced to be able to count requests
+ * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: same
+ * tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java: small
+ refactoring to reuse checking methods
+ * tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java:
+ added set of tests to test behavior under various redirect codes
+ * tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java:
+ Added FAILING tests for 2591 - counting ITW requests to test server
+
2016-01-05 Jiri Vanek
* NEWS: mentioned PR2779
diff -r f589afe6e008 -r f48d4c62c2e3 tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java Wed Jan 06 09:53:38 2016 +0100
@@ -0,0 +1,109 @@
+/* SimpleTest1Test.java
+ Copyright (C) 2011 Red Hat, Inc.
+
+ This file is part of IcedTea.
+
+ IcedTea is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2.
+
+ IcedTea is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with IcedTea; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version.
+ */
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import net.sourceforge.jnlp.ProcessResult;
+import net.sourceforge.jnlp.ServerAccess;
+import net.sourceforge.jnlp.ServerLauncher;
+import net.sourceforge.jnlp.annotations.Bug;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+
+import org.junit.Test;
+
+ at Bug(id = "PR2591")
+public class SimpleTest1CountRequests {
+
+ private static final ServerAccess server = new ServerAccess();
+ private static ServerLauncher server0;
+ private static final Map> counter = new HashMap<>();
+ private static final List hv = Arrays.asList(new String[]{ServerAccess.VERBOSE_OPTION, ServerAccess.HEADLES_OPTION});
+
+ @BeforeClass
+ public static void createCountingServer() {
+ server0 = ServerAccess.getIndependentInstance();
+ server0.setRequestsCounter(counter);
+ }
+
+ @AfterClass
+ public static void stopCountingServer() {
+ server0.stop();
+ }
+
+ @Bug(id = "PR2591")
+ @Test
+ public void testSimpletest1EachResourceOnePerRun() throws Exception {
+ server0.setSupportingHeadRequest(true);
+ counter.clear();
+ ProcessResult pr = ServerAccess.executeProcessUponURL(server.getJavawsLocation(),
+ hv,
+ server0.getUrl("/simpletest1.jnlp"),
+ null,
+ null
+ );
+ SimpleTest1Test.checkLaunched(pr);
+ Assert.assertTrue(counter.get("./simpletest1.jnlp").get("GET").equals(1)); //2 without bugfix
+ Assert.assertTrue(counter.get("./simpletest1.jnlp").get("HEAD").equals(1));
+ Assert.assertTrue(counter.get("./simpletest1.jar").get("GET").equals(1));//2 without bugfix
+ Assert.assertTrue(counter.get("./simpletest1.jar").get("HEAD").equals(1));
+
+ }
+
+ @Bug(id = "PR2591")
+ @Test
+ public void testSimpletest1EachResourceOnePerRunHeadsOff() throws Exception {
+ server0.setSupportingHeadRequest(false);
+ counter.clear();
+ ProcessResult pr = ServerAccess.executeProcessUponURL(server.getJavawsLocation(),
+ hv,
+ server0.getUrl("/simpletest1.jnlp"),
+ null,
+ null
+ );
+ SimpleTest1Test.checkLaunched(pr);
+ Assert.assertTrue(counter.get("./simpletest1.jnlp").get("GET").equals(2)); //3 without bugfix
+ Assert.assertTrue(counter.get("./simpletest1.jnlp").get("HEAD") == null);
+ Assert.assertTrue(counter.get("./simpletest1.jar").get("GET").equals(2));//3 without bugfix
+ Assert.assertTrue(counter.get("./simpletest1.jar").get("HEAD") == (null));
+
+ }
+
+}
diff -r f589afe6e008 -r f48d4c62c2e3 tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java
--- a/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java Tue Jan 05 10:27:13 2016 +0100
+++ b/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java Wed Jan 06 09:53:38 2016 +0100
@@ -1,38 +1,38 @@
/* SimpleTest1Test.java
-Copyright (C) 2011 Red Hat, Inc.
+ Copyright (C) 2011 Red Hat, Inc.
-This file is part of IcedTea.
+ This file is part of IcedTea.
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
+ IcedTea is 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.
+ 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.
+ 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.
+ 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.
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version.
*/
import java.io.File;
@@ -50,14 +50,18 @@
public class SimpleTest1Test {
- private static ServerAccess server = new ServerAccess();
+ private static final ServerAccess server = new ServerAccess();
private static final List strict = Arrays.asList(new String[]{"-strict", ServerAccess.VERBOSE_OPTION});
- private void checkLaunched(ProcessResult pr) {
+ static void checkLaunched(ProcessResult pr) {
checkLaunched(pr, false);
}
- private void checkLaunched(ProcessResult pr, boolean negate) {
+ static void checkLaunched(ProcessResult pr, boolean negate) {
+ checkLaunched(pr, negate, true);
+ }
+
+ static void checkLaunched(ProcessResult pr, boolean negate, boolean checkTermination) {
String s = "Good simple javaws exapmle";
if (negate) {
Assert.assertFalse("testSimpletest1lunchOk stdout should NOT contains " + s + " bud did", pr.stdout.contains(s));
@@ -71,8 +75,14 @@
//disabled, unnecessary exceptions may occure
//Assert.assertFalse("testSimpletest1lunchOk stderr should not contains " + ss + " but did", pr.stderr.contains(ss));
}
- Assert.assertFalse(pr.wasTerminated);
- Assert.assertEquals((Integer) 0, pr.returnValue);
+ if (checkTermination) {
+ Assert.assertFalse(pr.wasTerminated);
+ if (negate) {
+ Assert.assertEquals((Integer) 1, pr.returnValue);
+ } else {
+ Assert.assertEquals((Integer) 0, pr.returnValue);
+ }
+ }
}
@Test
diff -r f589afe6e008 -r f48d4c62c2e3 tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java Wed Jan 06 09:53:38 2016 +0100
@@ -0,0 +1,290 @@
+/* SimpleTest1Test.java
+ Copyright (C) 2011 Red Hat, Inc.
+
+ This file is part of IcedTea.
+
+ IcedTea is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2.
+
+ IcedTea is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with IcedTea; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version.
+ */
+
+import java.net.MalformedURLException;
+import java.util.Arrays;
+import java.util.List;
+import net.sourceforge.jnlp.OptionsDefinitions;
+import net.sourceforge.jnlp.ProcessResult;
+import net.sourceforge.jnlp.ServerAccess;
+import net.sourceforge.jnlp.ServerLauncher;
+import org.junit.Assert;
+
+import org.junit.Test;
+
+public class SimpleTestDefaultRedirects {
+
+ private static final ServerAccess server = new ServerAccess();
+
+ private static final String D = "-J-Dhttp.maxRedirects=20"; //default - https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html , but...
+ //unluckily, setting http.maxRedirects to eg 1 do not have testing benefit
+ //as httpconnection then jsut throws exception instead of returning header to app's investigations
+ //I doubt it is worthy to struggle with setInstanceFollowRedirects in production code
+
+ private static final List hr = Arrays.asList(new String[]{D, ServerAccess.HEADLES_OPTION, OptionsDefinitions.OPTIONS.REDIRECT.option});
+ private static final List hrv = Arrays.asList(new String[]{D, ServerAccess.VERBOSE_OPTION, ServerAccess.HEADLES_OPTION, OptionsDefinitions.OPTIONS.REDIRECT.option});
+ private static final List hv = Arrays.asList(new String[]{D, ServerAccess.VERBOSE_OPTION, ServerAccess.HEADLES_OPTION});
+
+/* creates redirecting instances so oe can debug itw against it */
+// public static void main(String[] args) throws InterruptedException, MalformedURLException {
+// ServerLauncher[] servers = new ServerLauncher[3];
+//
+// ServerLauncher server0 = ServerAccess.getIndependentInstance();
+// server0.setRedirect(ServerAccess.getInstance()); //redirecting to normal server singleton
+// server0.setRedirectCode(301);
+// servers[0] = server0;
+//
+// ServerLauncher server1 = ServerAccess.getIndependentInstance();
+// server1.setRedirect(server0);
+// server1.setRedirectCode(301);
+// servers[1] = server1;
+//
+// ServerLauncher server2 = ServerAccess.getIndependentInstance();
+// server2.setRedirect(server1);
+// server2.setRedirectCode(301);
+// servers[2] = server2;
+//
+// System.out.println(server0);
+// System.out.println(server1);
+// System.out.println(server2);
+//
+// try {
+// System.out.println(server0.getUrl("/" + "simpletest1.jnlp"));
+// System.out.println(server1.getUrl("/" + "simpletest1.jnlp"));
+// System.out.println(server2.getUrl("/" + "simpletest1.jnlp"));
+// while (true) {
+// Thread.sleep(100);
+// }
+// } finally {
+// for (ServerLauncher server : servers) {
+// server.stop();
+// }
+// }
+// }
+
+ public void testbody(List args, boolean pass, int... redirectCodes) throws Exception {
+ testbody(args, pass, -1, redirectCodes);
+ }
+
+ public void testbody(List args, boolean pass, int breakChain, int... redirectCodes) throws Exception {
+ if (redirectCodes.length < 1) {
+ throw new RuntimeException("At least one redrection server pelase");
+ }
+ ServerLauncher[] servers = new ServerLauncher[redirectCodes.length];
+
+ ServerLauncher server0 = ServerAccess.getIndependentInstance();
+ server0.setRedirect(ServerAccess.getInstance()); //redirecting to normal server singleton
+ server0.setRedirectCode(redirectCodes[0]); //redirecting by first code
+ servers[0] = server0;
+
+ //create redirect chain
+ for (int i = 1; i < redirectCodes.length; i++) {
+ ServerLauncher serverI = ServerAccess.getIndependentInstance();
+ serverI.setRedirect(servers[i - 1]); //redirecting to pevious in chain
+ serverI.setRedirectCode(redirectCodes[i]); //by given code
+ servers[i] = serverI;
+
+ }
+ testbody(args, pass, breakChain, servers);
+ }
+
+ public void testbody(List args, boolean pass, int breakChain, ServerLauncher[] servers) throws Exception {
+ if (breakChain >= 0) {
+ servers[breakChain].setRedirect(null);
+ servers[breakChain].stop();
+ }
+ ServerLauncher server3012378 = servers[servers.length - 1];
+ try {
+ //now connect to last in chain and we should always get reposnse from ServerAccess.getInstance()
+ ProcessResult pr = ServerAccess.executeProcessUponURL(server.getJavawsLocation(),
+ args,
+ server3012378.getUrl("/" + "simpletest1.jnlp"),
+ null,
+ null
+ );
+ SimpleTest1Test.checkLaunched(pr, !pass, false);
+ if (pass) {
+ Assert.assertTrue(0 == pr.returnValue);
+ } else {
+ //1.6 have wrong handling of pr.return value
+ //Assert.assertFalse(0 == pr.returnValue);
+ }
+ } finally {
+ for (int i = 0; i < servers.length; i++) {
+ if (i != breakChain) {
+ ServerLauncher serverI = servers[i];
+ try {
+ serverI.setRedirect(null);
+ serverI.stop();
+ } catch (Exception ex) {
+ ServerAccess.logException(ex);
+ }
+ }
+ }
+ }
+ }
+
+ // note, tonly 308 needs help form ITW,others are redirected autmatically in http connection
+ // https://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html#setInstanceFollowRedirects%28boolean%29
+ public void testbody308(boolean pass, int... redirectCodes) throws Exception {
+ if (pass) {
+ testbody(hr, pass, redirectCodes);
+ } else {
+ testbody(hv, pass, redirectCodes);
+ }
+ }
+
+ public void testbodyOthers(boolean pass, int... redirectCodes) throws Exception {
+ if (pass) {
+ testbody(hr, true, redirectCodes);
+ } else {
+ testbody(hv, true, redirectCodes);
+ }
+ }
+
+ //some chains tests
+ @Test
+ public void testSimpletest1RedirectChain1AllowedOk() throws Exception {
+ testbodyOthers(true, 301, 302, 303, 307);
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain1NotAllowedOk() throws Exception {
+ testbodyOthers(false, 301, 302, 303, 307);
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain2AllowedOk() throws Exception {
+ testbody308(true, 301, 308, 302, 303, 307);
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain2NotAllowedOk() throws Exception {
+ server.executeJavawsClearCache();
+ testbody308(false, 301, 308, 302, 303, 307);
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain3AllowedBroken() throws Exception {
+ server.executeJavawsClearCache();
+ testbody(hrv, false, 1, new int[]{301, 302, 302, 303, 307});
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain3NotAllowedBroken() throws Exception {
+ server.executeJavawsClearCache();
+ testbody(hv, false, 1, new int[]{301, 302, 302, 303, 307});
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain3AlowedCycle() throws Exception {
+ server.executeJavawsClearCache();
+ ServerLauncher[] servers = new ServerLauncher[3];
+
+ ServerLauncher server0 = ServerAccess.getIndependentInstance();
+ server0.setRedirect(ServerAccess.getInstance()); //redirecting to normal server singleton
+ server0.setRedirectCode(301);
+ servers[0] = server0;
+
+ ServerLauncher server1 = ServerAccess.getIndependentInstance();
+ server1.setRedirectCode(301);
+ servers[1] = server1;
+
+ ServerLauncher server2 = ServerAccess.getIndependentInstance();
+ server2.setRedirectCode(301);
+ servers[2] = server2;
+
+ server1.setRedirect(server2);
+ server2.setRedirect(server1);
+ testbody(hrv, false, -1, servers);
+ }
+
+ //end chains
+ // basic tests
+ @Test
+ public void testSimpletest1Redirect301AllowedOk() throws Exception {
+ testbodyOthers(true, 301);
+ }
+
+ @Test
+ public void testSimpletest1Redirect301NotAllowedOk() throws Exception {
+ testbodyOthers(false, 301);
+ }
+
+ @Test
+ public void testSimpletest1Redirect302AllowedOk() throws Exception {
+ testbodyOthers(true, 302);
+ }
+
+ @Test
+ public void testSimpletest1Redirect302NotAllowedOk() throws Exception {
From jvanek at icedtea.classpath.org Wed Jan 6 09:19:10 2016
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 09:19:10 +0000
Subject: /hg/icedtea-web: Added redirection tests
Message-ID:
changeset 6cbc3a7acc95 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=6cbc3a7acc95
author: Jiri Vanek
date: Wed Jan 06 10:19:00 2016 +0100
Added redirection tests
diffstat:
ChangeLog | 13 +
tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java | 109 +++
tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java | 81 +-
tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java | 289 ++++++++++
tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java | 116 ++-
tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java | 225 ++++--
6 files changed, 669 insertions(+), 164 deletions(-)
diffs (truncated from 1041 to 500 lines):
diff -r d2b2e45c958a -r 6cbc3a7acc95 ChangeLog
--- a/ChangeLog Tue Jan 05 10:30:19 2016 +0100
+++ b/ChangeLog Wed Jan 06 10:19:00 2016 +0100
@@ -1,3 +1,16 @@
+2016-01-06 Jiri Vanek
+
+ Added redirection tests
+ * tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java: Enhanced so
+ it can redirect requests to another instance. Enhanced to be able to count requests
+ * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: same
+ * tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java: small
+ refactoring to reuse checking methods
+ * tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java:
+ added set of tests to test behavior under various redirect codes
+ * tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java:
+ Added FAILING tests for 2591 - counting ITW requests to test server
+
2016-01-05 Jiri Vanek
* NEWS: mentioned PR2779
diff -r d2b2e45c958a -r 6cbc3a7acc95 tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java Wed Jan 06 10:19:00 2016 +0100
@@ -0,0 +1,109 @@
+/* SimpleTest1Test.java
+ Copyright (C) 2011 Red Hat, Inc.
+
+ This file is part of IcedTea.
+
+ IcedTea is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2.
+
+ IcedTea is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with IcedTea; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version.
+ */
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import net.sourceforge.jnlp.ProcessResult;
+import net.sourceforge.jnlp.ServerAccess;
+import net.sourceforge.jnlp.ServerLauncher;
+import net.sourceforge.jnlp.annotations.Bug;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+
+import org.junit.Test;
+
+ at Bug(id = "PR2591")
+public class SimpleTest1CountRequests {
+
+ private static final ServerAccess server = new ServerAccess();
+ private static ServerLauncher server0;
+ private static final Map> counter = new HashMap<>();
+ private static final List hv = Arrays.asList(new String[]{ServerAccess.VERBOSE_OPTION, ServerAccess.HEADLES_OPTION});
+
+ @BeforeClass
+ public static void createCountingServer() {
+ server0 = ServerAccess.getIndependentInstance();
+ server0.setRequestsCounter(counter);
+ }
+
+ @AfterClass
+ public static void stopCountingServer() {
+ server0.stop();
+ }
+
+ @Bug(id = "PR2591")
+ @Test
+ public void testSimpletest1EachResourceOnePerRun() throws Exception {
+ server0.setSupportingHeadRequest(true);
+ counter.clear();
+ ProcessResult pr = ServerAccess.executeProcessUponURL(server.getJavawsLocation(),
+ hv,
+ server0.getUrl("/simpletest1.jnlp"),
+ null,
+ null
+ );
+ SimpleTest1Test.checkLaunched(pr);
+ Assert.assertTrue(counter.get("./simpletest1.jnlp").get("GET").equals(1)); //2 without bugfix
+ Assert.assertTrue(counter.get("./simpletest1.jnlp").get("HEAD").equals(1));
+ Assert.assertTrue(counter.get("./simpletest1.jar").get("GET").equals(1));//2 without bugfix
+ Assert.assertTrue(counter.get("./simpletest1.jar").get("HEAD").equals(1));
+
+ }
+
+ @Bug(id = "PR2591")
+ @Test
+ public void testSimpletest1EachResourceOnePerRunHeadsOff() throws Exception {
+ server0.setSupportingHeadRequest(false);
+ counter.clear();
+ ProcessResult pr = ServerAccess.executeProcessUponURL(server.getJavawsLocation(),
+ hv,
+ server0.getUrl("/simpletest1.jnlp"),
+ null,
+ null
+ );
+ SimpleTest1Test.checkLaunched(pr);
+ Assert.assertTrue(counter.get("./simpletest1.jnlp").get("GET").equals(2)); //3 without bugfix
+ Assert.assertTrue(counter.get("./simpletest1.jnlp").get("HEAD") == null);
+ Assert.assertTrue(counter.get("./simpletest1.jar").get("GET").equals(2));//3 without bugfix
+ Assert.assertTrue(counter.get("./simpletest1.jar").get("HEAD") == (null));
+
+ }
+
+}
diff -r d2b2e45c958a -r 6cbc3a7acc95 tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java
--- a/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java Tue Jan 05 10:30:19 2016 +0100
+++ b/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java Wed Jan 06 10:19:00 2016 +0100
@@ -1,42 +1,41 @@
/* SimpleTest1Test.java
-Copyright (C) 2011 Red Hat, Inc.
+ Copyright (C) 2011 Red Hat, Inc.
-This file is part of IcedTea.
+ This file is part of IcedTea.
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
+ IcedTea is 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.
+ 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.
+ 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.
+ 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.
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version.
*/
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
@@ -52,14 +51,18 @@
public class SimpleTest1Test {
- private static ServerAccess server = new ServerAccess();
+ private static final ServerAccess server = new ServerAccess();
private static final List strict = Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.STRICT.option, ServerAccess.VERBOSE_OPTION});
- private void checkLaunched(ProcessResult pr) {
+ static void checkLaunched(ProcessResult pr) {
checkLaunched(pr, false);
}
- private void checkLaunched(ProcessResult pr, boolean negate) {
+ static void checkLaunched(ProcessResult pr, boolean negate) {
+ checkLaunched(pr, negate, true);
+ }
+
+ static void checkLaunched(ProcessResult pr, boolean negate, boolean checkTermination) {
String s = "Good simple javaws exapmle";
if (negate) {
Assert.assertFalse("testSimpletest1lunchOk stdout should NOT contains " + s + " bud did", pr.stdout.contains(s));
@@ -73,11 +76,13 @@
//disabled, unnecessary exceptions may occure
//Assert.assertFalse("testSimpletest1lunchOk stderr should not contains " + ss + " but did", pr.stderr.contains(ss));
}
- Assert.assertFalse(pr.wasTerminated);
- if (negate){
- Assert.assertEquals((Integer) 1, pr.returnValue);
- } else {
- Assert.assertEquals((Integer) 0, pr.returnValue);
+ if (checkTermination) {
+ Assert.assertFalse(pr.wasTerminated);
+ if (negate) {
+ Assert.assertEquals((Integer) 1, pr.returnValue);
+ } else {
+ Assert.assertEquals((Integer) 0, pr.returnValue);
+ }
}
}
@@ -113,7 +118,7 @@
private void createStrictFile(String originalResourceName, String newResourceName, URL codebase) throws MalformedURLException, IOException {
String originalContent = FileUtils.loadFileAsString(new File(server.getDir(), originalResourceName));
- String nwContent1 = originalContent.replaceAll("href=\""+originalResourceName+"\"", "href=\""+newResourceName+"\"");
+ String nwContent1 = originalContent.replaceAll("href=\"" + originalResourceName + "\"", "href=\"" + newResourceName + "\"");
String nwContent = nwContent1.replaceAll("codebase=\".\"", "codebase=\"" + codebase + "\"");
nwContent = nwContent.replace("simpletest2", "");
ServerAccess.saveFile(nwContent, new File(server.getDir(), newResourceName));
diff -r d2b2e45c958a -r 6cbc3a7acc95 tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java Wed Jan 06 10:19:00 2016 +0100
@@ -0,0 +1,289 @@
+/* SimpleTest1Test.java
+ Copyright (C) 2011 Red Hat, Inc.
+
+ This file is part of IcedTea.
+
+ IcedTea is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2.
+
+ IcedTea is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with IcedTea; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version.
+ */
+
+import java.net.MalformedURLException;
+import java.util.Arrays;
+import java.util.List;
+import net.sourceforge.jnlp.OptionsDefinitions;
+import net.sourceforge.jnlp.ProcessResult;
+import net.sourceforge.jnlp.ServerAccess;
+import net.sourceforge.jnlp.ServerLauncher;
+import org.junit.Assert;
+
+import org.junit.Test;
+
+public class SimpleTestDefaultRedirects {
+
+ private static final ServerAccess server = new ServerAccess();
+
+ private static final String D = "-J-Dhttp.maxRedirects=20"; //default - https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html , but...
+ //unluckily, setting http.maxRedirects to eg 1 do not have testing benefit
+ //as httpconnection then jsut throws exception instead of returning header to app's investigations
+ //I doubt it is worthy to struggle with setInstanceFollowRedirects in production code
+
+ private static final List hr = Arrays.asList(new String[]{D, ServerAccess.HEADLES_OPTION, OptionsDefinitions.OPTIONS.REDIRECT.option});
+ private static final List hrv = Arrays.asList(new String[]{D, ServerAccess.VERBOSE_OPTION, ServerAccess.HEADLES_OPTION, OptionsDefinitions.OPTIONS.REDIRECT.option});
+ private static final List hv = Arrays.asList(new String[]{D, ServerAccess.VERBOSE_OPTION, ServerAccess.HEADLES_OPTION});
+
+/* creates redirecting instances so oe can debug itw against it */
+// public static void main(String[] args) throws InterruptedException, MalformedURLException {
+// ServerLauncher[] servers = new ServerLauncher[3];
+//
+// ServerLauncher server0 = ServerAccess.getIndependentInstance();
+// server0.setRedirect(ServerAccess.getInstance()); //redirecting to normal server singleton
+// server0.setRedirectCode(301);
+// servers[0] = server0;
+//
+// ServerLauncher server1 = ServerAccess.getIndependentInstance();
+// server1.setRedirect(server0);
+// server1.setRedirectCode(301);
+// servers[1] = server1;
+//
+// ServerLauncher server2 = ServerAccess.getIndependentInstance();
+// server2.setRedirect(server1);
+// server2.setRedirectCode(301);
+// servers[2] = server2;
+//
+// System.out.println(server0);
+// System.out.println(server1);
+// System.out.println(server2);
+//
+// try {
+// System.out.println(server0.getUrl("/" + "simpletest1.jnlp"));
+// System.out.println(server1.getUrl("/" + "simpletest1.jnlp"));
+// System.out.println(server2.getUrl("/" + "simpletest1.jnlp"));
+// while (true) {
+// Thread.sleep(100);
+// }
+// } finally {
+// for (ServerLauncher server : servers) {
+// server.stop();
+// }
+// }
+// }
+
+ public void testbody(List args, boolean pass, int... redirectCodes) throws Exception {
+ testbody(args, pass, -1, redirectCodes);
+ }
+
+ public void testbody(List args, boolean pass, int breakChain, int... redirectCodes) throws Exception {
+ if (redirectCodes.length < 1) {
+ throw new RuntimeException("At least one redrection server pelase");
+ }
+ ServerLauncher[] servers = new ServerLauncher[redirectCodes.length];
+
+ ServerLauncher server0 = ServerAccess.getIndependentInstance();
+ server0.setRedirect(ServerAccess.getInstance()); //redirecting to normal server singleton
+ server0.setRedirectCode(redirectCodes[0]); //redirecting by first code
+ servers[0] = server0;
+
+ //create redirect chain
+ for (int i = 1; i < redirectCodes.length; i++) {
+ ServerLauncher serverI = ServerAccess.getIndependentInstance();
+ serverI.setRedirect(servers[i - 1]); //redirecting to pevious in chain
+ serverI.setRedirectCode(redirectCodes[i]); //by given code
+ servers[i] = serverI;
+
+ }
+ testbody(args, pass, breakChain, servers);
+ }
+
+ public void testbody(List args, boolean pass, int breakChain, ServerLauncher[] servers) throws Exception {
+ if (breakChain >= 0) {
+ servers[breakChain].setRedirect(null);
+ servers[breakChain].stop();
+ }
+ ServerLauncher server3012378 = servers[servers.length - 1];
+ try {
+ //now connect to last in chain and we should always get reposnse from ServerAccess.getInstance()
+ ProcessResult pr = ServerAccess.executeProcessUponURL(server.getJavawsLocation(),
+ args,
+ server3012378.getUrl("/" + "simpletest1.jnlp"),
+ null,
+ null
+ );
+ SimpleTest1Test.checkLaunched(pr, !pass, false);
+ if (pass) {
+ Assert.assertTrue(0 == pr.returnValue);
+ } else {
+ Assert.assertFalse(0 == pr.returnValue);
+ }
+ } finally {
+ for (int i = 0; i < servers.length; i++) {
+ if (i != breakChain) {
+ ServerLauncher serverI = servers[i];
+ try {
+ serverI.setRedirect(null);
+ serverI.stop();
+ } catch (Exception ex) {
+ ServerAccess.logException(ex);
+ }
+ }
+ }
+ }
+ }
+
+ // note, tonly 308 needs help form ITW,others are redirected autmatically in http connection
+ // https://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html#setInstanceFollowRedirects%28boolean%29
+ public void testbody308(boolean pass, int... redirectCodes) throws Exception {
+ if (pass) {
+ testbody(hr, pass, redirectCodes);
+ } else {
+ testbody(hv, pass, redirectCodes);
+ }
+ }
+
+ public void testbodyOthers(boolean pass, int... redirectCodes) throws Exception {
+ if (pass) {
+ testbody(hr, true, redirectCodes);
+ } else {
+ testbody(hv, true, redirectCodes);
+ }
+ }
+
+ //some chains tests
+ @Test
+ public void testSimpletest1RedirectChain1AllowedOk() throws Exception {
+ testbodyOthers(true, 301, 302, 303, 307);
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain1NotAllowedOk() throws Exception {
+ testbodyOthers(false, 301, 302, 303, 307);
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain2AllowedOk() throws Exception {
+ testbody308(true, 301, 308, 302, 303, 307);
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain2NotAllowedOk() throws Exception {
+ server.executeJavawsClearCache();
+ testbody308(false, 301, 308, 302, 303, 307);
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain3AllowedBroken() throws Exception {
+ server.executeJavawsClearCache();
+ testbody(hrv, false, 1, new int[]{301, 302, 302, 303, 307});
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain3NotAllowedBroken() throws Exception {
+ server.executeJavawsClearCache();
+ testbody(hv, false, 1, new int[]{301, 302, 302, 303, 307});
+ }
+
+ @Test
+ public void testSimpletest1RedirectChain3AlowedCycle() throws Exception {
+ server.executeJavawsClearCache();
+ ServerLauncher[] servers = new ServerLauncher[3];
+
+ ServerLauncher server0 = ServerAccess.getIndependentInstance();
+ server0.setRedirect(ServerAccess.getInstance()); //redirecting to normal server singleton
+ server0.setRedirectCode(301);
+ servers[0] = server0;
+
+ ServerLauncher server1 = ServerAccess.getIndependentInstance();
+ server1.setRedirectCode(301);
+ servers[1] = server1;
+
+ ServerLauncher server2 = ServerAccess.getIndependentInstance();
+ server2.setRedirectCode(301);
+ servers[2] = server2;
+
+ server1.setRedirect(server2);
+ server2.setRedirect(server1);
+ testbody(hrv, false, -1, servers);
+ }
+
+ //end chains
+ // basic tests
+ @Test
+ public void testSimpletest1Redirect301AllowedOk() throws Exception {
+ testbodyOthers(true, 301);
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 09:36:48 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 09:36:48 +0000
Subject: [Bug 2591] IcedTea-Web request resources twice for meta informations
and causes ClientAbortException on tomcat in conjunction with
JnlpDownloadServlet
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2591
JiriVanek changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from JiriVanek ---
ok. pushing it now. It will be in next release of 1.6.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From jvanek at icedtea.classpath.org Wed Jan 6 09:49:47 2016
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 09:49:47 +0000
Subject: /hg/release/icedtea-web-1.6: Fixed PR2591 - IcedTea-Web request ...
Message-ID:
changeset 199702cfbca7 in /hg/release/icedtea-web-1.6
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.6?cmd=changeset;node=199702cfbca7
author: Jiri Vanek
date: Wed Jan 06 10:49:31 2016 +0100
Fixed PR2591 - IcedTea-Web request resources twice for meta informations and causes ClientAbortException on tomcat in conjunction with JnlpDownloadServlet
diffstat:
ChangeLog | 17 +-
NEWS | 1 +
netx/net/sourceforge/jnlp/cache/ResourceDownloader.java | 121 ++++++---
tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java | 31 +-
4 files changed, 113 insertions(+), 57 deletions(-)
diffs (417 lines):
diff -r f48d4c62c2e3 -r 199702cfbca7 ChangeLog
--- a/ChangeLog Wed Jan 06 09:53:38 2016 +0100
+++ b/ChangeLog Wed Jan 06 10:49:31 2016 +0100
@@ -1,3 +1,16 @@
+2016-01-06 Jiri Vanek
+
+ Fixed PR2591 - IcedTea-Web request resources twice for meta informations and
+ causes ClientAbortException on tomcat in conjunction with JnlpDownloadServlet
+ * NEWS: mentioned PR2591
+ * netx/net/sourceforge/jnlp/cache/ResourceDownloader.java: CodeWithRedirect renamed
+ to UrlRequestResult and now cached also lastModified and length if available.
+ (initializeFromURL) now expects UrlRequestResult instead of URL, (findBestUrl)
+ now returns in same manner
+ (SimpleTest1CountRequests) now passes
+ * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java: adapted
+ to ResourceDownloader.
+
2016-01-06 Jiri Vanek
Added redirection tests
@@ -7,9 +20,9 @@
* tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java: small
refactoring to reuse checking methods
* tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java:
+ Added FAILING tests for 2591 - counting ITW requests to test server
+ * tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java:
added set of tests to test behavior under various redirect codes
- * tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java:
- Added FAILING tests for 2591 - counting ITW requests to test server
2016-01-05 Jiri Vanek
diff -r f48d4c62c2e3 -r 199702cfbca7 NEWS
--- a/NEWS Wed Jan 06 09:53:38 2016 +0100
+++ b/NEWS Wed Jan 06 10:49:31 2016 +0100
@@ -11,6 +11,7 @@
New in release 1.6.2 (YYYY-MM-DD):
* all connection restrictions now consider also port
* PR2779: html-gen.sh: Don't try to call hg if .hg directory isn't present
+* PR2591 - IcedTea-Web request resources twice for meta informations and causes ClientAbortException on tomcat in conjunction with JnlpDownloadServlet
* NetX
- main-class attribute trimmed by default
- in strict mode, main-class attribute checked for invalid characters
diff -r f48d4c62c2e3 -r 199702cfbca7 netx/net/sourceforge/jnlp/cache/ResourceDownloader.java
--- a/netx/net/sourceforge/jnlp/cache/ResourceDownloader.java Wed Jan 06 09:53:38 2016 +0100
+++ b/netx/net/sourceforge/jnlp/cache/ResourceDownloader.java Wed Jan 06 10:49:31 2016 +0100
@@ -57,8 +57,8 @@
* HttpURLConnection.HTTP_OK and null if not.
* @throws IOException
*/
- static CodeWithRedirect getUrlResponseCodeWithRedirectonResult(URL url, Map requestProperties, ResourceTracker.RequestMethods requestMethod) throws IOException {
- CodeWithRedirect result = new CodeWithRedirect();
+ static UrlRequestResult getUrlResponseCodeWithRedirectonResult(URL url, Map requestProperties, ResourceTracker.RequestMethods requestMethod) throws IOException {
+ UrlRequestResult result = new UrlRequestResult();
URLConnection connection = ConnectionFactory.getConnectionFactory().openConnection(url);
for (Map.Entry property : requestProperties.entrySet()) {
@@ -92,6 +92,9 @@
}
ConnectionFactory.getConnectionFactory().disconnect(connection);
+ result.lastModified = connection.getLastModified();
+ result.length = connection.getContentLengthLong();
+
return result;
}
@@ -120,7 +123,7 @@
private void initializeOnlineResource() {
try {
- URL finalLocation = findBestUrl(resource);
+ UrlRequestResult finalLocation = findBestUrl(resource);
if (finalLocation != null) {
initializeFromURL(finalLocation);
} else {
@@ -136,18 +139,25 @@
}
}
- private void initializeFromURL(URL location) throws IOException {
+ private void initializeFromURL(UrlRequestResult location) throws IOException {
CacheEntry entry = new CacheEntry(resource.getLocation(), resource.getRequestVersion());
entry.lock();
try {
- resource.setDownloadLocation(location);
- URLConnection connection = ConnectionFactory.getConnectionFactory().openConnection(location); // this won't change so should be okay not-synchronized
+ resource.setDownloadLocation(location.URL);
+ URLConnection connection = ConnectionFactory.getConnectionFactory().openConnection(location.URL); // this won't change so should be okay not-synchronized
connection.addRequestProperty("Accept-Encoding", "pack200-gzip, gzip");
File localFile = CacheUtil.getCacheFile(resource.getLocation(), resource.getDownloadVersion());
- long size = connection.getContentLengthLong();
+ Long size = location.length;
+ if (size == null) {
+ size = connection.getContentLengthLong();
+ }
+ Long lm = location.lastModified;
+ if (lm == null) {
+ lm = connection.getLastModified();
+ }
- boolean current = CacheUtil.isCurrent(resource.getLocation(), resource.getRequestVersion(), connection.getLastModified()) && resource.getUpdatePolicy() != UpdatePolicy.FORCE;
+ boolean current = CacheUtil.isCurrent(resource.getLocation(), resource.getRequestVersion(), lm) && resource.getUpdatePolicy() != UpdatePolicy.FORCE;
if (!current) {
if (entry.isCached()) {
entry.markForDelete();
@@ -168,14 +178,15 @@
resource.changeStatus(EnumSet.of(PRECONNECT, CONNECTING), EnumSet.of(CONNECTED, PREDOWNLOAD));
// check if up-to-date; if so set as downloaded
- if (current)
+ if (current) {
resource.changeStatus(EnumSet.of(PREDOWNLOAD, DOWNLOADING), EnumSet.of(DOWNLOADED));
+ }
}
// update cache entry
if (!current) {
- entry.setRemoteContentLength(connection.getContentLengthLong());
- entry.setLastModified(connection.getLastModified());
+ entry.setRemoteContentLength(size);
+ entry.setLastModified(lm);
}
entry.setLastUpdated(System.currentTimeMillis());
@@ -225,14 +236,14 @@
}
/**
- * Returns the 'best' valid URL for the given resource.
- * This first adjusts the file name to take into account file versioning
- * and packing, if possible.
+ * Returns the 'best' valid URL for the given resource. This first adjusts
+ * the file name to take into account file versioning and packing, if
+ * possible.
*
* @param resource the resource
* @return the best URL, or null if all failed to resolve
*/
- protected URL findBestUrl(Resource resource) {
+ protected UrlRequestResult findBestUrl(Resource resource) {
DownloadOptions options = resource.getDownloadOptions();
if (options == null) {
options = new DownloadOptions(false, false);
@@ -242,7 +253,6 @@
OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Finding best URL for: " + resource.getLocation() + " : " + options.toString());
OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "All possible urls for "
+ resource.toString() + " : " + urls);
-
for (ResourceTracker.RequestMethods requestMethod : ResourceTracker.RequestMethods.getValidRequestMethods()) {
for (int i = 0; i < urls.size(); i++) {
URL url = urls.get(i);
@@ -250,13 +260,13 @@
Map requestProperties = new HashMap<>();
requestProperties.put("Accept-Encoding", "pack200-gzip, gzip");
- CodeWithRedirect response = getUrlResponseCodeWithRedirectonResult(url, requestProperties, requestMethod);
- if (response.shouldRedirect()){
+ UrlRequestResult response = getUrlResponseCodeWithRedirectonResult(url, requestProperties, requestMethod);
+ if (response.shouldRedirect()) {
if (response.URL == null) {
OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Although " + resource.toString() + " got redirect " + response.result + " code for " + requestMethod + " request for " + url.toExternalForm() + " the target was null. Not following");
} else {
- OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Resource " + resource.toString() + " got redirect " + response.result + " code for " + requestMethod + " request for " + url.toExternalForm() + " adding " + response.URL.toExternalForm()+" to list of possible urls");
- if (!JNLPRuntime.isAllowRedirect()){
+ OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Resource " + resource.toString() + " got redirect " + response.result + " code for " + requestMethod + " request for " + url.toExternalForm() + " adding " + response.URL.toExternalForm() + " to list of possible urls");
+ if (!JNLPRuntime.isAllowRedirect()) {
throw new RedirectionException("The resource " + url.toExternalForm() + " is being redirected (" + response.result + ") to " + response.URL.toExternalForm() + ". This is disabled by default. If you wont to allow it, run javaws with -allowredirect parameter.");
}
urls.add(response.URL);
@@ -265,7 +275,11 @@
OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "For " + resource.toString() + " the server returned " + response.result + " code for " + requestMethod + " request for " + url.toExternalForm());
} else {
OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "best url for " + resource.toString() + " is " + url.toString() + " by " + requestMethod);
- return url; /* This is the best URL */
+ if (response.URL == null) {
+ response.URL = url;
+ }
+ return response; /* This is the best URL */
+
}
} catch (IOException e) {
// continue to next candidate
@@ -289,18 +303,17 @@
String contentEncoding = connection.getContentEncoding();
- OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Downloading " + downloadTo + " using " +
- downloadFrom + " (encoding : " + contentEncoding + ") ");
+ OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Downloading " + downloadTo + " using "
+ + downloadFrom + " (encoding : " + contentEncoding + ") ");
- boolean packgz = "pack200-gzip".equals(contentEncoding) ||
- downloadFrom.getPath().endsWith(".pack.gz");
+ boolean packgz = "pack200-gzip".equals(contentEncoding)
+ || downloadFrom.getPath().endsWith(".pack.gz");
boolean gzip = "gzip".equals(contentEncoding);
// It's important to check packgz first. If a stream is both
// pack200 and gz encoded, then con.getContentEncoding() could
// return ".gz", so if we check gzip first, we would end up
// treating a pack200 file as a jar file.
-
if (packgz) {
downloadPackGzFile(resource, connection, new URL(downloadFrom + ".pack.gz"), downloadTo);
} else if (gzip) {
@@ -380,7 +393,7 @@
resource.incrementTransferred(rlen);
out.write(buf, 0, rlen);
}
-
+
in.close();
}
}
@@ -393,14 +406,14 @@
try (GZIPInputStream gzInputStream = new GZIPInputStream(new FileInputStream(CacheUtil
.getCacheFile(compressedLocation, version)))) {
InputStream inputStream = new BufferedInputStream(gzInputStream);
-
+
BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(CacheUtil
.getCacheFile(uncompressedLocation, version)));
-
+
while (-1 != (rlen = inputStream.read(buf))) {
outputStream.write(buf, 0, rlen);
}
-
+
outputStream.close();
inputStream.close();
}
@@ -412,29 +425,51 @@
try (GZIPInputStream gzInputStream = new GZIPInputStream(new FileInputStream(CacheUtil
.getCacheFile(compressedLocation, version)))) {
InputStream inputStream = new BufferedInputStream(gzInputStream);
-
+
JarOutputStream outputStream = new JarOutputStream(new FileOutputStream(CacheUtil
.getCacheFile(uncompressedLocation, version)));
-
+
Pack200.Unpacker unpacker = Pack200.newUnpacker();
unpacker.unpack(inputStream, outputStream);
-
+
outputStream.close();
inputStream.close();
}
}
/**
- * Complex wrapper around return code with utility methods
- * Default is HTTP_OK
+ * Complex wrapper around url request Contains return code (default is
+ * HTTP_OK), length and last modified
+ *
+ * The storing of redirect target is quite obvious The storing length and
+ * last modified may be not, but appearently
+ * (http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2591) the url
+ * conenction is not always chaced as expected, and so another request may
+ * be sent when length and lastmodified are checked
+ *
*/
- private static class CodeWithRedirect {
+ static class UrlRequestResult {
int result = HttpURLConnection.HTTP_OK;
URL URL;
+ Long lastModified;
+ Long length;
+
+ public UrlRequestResult() {
+ }
+
+ public UrlRequestResult(URL URL) {
+ this.URL = URL;
+ }
+
+ URL getURL() {
+ return URL;
+ }
+
/**
- * @return whether the result code is redirect one. Rigth now 301-303 and 307-308
+ * @return whether the result code is redirect one. Rigth now 301-303
+ * and 307-308
*/
public boolean shouldRedirect() {
return (result == 301
@@ -445,11 +480,20 @@
}
/**
- * @return whether the return code is OK one - anything except <200,300)
+ * @return whether the return code is OK one - anything except <200,300)
*/
public boolean isInvalid() {
return (result < 200 || result >= 300);
}
+
+ @Override
+ public String toString() {
+ return ""
+ + "url: " + (URL == null ? "null" : URL.toExternalForm()) + "; "
+ + "result:" + result + "; "
+ + "lastModified: " + (lastModified == null ? "null" : lastModified.toString()) + "; "
+ + "length: " + length == null ? "null" : length.toString() + "; ";
+ }
}
private static class RedirectionException extends RuntimeException {
@@ -464,5 +508,4 @@
}
-
}
diff -r f48d4c62c2e3 -r 199702cfbca7 tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java Wed Jan 06 09:53:38 2016 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java Wed Jan 06 10:49:31 2016 +0100
@@ -19,7 +19,6 @@
import java.util.jar.Pack200;
import java.util.zip.GZIPOutputStream;
-
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -35,7 +34,7 @@
import net.sourceforge.jnlp.util.logging.NoStdOutErrTest;
import net.sourceforge.jnlp.util.logging.OutputController;
-public class ResourceDownloaderTest extends NoStdOutErrTest{
+public class ResourceDownloaderTest extends NoStdOutErrTest {
public static ServerLauncher testServer;
public static ServerLauncher testServerWithBrokenHead;
@@ -78,7 +77,6 @@
OutputController.getLogger().setOut(new PrintStream(currentErrorStream));
OutputController.getLogger().setErr(new PrintStream(currentErrorStream));
-
}
@AfterClass
@@ -130,7 +128,8 @@
redirectErr();
try {
File f = File.createTempFile(nameStub1, nameStub2);
- int i = ResourceDownloader.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.HEAD); Assert.assertEquals(HttpURLConnection.HTTP_OK, i);
+ int i = ResourceDownloader.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.HEAD);
+ Assert.assertEquals(HttpURLConnection.HTTP_OK, i);
f.delete();
i = ResourceDownloader.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.HEAD);
Assert.assertEquals(HttpURLConnection.HTTP_NOT_FOUND, i);
@@ -227,30 +226,29 @@
Resource r2 = Resource.getResource(testServerWithBrokenHead.getUrl(fileForServerWithoutHeader.getName()), null, UpdatePolicy.NEVER);
Resource r3 = Resource.getResource(testServer.getUrl(versionedFileForServerWithHeader.getName()), new Version("1.0"), UpdatePolicy.NEVER);
Resource r4 = Resource.getResource(testServerWithBrokenHead.getUrl(versionedFileForServerWithoutHeader.getName()), new Version("1.0"), UpdatePolicy.NEVER);
- assertOnServerWithHeader(resourceDownloader.findBestUrl(r1));
- assertVersionedOneOnServerWithHeader(resourceDownloader.findBestUrl(r3));
- assertOnServerWithoutHeader(resourceDownloader.findBestUrl(r2));
- assertVersionedOneOnServerWithoutHeader(resourceDownloader.findBestUrl(r4));
+ assertOnServerWithHeader(resourceDownloader.findBestUrl(r1).getURL());
+ assertVersionedOneOnServerWithHeader(resourceDownloader.findBestUrl(r3).URL);
+ assertOnServerWithoutHeader(resourceDownloader.findBestUrl(r2).URL);
+ assertVersionedOneOnServerWithoutHeader(resourceDownloader.findBestUrl(r4).URL);
fileForServerWithHeader.delete();
Assert.assertNull(resourceDownloader.findBestUrl(r1));
- assertVersionedOneOnServerWithHeader(resourceDownloader.findBestUrl(r3));
- assertOnServerWithoutHeader(resourceDownloader.findBestUrl(r2));
- assertVersionedOneOnServerWithoutHeader(resourceDownloader.findBestUrl(r4));
+ assertVersionedOneOnServerWithHeader(resourceDownloader.findBestUrl(r3).URL);
+ assertOnServerWithoutHeader(resourceDownloader.findBestUrl(r2).URL);
+ assertVersionedOneOnServerWithoutHeader(resourceDownloader.findBestUrl(r4).URL);
versionedFileForServerWithHeader.delete();
Assert.assertNull(resourceDownloader.findBestUrl(r1));
Assert.assertNull(resourceDownloader.findBestUrl(r3));
- assertOnServerWithoutHeader(resourceDownloader.findBestUrl(r2));
- assertVersionedOneOnServerWithoutHeader(resourceDownloader.findBestUrl(r4));
+ assertOnServerWithoutHeader(resourceDownloader.findBestUrl(r2).URL);
+ assertVersionedOneOnServerWithoutHeader(resourceDownloader.findBestUrl(r4).URL);
versionedFileForServerWithoutHeader.delete();
Assert.assertNull(resourceDownloader.findBestUrl(r1));
Assert.assertNull(resourceDownloader.findBestUrl(r3));
- assertOnServerWithoutHeader(resourceDownloader.findBestUrl(r2));
+ assertOnServerWithoutHeader(resourceDownloader.findBestUrl(r2).URL);
Assert.assertNull(resourceDownloader.findBestUrl(r4));
-
fileForServerWithoutHeader.delete();
Assert.assertNull(resourceDownloader.findBestUrl(r1));
Assert.assertNull(resourceDownloader.findBestUrl(r3));
@@ -283,6 +281,7 @@
assertPort(u, testServer.getPort());
assertVersion(u);
}
+
private void assertCommonComponentsOfUrl(URL u) {
Assert.assertTrue(u.getProtocol().equals("http"));
Assert.assertTrue(u.getHost().equals("localhost"));
@@ -311,7 +310,7 @@
redirectErrBack();
cacheDir = PathsAndFiles.CACHE_DIR.getFullPath();
- PathsAndFiles.CACHE_DIR.setValue(System.getProperty("java.io.tmpdir") + File.separator + "tempcache");
+ PathsAndFiles.CACHE_DIR.setValue(System.getProperty("java.io.tmpdir") + File.separator + "tempcache");
}
@AfterClass
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 09:49:53 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 09:49:53 +0000
Subject: [Bug 2591] IcedTea-Web request resources twice for meta informations
and causes ClientAbortException on tomcat in conjunction with
JnlpDownloadServlet
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2591
--- Comment #6 from hg commits ---
details:
http://icedtea.classpath.org//hg/release/icedtea-web-1.6?cmd=changeset;node=199702cfbca7
author: Jiri Vanek
date: Wed Jan 06 10:49:31 2016 +0100
Fixed PR2591 - IcedTea-Web request resources twice for meta informations
and causes ClientAbortException on tomcat in conjunction with
JnlpDownloadServlet
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 10:26:13 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 10:26:13 +0000
Subject: [Bug 2690] Can't run BOM into JNLP file.
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2690
JiriVanek changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from JiriVanek ---
Hello. Tagsoup is correctly rmeoving this from source so no direct patch will
be delivered to ITW.
However, tests for BOM will be added.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugzilla-daemon at icedtea.classpath.org Wed Jan 6 11:01:42 2016
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 11:01:42 +0000
Subject: [Bug 2690] Can't run BOM into JNLP file.
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2690
--- Comment #3 from JiriVanek ---
Anyway, sending to public review as future feature to resole its next destiny
for head.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From ptisnovs at icedtea.classpath.org Wed Jan 6 11:09:23 2016
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Wed, 06 Jan 2016 11:09:23 +0000
Subject: /hg/gfx-test: Updated comments in the class HtmlWriter.
Message-ID:
changeset e9bbfa68cc70 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=e9bbfa68cc70
author: Pavel Tisnovsky
date: Wed Jan 06 12:12:52 2016 +0100
Updated comments in the class HtmlWriter.
diffstat:
ChangeLog | 5 ++
src/org/gfxtest/ImageDiffer/ResultWriters/HtmlWriter.java | 29 ++++++++++++++-
2 files changed, 33 insertions(+), 1 deletions(-)
diffs (91 lines):
diff -r 61cadaf2583d -r e9bbfa68cc70 ChangeLog
--- a/ChangeLog Mon Jan 04 11:04:54 2016 +0100
+++ b/ChangeLog Wed Jan 06 12:12:52 2016 +0100
@@ -1,3 +1,8 @@
+2016-01-06 Pavel Tisnovsky
+
+ * src/org/gfxtest/ImageDiffer/ResultWriters/HtmlWriter.java:
+ Updated comments in the class HtmlWriter.
+
2016-01-04 Pavel Tisnovsky
* src/org/gfxtest/ImageDiffer/ResultWriters/HtmlStructureWriter.java:
diff -r 61cadaf2583d -r e9bbfa68cc70 src/org/gfxtest/ImageDiffer/ResultWriters/HtmlWriter.java
--- a/src/org/gfxtest/ImageDiffer/ResultWriters/HtmlWriter.java Mon Jan 04 11:04:54 2016 +0100
+++ b/src/org/gfxtest/ImageDiffer/ResultWriters/HtmlWriter.java Wed Jan 06 12:12:52 2016 +0100
@@ -1,7 +1,7 @@
/*
Java gfx-test framework
- Copyright (C) 2010, 2011 Red Hat
+ Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Red Hat
This file is part of IcedTea.
@@ -47,8 +47,16 @@
import org.gfxtest.ImageDiffer.ComparisonResult;
import org.gfxtest.ImageDiffer.Configuration;
+
+
+/**
+ * Class that can generates HTML page containing test results.
+ */
public class HtmlWriter extends ResultWriter
{
+ /**
+ * Header of HTML page + first part of its body.
+ */
private static final String HTML_HEADER =
"\n " +
@@ -62,30 +70,49 @@
" \n" +
" Test | Comparison result | Images | Perception | Diff image thumbnail |
\n";
+ /**
+ * Footer of HTML page.
+ */
private static final String HTML_FOOTER =
"
\n" +
"